+2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
+
+ * config/rl78/rl78-expand.md: New define_expand "bswaphi2"
+ * config/rl78/rl78-virt.md: New define_insn "*bswaphi2_virt"
+ * config/rl78/rl78-real.md: New define_insn "*bswaphi2_real"
+
2018-01-22 Sebastian Perta <sebastian.perta@renesas.com>
* config/rl78/rl78-protos.h: New function declaration rl78_split_movdi
[(set_attr "valloc" "op1")]
)
+(define_expand "bswaphi2"
+ [(set (match_operand:HI 0 "nonimmediate_operand")
+ (bswap:HI (match_operand:HI 1 "general_operand")))]
+ ""
+ "if (rl78_force_nonfar_2 (operands, gen_bswaphi2))
+ DONE;"
+)
+
;;---------- Conversions ------------------------
(define_expand "zero_extendqihi2"
movw\t%0, %1"
)
+(define_insn "*bswaphi2_real"
+ [(set (match_operand:HI 0 "rl78_nonfar_nonimm_operand" "=A,A")
+ (bswap:HI (match_operand:HI 1 "general_operand" "0,viU")))]
+ "rl78_real_insns_ok ()"
+ "@
+ xch\ta, x
+ movw\tax, %1\n\txch\ta, x"
+)
+
;;---------- Conversions ------------------------
(define_insn "*zero_extendqihi2_real"
[(set_attr "valloc" "op1")]
)
+(define_insn "*bswaphi2_virt"
+ [(set (match_operand:HI 0 "rl78_nonfar_nonimm_operand" "=vm")
+ (bswap:HI (match_operand:HI 1 "general_operand" "vim")))]
+ "rl78_virt_insns_ok ()"
+ "v.bswaphi\t%0, %1"
+ [(set_attr "valloc" "op1")]
+)
+
;;---------- Conversions ------------------------
(define_insn "*zero_extendqihi2_virt"