+2018-04-05 Shiva Chen <shiva0217@gmail.com>
+ Kito Cheng <kito.cheng@gmail.com>
+
+ * config/nds32/constraints.md (U33): Fine-tune checking condition.
+ * config/nds32/nds32-md-auxiliary.c (nds32_mem_format): Ditto.
+ * config/nds32/nds32.h (nds32_16bit_address_type): Add
+ ADDRESS_POST_MODIFY_LO_REG_IMM3U.
+
2018-04-05 Shiva Chen <shiva0217@gmail.com>
Kito Cheng <kito.cheng@gmail.com>
(define_memory_constraint "U33"
"Memory constraint for 333 format"
(and (match_code "mem")
- (match_test "nds32_mem_format (op) == ADDRESS_LO_REG_IMM3U")))
+ (match_test "nds32_mem_format (op) == ADDRESS_POST_INC_LO_REG_IMM3U
+ || nds32_mem_format (op) == ADDRESS_POST_MODIFY_LO_REG_IMM3U
+ || nds32_mem_format (op) == ADDRESS_LO_REG_IMM3U")))
(define_memory_constraint "U45"
"Memory constraint for 45 format"
{
regno = REGNO (XEXP (XEXP (op, 1), 0));
val = INTVAL (XEXP (XEXP (op, 1), 1));
- if (regno < 8 && val < 32)
- return ADDRESS_POST_INC_LO_REG_IMM3U;
+ if (regno < 8 && val > 0 && val < 32)
+ return ADDRESS_POST_MODIFY_LO_REG_IMM3U;
}
if ((GET_CODE (op) == PLUS)
regno = REGNO(XEXP (op, 0));
- if (regno > 7
+ if (regno > 8
&& regno != SP_REGNUM
&& regno != FP_REGNUM)
return ADDRESS_NOT_16BIT_FORMAT;
output_asm_insn (pattern, operands);
break;
case ADDRESS_POST_INC_LO_REG_IMM3U:
- snprintf (pattern, sizeof (pattern), "s%ci333.bi\t%%1, %%0", size);
+ snprintf (pattern, sizeof (pattern), "swi333.bi\t%%1, %%0, 4");
+ output_asm_insn (pattern, operands);
+ break;
+ case ADDRESS_POST_MODIFY_LO_REG_IMM3U:
+ snprintf (pattern, sizeof (pattern), "swi333.bi\t%%1, %%0");
output_asm_insn (pattern, operands);
break;
case ADDRESS_FP_IMM7U:
output_asm_insn (pattern, operands);
break;
case ADDRESS_POST_INC_LO_REG_IMM3U:
- snprintf (pattern, sizeof (pattern), "l%ci333.bi\t%%0, %%1", size);
+ snprintf (pattern, sizeof (pattern), "lwi333.bi\t%%0, %%1, 4");
+ output_asm_insn (pattern, operands);
+ break;
+ case ADDRESS_POST_MODIFY_LO_REG_IMM3U:
+ snprintf (pattern, sizeof (pattern), "lwi333.bi\t%%0, %%1");
output_asm_insn (pattern, operands);
break;
case ADDRESS_R8_IMM7U: