diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1997-01-26 08:17:28 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1997-01-26 08:17:28 +0000 |
commit | 805ef652e0a80e9d9243241255222ef33adca97c (patch) | |
tree | 3467a466f37f074e656b14395f8cc027589105b6 | |
parent | b714d2236d5b5117e39b441ebaa3bc772cc08973 (diff) |
change constant handling with @l.
if the expected argument to the opcode is unsigned,
return (val & 0xffff)
if the expected argument to the occode is signed,
sign extend the 16 bit value
short = val;
val = (int) short;
-rw-r--r-- | gnu/usr.bin/binutils/gas/config/tc-ppc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gnu/usr.bin/binutils/gas/config/tc-ppc.c b/gnu/usr.bin/binutils/gas/config/tc-ppc.c index 1a0d297510d..485da742473 100644 --- a/gnu/usr.bin/binutils/gas/config/tc-ppc.c +++ b/gnu/usr.bin/binutils/gas/config/tc-ppc.c @@ -1772,12 +1772,14 @@ md_assemble (str) break; case BFD_RELOC_LO16: - if (ex.X_unsigned) - ex.X_add_number &= 0xffff; - else - ex.X_add_number = (((ex.X_add_number & 0xffff) - ^ 0x8000) - - 0x8000); + if (operand->flags & PPC_OPERAND_SIGNED) { + /* sign extend */ + signed short i; + i = ex.X_add_number; + ex.X_add_number = (int) i; + } else { + ex.X_add_number &= 0xffff; + } break; case BFD_RELOC_HI16: |