summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorDale S. Rahn <rahnds@cvs.openbsd.org>1997-05-01 22:30:08 +0000
committerDale S. Rahn <rahnds@cvs.openbsd.org>1997-05-01 22:30:08 +0000
commitcf26606b2fb86ae321068e51808077bae31d13c3 (patch)
treedfdf4c237eff2137d364e9bb2834a043ee0b777a /gnu
parent99fe622cd1f484b14494b5c794da01c76f6d5ebf (diff)
Back out half of my changes to this file.
The way that I had done the sign extension was incorrect, but did happen to work on the archs tested. Changed back to the correct method. This was after some conversation with Ian Lance Taylor.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/binutils/gas/config/tc-ppc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gnu/usr.bin/binutils/gas/config/tc-ppc.c b/gnu/usr.bin/binutils/gas/config/tc-ppc.c
index 485da742473..b8de66a6131 100644
--- a/gnu/usr.bin/binutils/gas/config/tc-ppc.c
+++ b/gnu/usr.bin/binutils/gas/config/tc-ppc.c
@@ -1773,12 +1773,11 @@ md_assemble (str)
case BFD_RELOC_LO16:
if (operand->flags & PPC_OPERAND_SIGNED) {
- /* sign extend */
- signed short i;
- i = ex.X_add_number;
- ex.X_add_number = (int) i;
+ ex.X_add_number = (((ex.X_add_number & 0xffff)
+ ^ 0x8000)
+ - 0x8000);
} else {
- ex.X_add_number &= 0xffff;
+ ex.X_add_number &= 0xffff;
}
break;