Hi Guys,

  I am applying the patch below to fix a problem with the MSP430's
  zero_extendhipsi2 pattern.  When the destination is memory, four bytes
  must be written, even though only a 20-bit value is being stored, as
  otherwise the top nibble will be lost.

Cheers
  Nick

gcc/ChangeLog
2015-07-01  Nick Clifton  <ni...@redhat.com>

        * config/msp430/msp430.md (zero_extendhipsi2): Use MOVX.A to store
        a 16-bit value into a 20-bit memory slot.

Index: config/msp430/msp430.md
===================================================================
--- config/msp430/msp430.md     (revision 225239)
+++ config/msp430/msp430.md     (working copy)
@@ -572,7 +572,9 @@
   [(set (match_operand:PSI                 0 "msp_nonimmediate_operand" "=r,m")
        (zero_extend:PSI (match_operand:HI 1 "msp_nonimmediate_operand" 
"rm,r")))]
   ""
-  "MOVX\t%1, %0"
+  "@
+  MOVX\t%1, %0
+  MOVX.A\t%1, %0"
 )
 
 (define_insn "truncpsihi2"

Reply via email to