Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e6d779f
arcv: add scheduling information for the Synopsys RMX-100 CPU
artemiy-volkov Jul 9, 2024
159cc33
arcv: introduce and incorporate the --param=arcv-mpy-option flag
artemiy-volkov Jul 5, 2024
b21da0b
arcv: add FPU insn latencies to the RMX-100 scheduling model
artemiy-volkov May 8, 2025
5b1ca41
arcv: Add initial scheduling scheme.
claziss Mar 10, 2023
d5df53d
arcv: fuse load-immediate with store
artemiy-volkov Oct 11, 2023
3690189
arcv: Introduce riscv_is_micro_arch ()
Oct 19, 2023
ec76bcc
arcv: fuse load-immediate with dependent branch
artemiy-volkov Mar 20, 2024
ea09fb4
arcv: implement TARGET_SCHED_FUSION_PRIORITY
artemiy-volkov Jun 4, 2024
2767e2e
arcv: fuse load/store + register post-{inc,dec}rement
artemiy-volkov Jun 12, 2024
55bba89
arcv: fuse load/store with lui
artemiy-volkov Jun 17, 2024
76a4370
arcv: create a 32-bit integer multiply-add instruction pattern
artemiy-volkov Jun 21, 2024
e831193
arcv: fuse integer multiply-add instruction pairs
artemiy-volkov Jun 21, 2024
3cb240e
arcv: implement bit-extract fusion
artemiy-volkov Jul 7, 2024
66e5d1c
arcv: allow inverted instruction order for some fusion types
artemiy-volkov Jul 9, 2024
381c2ee
arcv: add scheduling implementation for RHX-100
artemiy-volkov Oct 1, 2024
ee9edc6
arcv: adjust scheduling priority of memop pairs for RHX-100
artemiy-volkov Dec 3, 2024
5af3f92
arcv: fuse LH+LH and LB+LB instruction pairs
artemiy-volkov Nov 28, 2024
5ea894c
arcv: do not emit 64-bit MAC pairs for 32-bit data
artemiy-volkov May 6, 2025
6091a48
arcv: Disable *<any_extract...>3 when fusion is available
MichielDerhaeg Jul 17, 2025
0912ccf
fixup! arcv: Add initial scheduling scheme.
MichielDerhaeg Oct 15, 2025
1698738
tmp: fusion: add arcv.{cc,h} files.
luismgsilva Nov 12, 2025
53510e5
tmp: arcv: Repalce riscv_is_micro_arch with TARGET_ARCV_RHX100 macro.
luismgsilva Nov 12, 2025
1af0e74
tmp: arcv: Use riscv_fusion_enabled_p (RISCV_FUSE_ARCV)
luismgsilva Nov 12, 2025
d8ade80
tmp: arcv: Clean up arcv_memop_arith_pair_p ()
luismgsilva Nov 12, 2025
375ea0c
tmp: arcv: Clean up arcv_memop_lui_pair_p ()
luismgsilva Nov 12, 2025
a0d8832
tmp: arcv: Clean up arcv_macro_fusion_pair_p ()
luismgsilva Nov 12, 2025
dd9f95b
tmp: arcv: Refactor scheduler state variables into struct.
luismgsilva Nov 14, 2025
66ff6b8
tmp: arcv: Fix 80 character limit lines
luismgsilva Nov 14, 2025
fdf6d84
tmp: arcv: Refactor helper function names
luismgsilva Nov 14, 2025
1edd45f
tmp: arcv: Remove newlines.
luismgsilva Nov 14, 2025
e99ae0d
tmp: arcv: Add hook comments
luismgsilva Nov 14, 2025
4ea42df
fixup! tmp: arcv: Refactor scheduler state variables into struct.
luismgsilva Nov 14, 2025
3bad3ca
tmp: arcv: Refactor helper function names 2
luismgsilva Nov 14, 2025
367327e
tmp: arcv: tmp: arcv: Clean up arcv_sched_fusion_priority ()
luismgsilva Nov 14, 2025
aee9fd0
Fix comment
luismgsilva Nov 17, 2025
4b1cee4
tmp: Remove newline.
luismgsilva Nov 17, 2025
bca8fce
tmp: arcv: Revert riscv_macro_fusion_p to static.
luismgsilva Nov 18, 2025
46a8a4e
tmp: arcv: arcv-rhx100.md: Remove commented code.
luismgsilva Nov 18, 2025
222c326
tmp: arcv-rhx100.md: Update copyright year..
luismgsilva Nov 18, 2025
55cf42f
tmp: arcv.{cc,h}: Update header.
luismgsilva Nov 18, 2025
f77ad5e
tmp: riscv-c.cc: Remove __riscv_rhx
luismgsilva Nov 18, 2025
e242bd8
fixup! tmp: fusion: add arcv.{cc,h} files.
luismgsilva Nov 18, 2025
b4b8c83
fixup! tmp: fusion: add arcv.{cc,h} files.
luismgsilva Nov 18, 2025
f6a18d3
fixup! tmp: fusion: add arcv.{cc,h} files.
luismgsilva Nov 18, 2025
eb4055d
tmp: arcv.{cc,h}/riscv.cc: Remove unused variable.
luismgsilva Nov 18, 2025
eb71e74
fixup! arcv: add scheduling information for the Synopsys RMX-100 CPU
luismgsilva Nov 18, 2025
4f60a81
tmp: arcv: Fix incorrect condition and logic in reorder scheduler.
luismgsilva Nov 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gcc/config.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ riscv*)
extra_objs="riscv-builtins.o riscv-c.o riscv-sr.o riscv-shorten-memrefs.o riscv-selftests.o riscv-string.o"
extra_objs="${extra_objs} riscv-v.o riscv-vsetvl.o riscv-vector-costs.o riscv-avlprop.o riscv-vect-permconst.o"
extra_objs="${extra_objs} riscv-vector-builtins.o riscv-vector-builtins-shapes.o riscv-vector-builtins-bases.o sifive-vector-builtins-bases.o andes-vector-builtins-bases.o"
extra_objs="${extra_objs} thead.o riscv-target-attr.o riscv-zicfilp.o riscv-bclr-lowest-set-bit.o"
extra_objs="${extra_objs} thead.o riscv-target-attr.o riscv-zicfilp.o riscv-bclr-lowest-set-bit.o arcv.o"
d_target_objs="riscv-d.o"
extra_headers="riscv_vector.h riscv_crypto.h riscv_bitmanip.h riscv_th_vector.h sifive_vector.h andes_vector.h"
target_gtfiles="$target_gtfiles \$(srcdir)/config/riscv/riscv-vector-builtins.cc"
Expand Down
106 changes: 106 additions & 0 deletions gcc/config/riscv/arcv-rhx100.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
;; DFA scheduling description of the Synopsys RHX-100 cpu
;; for GNU C compiler
;; Copyright (C) 2025 Free Software Foundation, Inc.

