Commit 2cf09a99 by Kito Cheng Committed by Chung-Ju Wu

[NDS32] Implement movmisalignsi and movmisaligndi pattern.

gcc/
	* config/nds32/nds32.md (movmisalign<mode>): New pattern.

Co-Authored-By: Monk Chiang <sh.chiang04@gmail.com>

From-SVN: r259073
parent bb347ee2
2018-04-04 Kito Cheng <kito.cheng@gmail.com>
Monk Chiang <sh.chiang04@gmail.com>
* config/nds32/nds32.md (movmisalign<mode>): New pattern.
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>. * config/nds32/nds32.md (movqi, movhi): Merge into mov<mode>.
......
...@@ -101,6 +101,27 @@ ...@@ -101,6 +101,27 @@
} }
}) })
(define_expand "movmisalign<mode>"
[(set (match_operand:SIDI 0 "general_operand" "")
(match_operand:SIDI 1 "general_operand" ""))]
""
{
rtx addr;
if (MEM_P (operands[0]) && !REG_P (operands[1]))
operands[1] = force_reg (<MODE>mode, operands[1]);
if (MEM_P (operands[0]))
{
addr = force_reg (Pmode, XEXP (operands[0], 0));
emit_insn (gen_unaligned_store<mode> (addr, operands[1]));
}
else
{
addr = force_reg (Pmode, XEXP (operands[1], 0));
emit_insn (gen_unaligned_load<mode> (operands[0], addr));
}
DONE;
})
(define_expand "movsi" (define_expand "movsi"
[(set (match_operand:SI 0 "general_operand" "") [(set (match_operand:SI 0 "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