MSP430: Define extendqipsi2
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Tue, 21 Jul 2020 16:24:03 +0000 (17:24 +0100)
committerJozef Lawrynowicz <jozef.l@mittosystems.com>
Tue, 21 Jul 2020 16:32:06 +0000 (17:32 +0100)
The SXT instruction extends the sign of the low byte of the operand
through the entire PSImode register.
SXTX.A can be used to sign extend the low byte of a memory operand
through to the 19th bit. Bits 31:20 are cleared.

gcc/ChangeLog:

* config/msp430/msp430.md: New "extendqipsi2" define_insn.

gcc/config/msp430/msp430.md

index b6602fb..99299bd 100644 (file)
    SXT%X0\t%0"
 )
 
+(define_insn "extendqipsi2"
+  [(set (match_operand:PSI                0 "msp430_general_dst_operand" "=r,m")
+       (sign_extend:PSI (match_operand:QI 1 "msp430_general_operand" "0,0")))]
+  ""
+  "@
+  SXT\t%0
+  SXTX.A\t%0"
+)
+
 ;; ------------------------
 ;; ZERO EXTEND INSTRUCTIONS
 ;; Byte-writes to registers clear bits 19:8