;; This file is part of GCC.

;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.

;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.

(define_automaton "arcv_rhx100")

(define_cpu_unit "arcv_rhx100_ALU_A_fuse0_early" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_ALU_A_fuse1_early" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_ALU_B_fuse0_early" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_ALU_B_fuse1_early" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_MPY32" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_DIV" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_DMP_fuse0" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_DMP_fuse1" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_fdivsqrt" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_issueA_fuse0" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_issueA_fuse1" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_issueB_fuse0" "arcv_rhx100")
(define_cpu_unit "arcv_rhx100_issueB_fuse1" "arcv_rhx100")

;; Instruction reservation for arithmetic instructions (pipe A, pipe B).
(define_insn_reservation "arcv_rhx100_alu_early_arith" 1
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "unknown,move,const,arith,shift,slt,multi,auipc,nop,logical,\
bitmanip,min,max,minu,maxu,clz,ctz,atomic,\
condmove,mvpair,zicond,cpop,clmul"))
"((arcv_rhx100_issueA_fuse0 + arcv_rhx100_ALU_A_fuse0_early) | (arcv_rhx100_issueA_fuse1 + arcv_rhx100_ALU_A_fuse1_early)) | ((arcv_rhx100_issueB_fuse0 + arcv_rhx100_ALU_B_fuse0_early) | (arcv_rhx100_issueB_fuse1 + arcv_rhx100_ALU_B_fuse1_early))")

