hello,
there is a 'movm' problem that puzzled me. In my target machine,
to load a large immediate data, can only move into zero register "R0".
but R0 is a generally register. I defined the the way in the
following:
if the immediate data (op1) is larger than 1024
then do
{
emit_move_insn(r0_reg_rtx, gen_rtx_CONST_INT(SImode, op1));
//Move the immediate data into R0 register
emit_move_insn(force_reg (mode, operands[0]), r0_reg_rtx);
//move r0 to default register.
}
I have tested the way , it works. But while in optimization, it
causes some redundency codes. like the following c code,(iFrequency is
byte globel data, common_reg, DiffReg are byte globel arrays)
int i = 0;
BYTE* pDiffPair = common_reg + (COMMON_REG_WRITE << 1), *pData =
DiffReg;
*(pDiffPair + 1) = *(pData + iFrequency);
pData = pData + 36;
*(pDiffPair + 5) = *(pData + iFrequency);
pData = pData + 36;
*(pDiffPair + 7) = *(pData + iFrequency);
pData = pData + 36;
*(pDiffPair + 11) = *(pData + iFrequency);
pData = pData + 36;
*(pDiffPair + 15) = *(pData + iFrequency);
pData = pData + 36;
*(pDiffPair + 17) = *(pData + iFrequency);
the address label "common_reg " used many times. I think it will
load one time. But after optimized with '-Os' or '-O2', it still loads
the label "common_reg " six times..
I guess it definitely caused by "move large immediate" insns.
I don't know how to solve this problem.
Does the macro "PREFERRED_RELOAD_CLASS" handle it?
Any advice is appreciated.
Thank you very much.
daniel.tian