gas: maintain O_constant signedness in more cases
authorJan Beulich <jbeulich@suse.com>
Fri, 19 May 2023 07:16:04 +0000 (09:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 19 May 2023 07:16:04 +0000 (09:16 +0200)
commit762acf217c4013bed5a4cc679e4bac78d13ce23a
tree4f20ebf4c32d4a30e9e8c036a6f623f06145ccea
parentdf81d460b2d9ec7327a0c1ab2344d7ec62874ce0
gas: maintain O_constant signedness in more cases

Unary '~' doesn't really produce an unsigned result. Neither does
subtraction (unless taking operand values into consideration). And an
abstract operator applied to two operands which aren't both unsigned
can't be assumed to yield an unsigned result; exceptions are
- shifts, where only signedness of the left hand operand matters,
- comparisons, which - unlike unary '!' - produce signed results (they
  deliver 0 or ~0, as opposed to '!', which yields 0 or 1),
- logical operators (yielding 0 or 1 and hence treated like unary '!').

While doing this (specifically while extending the all/quad testcase),
update .quad and .8byte documentation: With 64-bit architectures now
being common, it is highly inappropriate to state that these directives
unconditionally require bignums.
gas/doc/as.texi
gas/expr.c
gas/testsuite/gas/all/gas.exp
gas/testsuite/gas/all/octa.d
gas/testsuite/gas/all/octa.s
gas/testsuite/gas/all/quad.d
gas/testsuite/gas/all/quad.s
gas/testsuite/gas/all/quad2.d [new file with mode: 0644]
gas/testsuite/gas/all/quad2.s [new file with mode: 0644]