Skip to content

Commit e98bead

Browse files
TieTie
authored andcommitted
Add Support for Ziccamoc
1 parent e35cc2d commit e98bead

File tree

6 files changed

+21
-1
lines changed

6 files changed

+21
-1
lines changed

clang/test/Preprocessor/riscv-target-features.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
// CHECK-NOT: __riscv_zicbop {{.*$}}
126126
// CHECK-NOT: __riscv_zicboz {{.*$}}
127127
// CHECK-NOT: __riscv_ziccamoa {{.*$}}
128+
// CHECK-NOT: __riscv_ziccamoc {{.*$}}
128129
// CHECK-NOT: __riscv_ziccif {{.*$}}
129130
// CHECK-NOT: __riscv_zicclsm {{.*$}}
130131
// CHECK-NOT: __riscv_ziccrse {{.*$}}
@@ -1047,6 +1048,15 @@
10471048
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOA-EXT %s
10481049
// CHECK-ZICCAMOA-EXT: __riscv_ziccamoa 1000000{{$}}
10491050

1051+
// RUN: %clang --target=riscv32-unknown-linux-gnu \
1052+
// RUN: -march=rv32iziccamoc -E -dM %s \
1053+
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOC-EXT %s
1054+
// CHECK-ZICCAMOC-EXT: __riscv_ziccamoc 1000000{{$}}
1055+
// RUN: %clang --target=riscv64-unknown-linux-gnu \
1056+
// RUN: -march=rv64iziccamoc -E -dM %s \
1057+
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOC-EXT %s
1058+
// CHECK-ZICCAMOC-EXT: __riscv_ziccamoc 1000000{{$}}
1059+
10501060
// RUN: %clang --target=riscv32-unknown-linux-gnu \
10511061
// RUN: -march=rv32iziccif -E -dM %s \
10521062
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCIF-EXT %s

llvm/docs/RISCVUsage.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ on support follow.
197197
``Zicbop`` Supported
198198
``Zicboz`` Assembly Support
199199
``Ziccamoa`` Supported (`See note <#riscv-profiles-extensions-note>`__)
200+
``Ziccamoc`` Supported (`See note <#riscv-profiles-extensions-note>`__)
200201
``Ziccif`` Supported (`See note <#riscv-profiles-extensions-note>`__)
201202
``Zicclsm`` Supported (`See note <#riscv-profiles-extensions-note>`__)
202203
``Ziccrse`` Supported (`See note <#riscv-profiles-extensions-note>`__)
@@ -298,7 +299,7 @@ Supported
298299

299300
.. _riscv-profiles-extensions-note:
300301

301-
``Za128rs``, ``Za64rs``, ``Zama16b``, ``Zic64b``, ``Ziccamoa``, ``Ziccif``, ``Zicclsm``, ``Ziccrse``, ``Shcounterenvw``, ``Shgatpa``, ``Shtvala``, ``Shvsatpa``, ``Shvstvala``, ``Shvstvecd``, ``Ssccptr``, ``Sscounterenw``, ``Ssstateen``, ``Ssstrict``, ``Sstvala``, ``Sstvecd``, ``Ssu64xl``, ``Svade``, ``Svbare``
302+
``Za128rs``, ``Za64rs``, ``Zama16b``, ``Zic64b``, ``Ziccamoa``, ``Ziccamoc``, ``Ziccif``, ``Zicclsm``, ``Ziccrse``, ``Shcounterenvw``, ``Shgatpa``, ``Shtvala``, ``Shvsatpa``, ``Shvstvala``, ``Shvstvecd``, ``Ssccptr``, ``Sscounterenw``, ``Ssstateen``, ``Ssstrict``, ``Sstvala``, ``Sstvecd``, ``Ssu64xl``, ``Svade``, ``Svbare``
302303
These extensions are defined as part of the `RISC-V Profiles specification <https://github.com/riscv/riscv-profiles/releases/tag/v1.0>`__. They do not introduce any new features themselves, but instead describe existing hardware features.
303304

304305
.. _riscv-zacas-note:

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def HasStdExtZicboz : Predicate<"Subtarget->hasStdExtZicboz()">,
102102
def FeatureStdExtZiccamoa
103103
: RISCVExtension<1, 0, "Main Memory Supports All Atomics in A">;
104104

105+
def FeatureStdExtZiccamoc
106+
: RISCVExtension<1, 0, "Main memory supports atomics in Zacas">;
107+
105108
def FeatureStdExtZiccif
106109
: RISCVExtension<1, 0,
107110
"Main Memory Supports Instruction Fetch with Atomicity Requirement">;

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@
265265
; RUN: llc -mtriple=riscv64 -mattr=+zcmp %s -o - | FileCheck --check-prefixes=CHECK,RV64ZCMP %s
266266
; RUN: llc -mtriple=riscv64 -mattr=+zcmt %s -o - | FileCheck --check-prefixes=CHECK,RV64ZCMT %s
267267
; RUN: llc -mtriple=riscv64 -mattr=+ziccamoa %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCAMOA %s
268+
; RUN: llc -mtriple=riscv64 -mattr=+ziccamoc %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCAMOC %s
268269
; RUN: llc -mtriple=riscv64 -mattr=+ziccif %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCIF %s
269270
; RUN: llc -mtriple=riscv64 -mattr=+zicclsm %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCLSM %s
270271
; RUN: llc -mtriple=riscv64 -mattr=+ziccrse %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCRSE %s
@@ -602,6 +603,7 @@
602603
; RV64ZCMP: .attribute 5, "rv64i2p1_zca1p0_zcmp1p0"
603604
; RV64ZCMT: .attribute 5, "rv64i2p1_zicsr2p0_zca1p0_zcmt1p0"
604605
; RV64ZICCAMOA: .attribute 5, "rv64i2p1_ziccamoa1p0"
606+
; RV64ZICCAMOC: .attribute 5, "rv64i2p1_ziccamoc1p0"
605607
; RV64ZICCIF: .attribute 5, "rv64i2p1_ziccif1p0"
606608
; RV64ZICCLSM: .attribute 5, "rv64i2p1_zicclsm1p0"
607609
; RV64ZICCRSE: .attribute 5, "rv64i2p1_ziccrse1p0"

llvm/test/MC/RISCV/attribute-arch.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
.attribute arch, "rv32iziccamoa"
107107
# CHECK: attribute 5, "rv32i2p1_ziccamoa1p0"
108108

109+
.attribute arch, "rv32iziccamoc"
110+
# CHECK: attribute 5, "rv32i2p1_ziccamoc1p0"
111+
109112
.attribute arch, "rv32iziccif"
110113
# CHECK: attribute 5, "rv32i2p1_ziccif1p0"
111114

llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ R"(All available -march extensions for RISC-V
982982
zicbop 1.0
983983
zicboz 1.0
984984
ziccamoa 1.0
985+
ziccamoc 1.0
985986
ziccif 1.0
986987
zicclsm 1.0
987988
ziccrse 1.0

0 commit comments

Comments
 (0)