[NDS32] Implement bswapsi2 and bswaphi2 patterns.
gcc/ * config/nds32/nds32.md (bswapsi2, bswaphi2): New patterns. From-SVN: r260804
This commit is contained in:
parent
54c537e66c
commit
0be3bad705
2 changed files with 24 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2018-05-27 Chung-Ju Wu <jasonwucj@gmail.com>
|
||||
|
||||
* config/nds32/nds32.md (bswapsi2, bswaphi2): New patterns.
|
||||
|
||||
2018-05-27 Chung-Ju Wu <jasonwucj@gmail.com>
|
||||
|
||||
* config/nds32/nds32.c (nds32_attribute_table): Add "no_prologue".
|
||||
|
|
|
@ -2180,6 +2180,26 @@
|
|||
[(set_attr "type" "alu")
|
||||
(set_attr "length" "4")]
|
||||
)
|
||||
|
||||
(define_expand "bswapsi2"
|
||||
[(set (match_operand:SI 0 "register_operand" "=r")
|
||||
(bswap:SI (match_operand:SI 1 "register_operand" "r")))]
|
||||
""
|
||||
{
|
||||
emit_insn (gen_unspec_wsbh (operands[0], operands[1]));
|
||||
emit_insn (gen_rotrsi3 (operands[0], operands[0], GEN_INT (16)));
|
||||
DONE;
|
||||
})
|
||||
|
||||
(define_insn "bswaphi2"
|
||||
[(set (match_operand:HI 0 "register_operand" "=r")
|
||||
(bswap:HI (match_operand:HI 1 "register_operand" "r")))]
|
||||
""
|
||||
"wsbh\t%0, %1"
|
||||
[(set_attr "type" "alu")
|
||||
(set_attr "length" "4")]
|
||||
)
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
|
||||
;; Patterns for exception handling
|
||||
|
|
Loading…
Add table
Reference in a new issue