for 64-bit host.
* gas/sh/sign-extension.d: New file.
* gas/sh/sign-extension.s: New file.
* gas/sh/basic.exp: Run new test.
+2009-08-29 Matt Fleming <matt@console-pimps.org>
+
+ * config/tc-sh.c (md_apply_fix): Extend sign of the offset value
+ for 64-bit host.
+
2009-08-28 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (cpu_arch): Use PROCESSOR_L1OM on "l1om".
/* tc-sh.c -- Assemble code for the Renesas / SuperH SH
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
val = ((val >> shift)
| ((long) -1 & ~ ((long) -1 >> shift)));
}
+
+ /* Extend sign for 64-bit host. */
+ val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
if (max != 0 && (val < min || val > max))
as_bad_where (fixP->fx_file, fixP->fx_line, _("offset out of range"));
else if (max != 0)
+2009-08-29 Matt Fleming <matt@console-pimps.org>
+
+ * gas/sh/sign-extension.d: New file.
+ * gas/sh/sign-extension.s: New file.
+ * gas/sh/basic.exp: Run new test.
+
2009-08-28 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/l1om.d: Check elf64-l1om format.
-# Copyright (C) 1995, 1996, 1997, 2002, 2003, 2004, 2007
+# Copyright (C) 1995, 1996, 1997, 2002, 2003, 2004, 2007, 2009
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
run_dump_test "reg-prefix"
run_dump_test "too_large"
+
+ run_dump_test "sign-extension"
}
}
--- /dev/null
+#as: -little
+#objdump: -drj.text
+#name: Sign-extended immediate
+
+.*: file format .*sh.*
+
+Disassembly of section \.text:
+
+00000000 <foo>:
+ 0: f0 e0 mov #-16,r0
+ 2: 09 00 nop
--- /dev/null
+ .align 2
+foo:
+ mov #0xfffffff0, r0