Skip to content

Commit c8067d6

Browse files
artemiy-volkovMichielDerhaeg
authored andcommitted
arcv: add FPU insn latencies to the RMX-100 scheduling model
This patch adds latencies related to FPU instructions to arcv-rmx100.md. The specific values used correspond to the 'fast' config, except fdiv where the latency was reduced to 10 cycles. In the future, FP latencies for RMX-100 should be made dependent on an external (-mfpu-like) option. Signed-off-by: Artemiy Volkov <artemiy@synopsys.com>
1 parent a32098e commit c8067d6

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

gcc/config/riscv/arcv-rmx100.md

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,55 +54,47 @@
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"))
5858
"arcv_rmx100_DMP,nothing*2")
5959

6060
(define_insn_reservation "arcv_rmx100_store_insn" 1
6161
(and (eq_attr "tune" "arcv_rmx100")
6262
(eq_attr "type" "store,fpstore"))
6363
"arcv_rmx100_DMP")
6464

65+
;; FPU scheduling. FIXME: This is based on the "fast" unit for now, the "slow"
66+
;; option remains to be implemented later (together with the -mfpu flag).
67+
68+
(define_insn_reservation "arcv_rmx100_fpload_insn" 3
69+
(and (eq_attr "tune" "arcv_rmx100")
70+
(eq_attr "type" "fpload"))
71+
"arcv_rmx100_DMP,nothing*2")
72+
6573
(define_insn_reservation "arcv_rmx100_farith_insn" 2
6674
(and (eq_attr "tune" "arcv_rmx100")
67-
(eq_attr "type" "fadd,fmul,fmadd,fcmp"))
68-
"arcv_rmx100_FPU*2")
75+
(eq_attr "type" "fadd,fcmp"))
76+
"arcv_rmx100_FPU,nothing")
6977

70-
(define_insn_reservation "arcv_rmx100_xfer" 2
78+
(define_insn_reservation "arcv_rmx100_xfer" 1
7179
(and (eq_attr "tune" "arcv_rmx100")
7280
(eq_attr "type" "fmove,mtc,mfc,fcvt,fcvt_f2i,fcvt_i2f"))
73-
"arcv_rmx100_FPU*2")
74-
75-
;;(define_insn_reservation "core" 1
76-
;; (eq_attr "type" "block, brk, dmb, flag, lr, sr, sync")
77-
;; "arcv_rmx100_ALU0 + arcv_rmx100_ALU1 + arcv_rmx100_DMP + arcv_rmx100_MPY + arcv_rmx100_MPY64 + arcv_rmx100_DIV")
81+
"arcv_rmx100_FPU")
7882

79-
(define_insn_reservation "arcv_rmx100_fmul_half" 5
83+
(define_insn_reservation "arcv_rmx100_fmul_insn" 2
8084
(and (eq_attr "tune" "arcv_rmx100")
81-
(and (eq_attr "type" "fadd,fmul,fmadd")
82-
(eq_attr "mode" "HF")))
83-
"arcv_rmx100_FPU")
85+
(eq_attr "type" "fmul"))
86+
"arcv_rmx100_FPU,nothing")
8487

85-
(define_insn_reservation "arcv_rmx100_fmul_single" 5
88+
(define_insn_reservation "arcv_rmx100_fmac_insn" 2
8689
(and (eq_attr "tune" "arcv_rmx100")
87-
(and (eq_attr "type" "fadd,fmul,fmadd")
88-
(eq_attr "mode" "SF")))
89-
"arcv_rmx100_FPU")
90+
(eq_attr "type" "fmadd"))
91+
"arcv_rmx100_FPU,nothing")
9092

91-
(define_insn_reservation "arcv_rmx100_fmul_double" 7
93+
(define_insn_reservation "arcv_rmx100_fdiv_insn" 10
9294
(and (eq_attr "tune" "arcv_rmx100")
93-
(and (eq_attr "type" "fadd,fmul,fmadd")
94-
(eq_attr "mode" "DF")))
95+
(eq_attr "type" "fdiv,fsqrt"))
9596
"arcv_rmx100_FPU")
9697

97-
(define_insn_reservation "arcv_rmx100_fdiv" 20
98-
(and (eq_attr "tune" "arcv_rmx100")
99-
(eq_attr "type" "fdiv"))
100-
"arcv_rmx100_FPU*20")
101-
102-
(define_insn_reservation "arcv_rmx100_fsqrt" 25
103-
(and (eq_attr "tune" "arcv_rmx100")
104-
(eq_attr "type" "fsqrt"))
105-
"arcv_rmx100_FPU*25")
10698

10799
(define_bypass 1 "arcv_rmx100_mpy32_insn" "arcv_rmx100_*" "arcv_mpy_1c_bypass_p")
108100
(define_bypass 2 "arcv_rmx100_mpy32_insn" "arcv_rmx100_*" "arcv_mpy_2c_bypass_p")

0 commit comments

Comments
 (0)