| 1 |
(define_automaton "sifive_7") |
| 2 |
|
| 3 |
;; Sifive 7 Series Base Core |
| 4 |
;; This has two pipelines, A (Address) and B (Branch). |
| 5 |
;; Loads, stores, and FP <-> integer moves use the A-pipe. |
| 6 |
;; Branches, MUL/DIV, and FP ops use the B-pipe. |
| 7 |
;; Integer ALU ops can use either pipe. |
| 8 |
|
| 9 |
(define_cpu_unit "sifive_7_A" "sifive_7") |
| 10 |
(define_cpu_unit "sifive_7_B" "sifive_7") |
| 11 |
|
| 12 |
(define_cpu_unit "sifive_7_idiv" "sifive_7") |
| 13 |
(define_cpu_unit "sifive_7_fpu" "sifive_7") |
| 14 |
|
| 15 |
(define_insn_reservation "sifive_7_load" 3 |
| 16 |
(and (eq_attr "tune" "sifive_7") |
| 17 |
(eq_attr "type" "load")) |
| 18 |
"sifive_7_A") |
| 19 |
|
| 20 |
(define_insn_reservation "sifive_7_fpload" 2 |
| 21 |
(and (eq_attr "tune" "sifive_7") |
| 22 |
(eq_attr "type" "fpload")) |
| 23 |
"sifive_7_A") |
| 24 |
|
| 25 |
(define_insn_reservation "sifive_7_store" 1 |
| 26 |
(and (eq_attr "tune" "sifive_7") |
| 27 |
(eq_attr "type" "store")) |
| 28 |
"sifive_7_A") |
| 29 |
|
| 30 |
(define_insn_reservation "sifive_7_fpstore" 1 |
| 31 |
(and (eq_attr "tune" "sifive_7") |
| 32 |
(eq_attr "type" "fpstore")) |
| 33 |
"sifive_7_A") |
| 34 |
|
| 35 |
(define_insn_reservation "sifive_7_branch" 1 |
| 36 |
(and (eq_attr "tune" "sifive_7") |
| 37 |
(eq_attr "type" "branch,ret,trap")) |
| 38 |
"sifive_7_B") |
| 39 |
|
| 40 |
(define_insn_reservation "sifive_7_sfb_alu" 2 |
| 41 |
(and (eq_attr "tune" "sifive_7") |
| 42 |
(eq_attr "type" "sfb_alu")) |
| 43 |
"sifive_7_A+sifive_7_B") |
| 44 |
|
| 45 |
(define_insn_reservation "sifive_7_jump" 1 |
| 46 |
(and (eq_attr "tune" "sifive_7") |
| 47 |
(eq_attr "type" "jump,call,jalr")) |
| 48 |
"sifive_7_B") |
| 49 |
|
| 50 |
(define_insn_reservation "sifive_7_mul" 3 |
| 51 |
(and (eq_attr "tune" "sifive_7") |
| 52 |
(eq_attr "type" "imul")) |
| 53 |
"sifive_7_B") |
| 54 |
|
| 55 |
(define_insn_reservation "sifive_7_div" 16 |
| 56 |
(and (eq_attr "tune" "sifive_7") |
| 57 |
(eq_attr "type" "idiv")) |
| 58 |
"sifive_7_B,sifive_7_idiv*15") |
| 59 |
|
| 60 |
(define_insn_reservation "sifive_7_alu" 2 |
| 61 |
(and (eq_attr "tune" "sifive_7") |
| 62 |
(eq_attr "type" "unknown,arith,shift,slt,multi,logical,move,bitmanip,\ |
| 63 |
rotate,min,max,minu,maxu,clz,ctz,atomic,condmove,mvpair,zicond")) |
| 64 |
"sifive_7_A|sifive_7_B") |
| 65 |
|
| 66 |
(define_insn_reservation "sifive_7_load_immediate" 1 |
| 67 |
(and (eq_attr "tune" "sifive_7") |
| 68 |
(eq_attr "type" "nop,const,auipc")) |
| 69 |
"sifive_7_A|sifive_7_B") |
| 70 |
|
| 71 |
(define_insn_reservation "sifive_7_hfma" 5 |
| 72 |
(and (eq_attr "tune" "sifive_7") |
| 73 |
(and (eq_attr "type" "fadd,fmul,fmadd") |
| 74 |
(eq_attr "mode" "HF"))) |
| 75 |
"sifive_7_B") |
| 76 |
|
| 77 |
(define_insn_reservation "sifive_7_sfma" 5 |
| 78 |
(and (eq_attr "tune" "sifive_7") |
| 79 |
(and (eq_attr "type" "fadd,fmul,fmadd") |
| 80 |
(eq_attr "mode" "SF"))) |
| 81 |
"sifive_7_B") |
| 82 |
|
| 83 |
(define_insn_reservation "sifive_7_dfma" 7 |
| 84 |
(and (eq_attr "tune" "sifive_7") |
| 85 |
(and (eq_attr "type" "fadd,fmul,fmadd") |
| 86 |
(eq_attr "mode" "DF"))) |
| 87 |
"sifive_7_B") |
| 88 |
|
| 89 |
(define_insn_reservation "sifive_7_fp_other" 3 |
| 90 |
(and (eq_attr "tune" "sifive_7") |
| 91 |
(eq_attr "type" "fcvt,fcvt_i2f,fcvt_f2i,fcmp,fmove")) |
| 92 |
"sifive_7_B") |
| 93 |
|
| 94 |
(define_insn_reservation "sifive_7_fdiv_s" 27 |
| 95 |
(and (eq_attr "tune" "sifive_7") |
| 96 |
(eq_attr "type" "fdiv,fsqrt") |
| 97 |
(eq_attr "mode" "SF")) |
| 98 |
"sifive_7_B,sifive_7_fpu*26") |
| 99 |
|
| 100 |
(define_insn_reservation "sifive_7_fdiv_d" 56 |
| 101 |
(and (eq_attr "tune" "sifive_7") |
| 102 |
(eq_attr "type" "fdiv,fsqrt") |
| 103 |
(eq_attr "mode" "DF")) |
| 104 |
"sifive_7_B,sifive_7_fpu*55") |
| 105 |
|
| 106 |
(define_insn_reservation "sifive_7_i2f" 3 |
| 107 |
(and (eq_attr "tune" "sifive_7") |
| 108 |
(eq_attr "type" "mtc")) |
| 109 |
"sifive_7_A") |
| 110 |
|
| 111 |
(define_insn_reservation "sifive_7_f2i" 3 |
| 112 |
(and (eq_attr "tune" "sifive_7") |
| 113 |
(eq_attr "type" "mfc")) |
| 114 |
"sifive_7_A") |
| 115 |
|
| 116 |
;; Popcount and clmul. |
| 117 |
(define_insn_reservation "sifive_7_popcount" 2 |
| 118 |
(and (eq_attr "tune" "sifive_7") |
| 119 |
(eq_attr "type" "cpop,clmul")) |
| 120 |
"sifive_7_A") |
| 121 |
|
| 122 |
(define_bypass 1 "sifive_7_load,sifive_7_alu,sifive_7_mul,sifive_7_f2i,sifive_7_sfb_alu" |
| 123 |
"sifive_7_alu,sifive_7_branch") |
| 124 |
|
| 125 |
(define_bypass 1 "sifive_7_alu,sifive_7_sfb_alu" |
| 126 |
"sifive_7_sfb_alu") |
| 127 |
|
| 128 |
(define_bypass 1 "sifive_7_load,sifive_7_alu,sifive_7_mul,sifive_7_f2i,sifive_7_sfb_alu" |
| 129 |
"sifive_7_store" "riscv_store_data_bypass_p") |
| 130 |
|
| 131 |
(define_bypass 2 "sifive_7_i2f" |
| 132 |
"sifive_7_sfma,sifive_7_dfma,sifive_7_fp_other,sifive_7_fdiv_s,sifive_7_fdiv_d") |
| 133 |
|
| 134 |
(define_bypass 2 "sifive_7_fp_other" |
| 135 |
"sifive_7_sfma,sifive_7_dfma,sifive_7_fp_other,sifive_7_fdiv_s,sifive_7_fdiv_d") |
| 136 |
|
| 137 |
(define_bypass 2 "sifive_7_fp_other" |
| 138 |
"sifive_7_alu,sifive_7_branch") |
| 139 |
|
| 140 |
(define_bypass 2 "sifive_7_fp_other" |
| 141 |
"sifive_7_store" "riscv_store_data_bypass_p") |