(define_insn_reservation "arcv_rhx100_imul_fused" 4
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "imul_fused"))
"(arcv_rhx100_issueA_fuse0 + arcv_rhx100_issueA_fuse1 + arcv_rhx100_ALU_A_fuse0_early + arcv_rhx100_ALU_A_fuse1_early + arcv_rhx100_MPY32), nothing*3")

(define_insn_reservation "arcv_rhx100_alu_fused" 1
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "alu_fused"))
"(arcv_rhx100_issueA_fuse0 + arcv_rhx100_issueA_fuse1 + arcv_rhx100_ALU_A_fuse0_early + arcv_rhx100_ALU_A_fuse1_early) | (arcv_rhx100_issueB_fuse0 + arcv_rhx100_issueB_fuse1 + arcv_rhx100_ALU_B_fuse0_early + arcv_rhx100_ALU_B_fuse1_early)")

(define_insn_reservation "arcv_rhx100_jmp_insn" 1
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "branch,jump,call,jalr,ret,trap"))
"arcv_rhx100_issueA_fuse0 | arcv_rhx100_issueA_fuse1")

(define_insn_reservation "arcv_rhx100_div_insn" 12
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "idiv"))
"arcv_rhx100_issueA_fuse0 + arcv_rhx100_DIV, nothing*11")

(define_insn_reservation "arcv_rhx100_mpy32_insn" 4
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "imul"))
"arcv_rhx100_issueA_fuse0 + arcv_rhx100_MPY32, nothing*3")

(define_insn_reservation "arcv_rhx100_load_insn" 3
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "load,fpload"))
"(arcv_rhx100_issueB_fuse0 + arcv_rhx100_DMP_fuse0) | (arcv_rhx100_issueB_fuse1 + arcv_rhx100_DMP_fuse1)")

(define_insn_reservation "arcv_rhx100_store_insn" 1
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "store,fpstore"))
"(arcv_rhx100_issueB_fuse0 + arcv_rhx100_DMP_fuse0) | (arcv_rhx100_issueB_fuse1 + arcv_rhx100_DMP_fuse1)")

;; (soft) floating points
(define_insn_reservation "arcv_rhx100_xfer" 3
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "mfc,mtc,fcvt,fcvt_i2f,fcvt_f2i,fmove,fcmp"))
"(arcv_rhx100_ALU_A_fuse0_early | arcv_rhx100_ALU_B_fuse0_early), nothing*2")

(define_insn_reservation "arcv_rhx100_fmul" 5
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "fadd,fmul,fmadd"))
"(arcv_rhx100_ALU_A_fuse0_early | arcv_rhx100_ALU_B_fuse0_early)")

(define_insn_reservation "arcv_rhx100_fdiv" 20
(and (eq_attr "tune" "arcv_rhx100")
(eq_attr "type" "fdiv,fsqrt"))
"arcv_rhx100_fdivsqrt*20")

;; Bypasses
(define_bypass 1 "arcv_rhx100_alu_early_arith" "arcv_rhx100_store_insn" "riscv_store_data_bypass_p")

