movsi on a 16 bit machine
Florent Defay
spira.inhabitant@gmail.com
Mon Jul 20 13:33:00 GMT 2009
Hello,
I am working on a new port for a 16-bit machine.
I have trouble with movsi.
As the machine is 16-bit, movsi cannot be done in one shot. So I split
it into two movhi:
(define_insn_and_split "movsi"
[(set (match_operand:SI 0 "nonimmediate_operand" "=r,m")
(match_operand:SI 1 "general_operand" "rim,r"))]
""
"#"
"reload_completed"
[(set (match_dup 2)
(match_dup 3))
(set (match_dup 4)
(match_dup 5))]
{
operands[2] = simplify_gen_subreg(HImode,operands[0],SImode,0);
operands[4] = simplify_gen_subreg(HImode,operands[0],SImode,2);
operands[3] = simplify_gen_subreg(HImode,operands[1],SImode,0);
operands[5] = simplify_gen_subreg(HImode,operands[1],SImode,2);
}
)
But there is a problem (rare) when the following case is encountered:
move 4(R0),R0
move 6(R0),R1
Here, the operands considered are:
operand0: R0:R1 (16 bits + 16 bits)
operand1: 4(R0):6(R0) (16 bits + 16 bits)
this should be moving operand1 into operand0 but operand1 is addressed
by R0 and R0 is modified at first line, so second line is false.
I would like to modify the implementation to fix it but I do not know how.
Please help.
Regards,
Florent.
More information about the Gcc-help
mailing list