Skip to content

Commit c7fabb6

Browse files
TieTie
authored andcommitted
Add Support for Ziccamoc
1 parent d46c733 commit c7fabb6

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
@@ -124,6 +124,7 @@
124124
// CHECK-NOT: __riscv_zicbop {{.*$}}
125125
// CHECK-NOT: __riscv_zicboz {{.*$}}
126126
// CHECK-NOT: __riscv_ziccamoa {{.*$}}
127+
// CHECK-NOT: __riscv_ziccamoc {{.*$}}
127128
// CHECK-NOT: __riscv_ziccif {{.*$}}
128129
// CHECK-NOT: __riscv_zicclsm {{.*$}}
129130
// CHECK-NOT: __riscv_ziccrse {{.*$}}
@@ -1046,6 +1047,15 @@
10461047
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOA-EXT %s
10471048
// CHECK-ZICCAMOA-EXT: __riscv_ziccamoa 1000000{{$}}
10481049

1050+
// RUN: %clang --target=riscv32-unknown-linux-gnu \
1051+
// RUN: -march=rv32iziccamoc -E -dM %s \
1052+
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOC-EXT %s
1053+
// CHECK-ZICCAMOC-EXT: __riscv_ziccamoc 1000000{{$}}
1054+
// RUN: %clang --target=riscv64-unknown-linux-gnu \
1055+
// RUN: -march=rv64iziccamoc -E -dM %s \
1056+
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOC-EXT %s
1057+
// CHECK-ZICCAMOC-EXT: __riscv_ziccamoc 1000000{{$}}
1058+
10491059
// RUN: %clang --target=riscv32-unknown-linux-gnu \
10501060
// RUN: -march=rv32iziccif -E -dM %s \
10511061
// 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
@@ -196,6 +196,7 @@ on support follow.
196196
``Zicbop`` Supported
197197
``Zicboz`` Assembly Support
198198
``Ziccamoa`` Supported (`See note <#riscv-profiles-extensions-note>`__)
199+
``Ziccamoc`` Supported (`See note <#riscv-profiles-extensions-note>`__)
199200
``Ziccif`` Supported (`See note <#riscv-profiles-extensions-note>`__)
200201
``Zicclsm`` Supported (`See note <#riscv-profiles-extensions-note>`__)
201202
``Ziccrse`` Supported (`See note <#riscv-profiles-extensions-note>`__)
@@ -297,7 +298,7 @@ Supported
297298

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

300-
``Za128rs``, ``Za64rs``, ``Zama16b``, ``Zic64b``, ``Ziccamoa``, ``Ziccif``, ``Zicclsm``, ``Ziccrse``, ``Shcounterenvw``, ``Shgatpa``, ``Shtvala``, ``Shvsatpa``, ``Shvstvala``, ``Shvstvecd``, ``Ssccptr``, ``Sscounterenw``, ``Ssstateen``, ``Ssstrict``, ``Sstvala``, ``Sstvecd``, ``Ssu64xl``, ``Svade``, ``Svbare``
301+
``Za128rs``, ``Za64rs``, ``Zama16b``, ``Zic64b``, ``Ziccamoa``, ``Ziccamoc``, ``Ziccif``, ``Zicclsm``, ``Ziccrse``, ``Shcounterenvw``, ``Shgatpa``, ``Shtvala``, ``Shvsatpa``, ``Shvstvala``, ``Shvstvecd``, ``Ssccptr``, ``Sscounterenw``, ``Ssstateen``, ``Ssstrict``, ``Sstvala``, ``Sstvecd``, ``Ssu64xl``, ``Svade``, ``Svbare``
301302
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.
302303

303304
.. _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
@@ -264,6 +264,7 @@
264264
; RUN: llc -mtriple=riscv64 -mattr=+zcmp %s -o - | FileCheck --check-prefixes=CHECK,RV64ZCMP %s
265265
; RUN: llc -mtriple=riscv64 -mattr=+zcmt %s -o - | FileCheck --check-prefixes=CHECK,RV64ZCMT %s
266266
; RUN: llc -mtriple=riscv64 -mattr=+ziccamoa %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCAMOA %s
267+
; RUN: llc -mtriple=riscv64 -mattr=+ziccamoc %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCAMOC %s
267268
; RUN: llc -mtriple=riscv64 -mattr=+ziccif %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCIF %s
268269
; RUN: llc -mtriple=riscv64 -mattr=+zicclsm %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCLSM %s
269270
; RUN: llc -mtriple=riscv64 -mattr=+ziccrse %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICCRSE %s
@@ -599,6 +600,7 @@
599600
; RV64ZCMP: .attribute 5, "rv64i2p1_zca1p0_zcmp1p0"
600601
; RV64ZCMT: .attribute 5, "rv64i2p1_zicsr2p0_zca1p0_zcmt1p0"
601602
; RV64ZICCAMOA: .attribute 5, "rv64i2p1_ziccamoa1p0"
603+
; RV64ZICCAMOC: .attribute 5, "rv64i2p1_ziccamoc1p0"
602604
; RV64ZICCIF: .attribute 5, "rv64i2p1_ziccif1p0"
603605
; RV64ZICCLSM: .attribute 5, "rv64i2p1_zicclsm1p0"
604606
; 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
@@ -972,6 +972,7 @@ R"(All available -march extensions for RISC-V
972972
zicbop 1.0
973973
zicboz 1.0
974974
ziccamoa 1.0
975+
ziccamoc 1.0
975976
ziccif 1.0
976977
zicclsm 1.0
977978
ziccrse 1.0

0 commit comments

Comments
 (0)