Hi,
Below are macro definitions for valid memory operand.
My goal is to generate a 3rd operand shift based load instruction.
My load instruction has three operands. I want a shift on third operand .
First operand is destination , second operand is base , third operand is
offset/index(reg).
with the below defined macros , I am not able to generate the
instruction i want .( ldw rd, rm ,rn << #k)
Any help is highly appreciated .
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
{ if (RTX_OK_FOR_BASE_P ((X))) \
goto ADDR; \
if((LEGITIMATE_OFFSET_ADDRESS_P (MODE, (X)))) \
goto ADDR; \
if (LEGITIMATE_AUTOINC_ADDRESS_P (MODE, (X))) \
goto ADDR; \
}
#define RTX_OK_FOR_BASE_P(X) \
(GET_CODE(X) == REG && REG_OK_FOR_BASE_P ((X)))
#define RTX_OK_FOR_INDEX_P(X) \
(GET_CODE(X) == REG && REG_OK_FOR_INDEX_P ((X)))
#define RTX_OK_FOR_OFFSET_P(X) \
(GET_CODE (X) == CONST_INT && (-4096 <=(INTVAL (X)) && (INTVAL (X))<=
4095))
#define RTX_OK_FOR_SHIFT_P(X) \
(((GET_CODE (X) == ASHIFT)) \
&& ((GET_CODE(XEXP(X,0)) == REG) && REG_OK_FOR_INDEX_P(XEXP(X,0)))
&& (GET_CODE(XEXP(X,1)) == CONST_INT))
#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \
(((GET_CODE (X) == PLUS)) \
&& RTX_OK_FOR_BASE_P (XEXP ((X), 0)) \
&& (RTX_OK_FOR_OFFSET_P (XEXP ((X), 1)) || RTX_OK_FOR_INDEX_P(XEXP
((X), 1) ) || RTX_OK_FOR_SHIFT_P(XEXP((X),1))))
#define LEGITIMATE_AUTOINC_ADDRESS_P(MODE, X) \
(((GET_CODE (X) == POST_INC) || (GET_CODE (X) == POST_DEC) \
|| (GET_CODE (X) == PRE_INC) || (GET_CODE (X) == PRE_DEC) \
|| (GET_CODE (X) == POST_MODIFY) || (GET_CODE (X) == PRE_MODIFY)) \
&& RTX_OK_FOR_BASE_P (XEXP ((X), 0)))
Thanks,
Sumanth G