diff mbox

Commit: MSP430: Enhance the zero_extendhisi2 pattern

Message ID 87bnhgu731.fsf@redhat.com
State New
Headers show

Commit Message

Nick Clifton May 19, 2015, 11:42 a.m. UTC
Hi Guys,

  I am applying the patch below to enhance the zero_extendhisi2 pattern
  in the MSP430 backend so that it can cope with separate source and
  destination registers.  This makes zero extending into another
  register more efficient and it also helps to work around a reload bug
  reported in PR 66156.

Cheers
  Nick

gcc/ChangeLog
2015-05-19  Nick Clifton  <nickc@redhat.com>

	PR target/66156
	* config/msp430/msp430.md (zero_extendhisi2): Add support for
	separate source and destination registers.
diff mbox

Patch

Index: gcc/config/msp430/msp430.md
===================================================================
--- gcc/config/msp430/msp430.md	(revision 223348)
+++ gcc/config/msp430/msp430.md	(working copy)
@@ -588,10 +588,12 @@ 
 ;; patterns.  Doing these manually allows for alternate optimization
 ;; paths.
 (define_insn "zero_extendhisi2"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
-	(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0")))]
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
+	(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,r")))]
   "msp430x"
-  "MOV.W\t#0,%H0"
+  "@
+  MOV.W\t#0,%H0
+  MOV.W\t%1,%L0 { MOV.W\t#0,%H0"
 )
 
 (define_insn "zero_extendhisipsi2"