(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_store_insn" "riscv_store_data_bypass_p")
(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_alu_early_arith")
(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_mpy*_insn")
(define_bypass 2 "arcv_rhx100_load_insn" "arcv_rhx100_load_insn")
(define_bypass 1 "arcv_rhx100_load_insn" "arcv_rhx100_div_insn")

(define_bypass 3 "arcv_rhx100_mpy32_insn" "arcv_rhx100_mpy*_insn")
(define_bypass 3 "arcv_rhx100_mpy32_insn" "arcv_rhx100_div_insn")
103 changes: 103 additions & 0 deletions gcc/config/riscv/arcv-rmx100.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
;; DFA scheduling description of the Synopsys RMX-100 cpu
;; for GNU C compiler
;; Copyright (C) 2025 Free Software Foundation, Inc.

;; This file is part of GCC.

;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.

;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.

(define_automaton "arcv_rmx100")

(define_cpu_unit "arcv_rmx100_ALU" "arcv_rmx100")
;(define_cpu_unit "arcv_rmx100_CSR" "arcv_rmx100")
(define_cpu_unit "arcv_rmx100_FPU" "arcv_rmx100")
(define_cpu_unit "arcv_rmx100_MPY" "arcv_rmx100")
(define_cpu_unit "arcv_rmx100_DIV" "arcv_rmx100")
(define_cpu_unit "arcv_rmx100_DMP" "arcv_rmx100")

;; Instruction reservation for arithmetic instructions.
(define_insn_reservation "arcv_rmx100_alu_arith" 1
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "unknown, const, arith, shift, slt, multi, auipc, nop,
logical, move, atomic, mvpair, bitmanip, clz, ctz, cpop,
zicond, condmove, clmul, min, max, minu, maxu, rotate"))
"arcv_rmx100_ALU")

(define_insn_reservation "arcv_rmx100_jmp_insn" 1
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "branch, jump, call, jalr, ret, trap"))
"arcv_rmx100_ALU")

; DIV insn: latency may be overridden by a define_bypass
(define_insn_reservation "arcv_rmx100_div_insn" 35
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "idiv"))
"arcv_rmx100_DIV*35")

; MPY insn: latency may be overridden by a define_bypass
(define_insn_reservation "arcv_rmx100_mpy32_insn" 9
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "imul"))
"arcv_rmx100_MPY")

(define_insn_reservation "arcv_rmx100_load_insn" 3
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "load"))
"arcv_rmx100_DMP,nothing*2")

(define_insn_reservation "arcv_rmx100_store_insn" 1
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "store,fpstore"))
"arcv_rmx100_DMP")

;; FPU scheduling. FIXME: This is based on the "fast" unit for now, the "slow"
;; option remains to be implemented later (together with the -mfpu flag).

(define_insn_reservation "arcv_rmx100_fpload_insn" 3
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "fpload"))
"arcv_rmx100_DMP,nothing*2")

(define_insn_reservation "arcv_rmx100_farith_insn" 2
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "fadd,fcmp"))
"arcv_rmx100_FPU,nothing")

(define_insn_reservation "arcv_rmx100_xfer" 1
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "fmove,mtc,mfc,fcvt,fcvt_f2i,fcvt_i2f"))
"arcv_rmx100_FPU")

(define_insn_reservation "arcv_rmx100_fmul_insn" 2
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "fmul"))
"arcv_rmx100_FPU,nothing")

(define_insn_reservation "arcv_rmx100_fmac_insn" 2
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "fmadd"))
"arcv_rmx100_FPU,nothing")

(define_insn_reservation "arcv_rmx100_fdiv_insn" 10
(and (eq_attr "tune" "arcv_rmx100")
(eq_attr "type" "fdiv,fsqrt"))
"arcv_rmx100_FPU")


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

(define_bypass 9 "arcv_rmx100_div_insn" "arcv_rmx100_*" "arcv_mpy_1c_bypass_p")
(define_bypass 9 "arcv_rmx100_div_insn" "arcv_rmx100_*" "arcv_mpy_2c_bypass_p")
Loading