+2002-01-03 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.c (output_logical_op): Use 'not.w' instead
+ of 'neg.w' when xoring with 0x0000ffff or 0xffff0000.
+
2002-01-03 Neil Booth <neil@daikokuya.demon.co.uk>
* cpperror.c: Update comments and copyright.
/* First, see if we can finish with one insn.
If code is either AND or XOR, we exclude two special cases,
- 0xffffff00 and 0xffff00ff, because insns like sub.w or neg.w
+ 0xffffff00 and 0xffff00ff, because insns like sub.w or not.w
can do a better job. */
if ((TARGET_H8300H || TARGET_H8300S)
&& ((det & 0x0000ffff) != 0)
&& ((det & 0x0000ffff) == 0x0000ffff)
&& code != IOR)
output_asm_insn ((code == AND)
- ? "sub.w\t%f0,%f0" : "neg.w\t%f0",
+ ? "sub.w\t%f0,%f0" : "not.w\t%f0",
operands);
else if ((TARGET_H8300H || TARGET_H8300S)
&& ((det & 0x000000ff) != 0)
&& ((det & 0xffff0000) == 0xffff0000)
&& code != IOR)
output_asm_insn ((code == AND)
- ? "sub.w\t%e0,%e0" : "neg.w\t%e0",
+ ? "sub.w\t%e0,%e0" : "not.w\t%e0",
operands);
else if (TARGET_H8300H || TARGET_H8300S)
{
+2002-01-03 Kazu Hirata <kazu@hxi.com>
+
+ * gcc.c-torture/execute/20020103-1.c: New test.
+
2002-01-03 Jakub Jelinek <jakub@redhat.com>
* g++.dg/other/debug2.C: New test.
--- /dev/null
+/* On h8300 port, the following used to be broken with -mh or -ms. */
+
+extern void abort (void);
+extern void exit (int);
+
+unsigned long
+foo (unsigned long a)
+{
+ return a ^ 0x0000ffff;
+}
+
+unsigned long
+bar (unsigned long a)
+{
+ return a ^ 0xffff0000;
+}
+
+int
+main ()
+{
+ if (foo (0) != 0x0000ffff)
+ abort ();
+
+ if (bar (0) != 0xffff0000)
+ abort ();
+
+ exit (0);
+}