Skip to content

Commit 81c966d

Browse files
artemiy-volkovMichielDerhaeg
authored andcommitted
arcv: introduce --param=arcv-ld-cycles
Since it is critical to scheduling for the RMX-100 core, allow setting load latency via a newly create target-specific arcv-ld-cycles parameter. The worst case latency is 3, and so is the parameter's default value. Signed-off-by: Artemiy Volkov <artemiy@synopsys.com>
1 parent ea133b7 commit 81c966d

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

gcc/config/riscv/arcv-rmx100.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@
5454

5555
(define_insn_reservation "arcv_rmx100_load_insn" 3
5656
(and (eq_attr "tune" "arcv_rmx100")
57-
(eq_attr "type" "load,fpload"))
57+
(eq_attr "type" "load"))
58+
"arcv_rmx100_DMP,nothing*2")
59+
60+
(define_insn_reservation "arcv_rmx100_fpload_insn" 3
61+
(and (eq_attr "tune" "arcv_rmx100")
62+
(eq_attr "type" "fpload"))
5863
"arcv_rmx100_DMP,nothing*2")
5964

6065
(define_insn_reservation "arcv_rmx100_store_insn" 1
@@ -109,3 +114,6 @@
109114

110115
(define_bypass 9 "arcv_rmx100_div_insn" "arcv_rmx100_*" "arcv_mpy_1c_bypass_p")
111116
(define_bypass 9 "arcv_rmx100_div_insn" "arcv_rmx100_*" "arcv_mpy_2c_bypass_p")
117+
118+
(define_bypass 1 "arcv_rmx100_load_insn" "arcv_rmx100_*" "arcv_ld_1c_bypass_p")
119+
(define_bypass 2 "arcv_rmx100_load_insn" "arcv_rmx100_*" "arcv_ld_2c_bypass_p")

gcc/config/riscv/riscv-protos.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ extern bool riscv_store_data_bypass_p (rtx_insn *, rtx_insn *);
168168
extern bool arcv_mpy_1c_bypass_p (rtx_insn *, rtx_insn *);
169169
extern bool arcv_mpy_2c_bypass_p (rtx_insn *, rtx_insn *);
170170
extern bool arcv_mpy_10c_bypass_p (rtx_insn *, rtx_insn *);
171+
extern bool arcv_ld_1c_bypass_p (rtx_insn *, rtx_insn *);
172+
extern bool arcv_ld_2c_bypass_p (rtx_insn *, rtx_insn *);
171173
extern rtx riscv_gen_gpr_save_insn (struct riscv_frame_info *);
172174
extern bool riscv_gpr_save_operation_p (rtx);
173175
extern void riscv_reinit (void);

gcc/config/riscv/riscv.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10018,6 +10018,20 @@ arcv_mpy_10c_bypass_p (rtx_insn *out_insn ATTRIBUTE_UNUSED,
1001810018
return arcv_mpy_option == ARCV_MPY_OPTION_10C;
1001910019
}
1002010020

10021+
bool
10022+
arcv_ld_1c_bypass_p (rtx_insn *out_insn ATTRIBUTE_UNUSED,
10023+
rtx_insn *in_insn ATTRIBUTE_UNUSED)
10024+
{
10025+
return arcv_ld_cycles == 1;
10026+
}
10027+
10028+
bool
10029+
arcv_ld_2c_bypass_p (rtx_insn *out_insn ATTRIBUTE_UNUSED,
10030+
rtx_insn *in_insn ATTRIBUTE_UNUSED)
10031+
{
10032+
return arcv_ld_cycles == 2;
10033+
}
10034+
1002110035
/* Implement TARGET_SECONDARY_MEMORY_NEEDED.
1002210036
1002310037
When floating-point registers are wider than integer ones, moves between

gcc/config/riscv/riscv.opt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,7 @@ Enum(arcv_mpy_option) String(10c) Value(ARCV_MPY_OPTION_10C)
413413
-param=arcv-mpy-option=
414414
Target RejectNegative Joined Enum(arcv_mpy_option) Var(arcv_mpy_option) Init(ARCV_MPY_OPTION_2C)
415415
The type of MPY unit used by the RMX-100 core (to be used in combination with -mtune=rmx100) (default: 2c).
416+
417+
-param=arcv-ld-cycles=
418+
Target Joined UInteger Var(arcv_ld_cycles) Init(3) IntegerRange(1, 3) Param
419+
A number of cycles that a word-size integer load operation takes (1-3) (default: 3).

0 commit comments

Comments
 (0)