+2018-04-22 Shiva Chen <shiva0217@gmail.com>
+
+ * config/nds32/nds32-protos.h (nds32_use_load_post_increment): Declare.
+ * config/nds32/nds32.c (nds32_use_load_post_increment): New.
+ * config/nds32/nds32.h
+ (USE_LOAD_POST_INCREMENT, USE_LOAD_POST_DECREMENT): Define.
+ (USE_STORE_POST_INCREMENT, USE_STORE_POST_DECREMENT): Define.
+
2018-04-22 Shiva Chen <shiva0217@gmail.com>
* config/nds32/nds32-protos.h (nds32_ls_333_p): Remove.
rtx extract_branch_condition_rtx (rtx_insn *);
} // namespace nds32
+extern bool nds32_use_load_post_increment(machine_mode);
+
/* Functions for create nds32 specific optimization pass. */
extern rtl_opt_pass *make_pass_nds32_relax_opt (gcc::context *);
return (t != NULL_TREE);
}
+/* Function that determine whether a load postincrement is a good thing to use
+ for a given mode. */
+bool
+nds32_use_load_post_increment (machine_mode mode)
+{
+ return (GET_MODE_SIZE (mode) <= GET_MODE_SIZE(E_DImode));
+}
+
/* Function that check if 'X' is a valid address register.
The variable 'STRICT' is very important to
make decision for register number.
/* We have "LW.bi Rt, [Ra], Rb" instruction form. */
#define HAVE_POST_MODIFY_REG 1
+#define USE_LOAD_POST_INCREMENT(mode) \
+ nds32_use_load_post_increment(mode)
+#define USE_LOAD_POST_DECREMENT(mode) USE_LOAD_POST_INCREMENT(mode)
+#define USE_STORE_POST_DECREMENT(mode) USE_LOAD_POST_DECREMENT(mode)
+#define USE_STORE_POST_INCREMENT(mode) USE_LOAD_POST_INCREMENT(mode)
+
#define CONSTANT_ADDRESS_P(x) (CONSTANT_P (x) && GET_CODE (x) != CONST_DOUBLE)
#define MAX_REGS_PER_ADDRESS 3