Commit 76dc9cb5 by Chung-Ju Wu Committed by Chung-Ju Wu

[NDS32] Merge movqi and movhi patterns.

gcc/
	* config/nds32/nds32.md (movqi, movhi): Merge into mov<mode>.

From-SVN: r259071
parent 6e9ca932
2018-04-04 Chung-Ju Wu <jasonwucj@gmail.com> 2018-04-04 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.md (movqi, movhi): Merge into mov<mode>.
2018-04-04 Chung-Ju Wu <jasonwucj@gmail.com>
Kito Cheng <kito.cheng@gmail.com> Kito Cheng <kito.cheng@gmail.com>
* config/nds32/nds32-md-auxiliary.c (nds32_inverse_cond_code, * config/nds32/nds32-md-auxiliary.c (nds32_inverse_cond_code,
......
...@@ -83,26 +83,25 @@ ...@@ -83,26 +83,25 @@
;; For QImode and HImode, the immediate value can be fit in imm20s. ;; For QImode and HImode, the immediate value can be fit in imm20s.
;; So there is no need to split rtx for QI and HI patterns. ;; So there is no need to split rtx for QI and HI patterns.
(define_expand "movqi" (define_expand "mov<mode>"
[(set (match_operand:QI 0 "general_operand" "") [(set (match_operand:QIHI 0 "general_operand" "")
(match_operand:QI 1 "general_operand" ""))] (match_operand:QIHI 1 "general_operand" ""))]
"" ""
{ {
/* Need to force register if mem <- !reg. */ /* Need to force register if mem <- !reg. */
if (MEM_P (operands[0]) && !REG_P (operands[1])) if (MEM_P (operands[0]) && !REG_P (operands[1]))
operands[1] = force_reg (QImode, operands[1]); operands[1] = force_reg (<MODE>mode, operands[1]);
})
(define_expand "movhi" if (MEM_P (operands[1]) && optimize > 0)
[(set (match_operand:HI 0 "general_operand" "") {
(match_operand:HI 1 "general_operand" ""))] rtx reg = gen_reg_rtx (SImode);
""
{ emit_insn (gen_zero_extend<mode>si2 (reg, operands[1]));
/* Need to force register if mem <- !reg. */ operands[1] = gen_lowpart (<MODE>mode, reg);
if (MEM_P (operands[0]) && !REG_P (operands[1])) }
operands[1] = force_reg (HImode, operands[1]);
}) })
(define_expand "movsi" (define_expand "movsi"
[(set (match_operand:SI 0 "general_operand" "") [(set (match_operand:SI 0 "general_operand" "")
(match_operand:SI 1 "general_operand" ""))] (match_operand:SI 1 "general_operand" ""))]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment