Commit 187462ac by Kazu Hirata Committed by Kazu Hirata

h8300.c (output_logical_op): Use 'not.w' instead of 'neg.w' when xoring with…

h8300.c (output_logical_op): Use 'not.w' instead of 'neg.w' when xoring with 0x0000ffff or 0xffff0000.

	* config/h8300/h8300.c (output_logical_op): Use 'not.w' instead
	of 'neg.w' when xoring with 0x0000ffff or 0xffff0000.

From-SVN: r48524
parent 619acae7
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.
......
......@@ -1681,7 +1681,7 @@ output_logical_op (mode, code, operands)
/* 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)
......@@ -1704,7 +1704,7 @@ output_logical_op (mode, code, operands)
&& ((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)
......@@ -1731,7 +1731,7 @@ output_logical_op (mode, code, operands)
&& ((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.
......
/* 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment