Patchwork pdp11: fix wrong code

login
register
mail settings
Submitter Paul Koning
Date Nov. 21, 2010, 4:57 p.m.
Message ID <849AE7BD-B6DC-4BAF-A05C-3C60793F79BF@dell.com>
Download mbox | patch
Permalink /patch/72446/
State New
Headers show

Comments

Paul Koning - Nov. 21, 2010, 4:57 p.m.
This patch corrects mishandling the carry between words in negsi.

Tested by build and make check.  Committed.

	paul

ChangeLog:

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

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

Patch

Index: config/pdp11/pdp11.md
===================================================================
--- config/pdp11/pdp11.md	(revision 166978)
+++ config/pdp11/pdp11.md	(working copy)
@@ -1149,12 +1149,13 @@ 
   operands[1] = gen_rtx_REG (HImode, REGNO (operands[1]) + 1);
 
   output_asm_insn (\"com %0\", lateoperands);
-  output_asm_insn (\"neg %0\", operands);
+  output_asm_insn (\"com %0\", operands);
+  output_asm_insn (\"add $1, %0\", operands);
   output_asm_insn (\"adc %0\", lateoperands);
 
   return \"\";
 }
-  [(set_attr "length" "10")])
+  [(set_attr "length" "14")])
 
 (define_insn "neghi2"
   [(set (match_operand:HI 0 "nonimmediate_operand" "=rR,Q")