Commit c411e9aa by Shiva Chen Committed by Chung-Ju Wu

[NDS32] Implment USE_LOAD_POST_INCREMENT, USE_LOAD_POST_DECREMENT,…

[NDS32] Implment USE_LOAD_POST_INCREMENT, USE_LOAD_POST_DECREMENT, USE_STORE_POST_DECREMENT and USE_STORE_POST_INCREMENT.

gcc/
	* 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.

From-SVN: r259552
parent 029db20e
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.
* config/nds32/nds32.c (nds32_ls_333_p): Remove.
......
......@@ -275,6 +275,8 @@ rtx extract_branch_target_rtx (rtx_insn *);
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 *);
......
......@@ -1354,6 +1354,14 @@ nds32_naked_function_p (tree func)
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.
......
......@@ -1083,6 +1083,12 @@ enum reg_class
/* 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment