Patchwork pdp11: fix wrong code

login
register
mail settings
Submitter Paul Koning
Date Nov. 9, 2010, 1:11 a.m.
Message ID <70885C3C-1D35-4F79-AD6D-E616917F5397@dell.com>
Download mbox | patch
Permalink /patch/70483/
State New
Headers show

Comments

Paul Koning - Nov. 9, 2010, 1:11 a.m.
This patch fixes wrong assembly output for negsi2 (incorrect carry propagation from low to high half).

Tested by build and inspection of output.  Committed.

	paul

ChangeLog:

2010-11-08  Paul Koning  <ni1d@arrl.net>

	* config/pdp11/pdp11.md (negsi2): Fix wrong code.

Patch

Index: config/pdp11/pdp11.md
===================================================================
--- config/pdp11/pdp11.md	(revision 166433)
+++ config/pdp11/pdp11.md	(working copy)
@@ -1091,9 +1091,8 @@ 
   lateoperands[1] = operands[1];
   operands[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
 
-  output_asm_insn (\"com %0\", operands);
   output_asm_insn (\"com %0\", lateoperands);
-  output_asm_insn (\"inc %0\", operands);
+  output_asm_insn (\"neg %0\", operands);
   output_asm_insn (\"adc %0\", lateoperands);
 
   return \"\";