diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-07-21 17:24:03 +0100 |
---|---|---|
committer | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-07-21 17:32:06 +0100 |
commit | aa360dd1c882b943066ba088861c0bfac9df930d (patch) | |
tree | bd3bbe461f762d7a2584f0f58af6283698f639f2 /gcc/config/msp430 | |
parent | 111afded7fdf46ce14972aa8a72c26c9a180ab70 (diff) | |
download | gcc-aa360dd1c882b943066ba088861c0bfac9df930d.zip gcc-aa360dd1c882b943066ba088861c0bfac9df930d.tar.gz gcc-aa360dd1c882b943066ba088861c0bfac9df930d.tar.bz2 |
MSP430: Define extendqipsi2
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.
Diffstat (limited to 'gcc/config/msp430')
-rw-r--r-- | gcc/config/msp430/msp430.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/config/msp430/msp430.md b/gcc/config/msp430/msp430.md index b6602fb..99299bd 100644 --- a/gcc/config/msp430/msp430.md +++ b/gcc/config/msp430/msp430.md @@ -553,6 +553,15 @@ 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 |