Skip to content

Commit ae64107

Browse files
committed
[CHERIoT] Add preferred instruction aliases for all CHERIoT instructions with a ct. prefix.
This required for conformance with RISC-V vendor extension standards. The prefixed form is preferred for printing when XCheriot is enabled, but the un-prefixed versions are still accepted on input.
1 parent 1153d07 commit ae64107

File tree

3 files changed

+251
-10
lines changed

3 files changed

+251
-10
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,10 @@ def NotPureCapABI
14001400
def FeatureVendorXCheriot
14011401
: RISCVExtension<1, 0, "Implements XCheriot extension">;
14021402

1403+
def HasCheriot
1404+
: Predicate<"Subtarget->hasVendorXCheriot()">,
1405+
AssemblerPredicate<(all_of FeatureVendorXCheriot), "CHERIoT Extension">;
1406+
14031407
def FeatureRelax
14041408
: SubtargetFeature<"relax", "EnableLinkerRelax", "true",
14051409
"Enable Linker relaxation.">;

llvm/lib/Target/RISCV/RISCVInstrInfoXCheri.td

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,17 @@ def PseudoCGetAddr : Pseudo<(outs GPR:$rd), (ins GPCR:$cs1), [],
389389
"cgetaddr", "$rd, $cs1">;
390390
}
391391

392+
let Predicates = [HasCheriot] in {
393+
def : InstAlias<"ct.cgetperm $rd, $rs1", (CGetPerm GPR:$rd, GPCR:$rs1)>;
394+
def : InstAlias<"ct.cgettype $rd, $rs1", (CGetType GPR:$rd, GPCR:$rs1)>;
395+
def : InstAlias<"ct.cgetbase $rd, $rs1", (CGetBase GPR:$rd, GPCR:$rs1)>;
396+
def : InstAlias<"ct.cgetlen $rd, $rs1", (CGetLen GPR:$rd, GPCR:$rs1)>;
397+
def : InstAlias<"ct.cgettag $rd, $rs1", (CGetTag GPR:$rd, GPCR:$rs1)>;
398+
def : InstAlias<"ct.cgethigh $rd, $rs1", (CGetHigh GPR:$rd, GPCR:$rs1)>;
399+
def : InstAlias<"ct.cgettop $rd, $rs1", (CGetTop GPR:$rd, GPCR:$rs1)>;
400+
def : InstAlias<"ct.cgetaddr $rd, $rs1", (PseudoCGetAddr GPR:$rd, GPCR:$rs1)>;
401+
}
402+
392403
//===----------------------------------------------------------------------===//
393404
// Capability-Modification Instructions
394405
//===----------------------------------------------------------------------===//
@@ -434,6 +445,43 @@ def : InstAlias<"csetboundsimm $cd, $cs1, $imm",
434445
(CSetBoundsImm GPCR:$cd, GPCR:$cs1, uimm12:$imm), 0>;
435446
}
436447

448+
let Predicates = [HasCheriot] in {
449+
def : InstAlias<"ct.cseal $rd, $rs1, $rs2", (CSeal GPCR:$rd, GPCR:$rs1,
450+
GPCR:$rs2)>;
451+
def : InstAlias<"ct.cunseal $rd, $rs1, $rs2", (CUnseal GPCR:$rd, GPCR:$rs1,
452+
GPCR:$rs2)>;
453+
def : InstAlias<"ct.candperm $rd, $rs1, $rs2", (CAndPerm GPCR:$rd, GPCR:$rs1,
454+
GPR:$rs2)>;
455+
def : InstAlias<"ct.csetaddr $rd, $rs1, $rs2", (CSetAddr GPCR:$rd, GPCR:$rs1,
456+
GPR:$rs2)>;
457+
def : InstAlias<"ct.csethigh $rd, $rs1, $rs2", (CSetHigh GPCR:$rd, GPCR:$rs1,
458+
GPR:$rs2)>;
459+
def : InstAlias<"ct.cincaddr $rd, $rs1, $rs2",
460+
(CIncOffset GPCR:$rd, GPCR:$rs1, GPR:$rs2), 0>;
461+
def : InstAlias<"ct.cincoffset $rd, $rs1, $rs2", (CIncOffset GPCR:$rd,
462+
GPCR:$rs1, GPR:$rs2)>;
463+
def : InstAlias<"ct.cincaddr $rd, $rs1, $rs2",
464+
(CIncOffsetImm GPCR:$rd, GPCR:$rs1, simm12:$rs2), 0>;
465+
def : InstAlias<"ct.cincoffset $rd, $rs1, $rs2", (CIncOffsetImm GPCR:$rd,
466+
GPCR:$rs1, simm12:$rs2)>;
467+
def : InstAlias<"ct.csetbounds $rd, $rs1, $rs2", (CSetBounds GPCR:$rd,
468+
GPCR:$rs1, GPR:$rs2)>;
469+
def : InstAlias<"ct.csetboundsexact $rd, $rs1, $rs2",
470+
(CSetBoundsExact GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
471+
def : InstAlias<"ct.csetbounds $rd, $rs1, $rs2", (CSetBoundsImm GPCR:$rd,
472+
GPCR:$rs1, uimm12:$rs2)>;
473+
def : InstAlias<"ct.csetboundsrounddown $rd, $rs1, $rs2",
474+
(CSetBoundsRoundDown GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
475+
def : InstAlias<"ct.ccleartag $rd, $rs1", (CClearTag GPCR:$rd, GPCR:$rs1)>;
476+
477+
def : InstAlias<"ct.cincaddrimm $cd, $cs1, $imm",
478+
(CIncOffsetImm GPCR:$cd, GPCR:$cs1, simm12:$imm), 0>;
479+
def : InstAlias<"ct.cincoffsetimm $cd, $cs1, $imm",
480+
(CIncOffsetImm GPCR:$cd, GPCR:$cs1, simm12:$imm), 0>;
481+
def : InstAlias<"ct.csetboundsimm $cd, $cs1, $imm",
482+
(CSetBoundsImm GPCR:$cd, GPCR:$cs1, uimm12:$imm), 0>;
483+
}
484+
437485
//===----------------------------------------------------------------------===//
438486
// Pointer-Arithmetic Instructions
439487
//===----------------------------------------------------------------------===//
@@ -452,6 +500,12 @@ let isMoveReg = 1, isReMaterializable = 1, isAsCheapAsAMove = 1,
452500
def CMove : Cheri_r<0xa, "cmove", GPCR>;
453501
}
454502

503+
let Predicates = [HasCheriot] in {
504+
def : InstAlias<"ct.cmove $rd, $rs1", (CMove GPCR:$rd, GPCR:$rs1)>;
505+
def : InstAlias<"ct.csub $rd, $rs1, $rs2", (PseudoCSub GPR:$rd, GPCR:$rs1,
506+
GPCR:$rs2)>;
507+
}
508+
455509
//===----------------------------------------------------------------------===//
456510
// Control-Flow Instructions
457511
//===----------------------------------------------------------------------===//
@@ -490,6 +544,15 @@ def CSEQX : Cheri_rr<0x21, "csetequalexact", GPR, GPCR, GPCR>;
490544
def : InstAlias<"cseqx $rd, $cs1, $cs2", (CSEQX GPR:$rd, GPCR:$cs1, GPCR:$cs2)>;
491545
}
492546

547+
let Predicates = [HasCheriot] in {
548+
def : InstAlias<"ct.ctestsubset $rd, $rs1, $rs2",
549+
(CTestSubset GPR:$rd, GPCRC0IsDDC:$rs1, GPCR:$rs2)>;
550+
def : InstAlias<"ct.csetequalexact $rd, $rs1, $rs2",
551+
(CSEQX GPR:$rd, GPCR:$rs1, GPCR:$rs2), 0>;
552+
def : InstAlias<"ct.cseqx $rd, $cs1, $cs2",
553+
(CSEQX GPR:$rd, GPCR:$cs1, GPCR:$cs2), 2>;
554+
}
555+
493556
//===----------------------------------------------------------------------===//
494557
// Special Capabilty Register Access Instructions
495558
//===----------------------------------------------------------------------===//
@@ -506,6 +569,15 @@ def : InstAlias<"cspecialw $scr, $cs",
506569
(CSpecialRW C0, special_capreg:$scr, GPCRNoC0:$cs)>;
507570
}
508571

572+
let Predicates = [HasCheriot] in {
573+
def : InstAlias<"ct.cspecialrw $rd, $imm5, $rs1",
574+
(CSpecialRW GPCR:$rd, special_capreg:$imm5, GPCR:$rs1)>;
575+
def : InstAlias<"ct.cspecialr $cd, $scr",
576+
(CSpecialRW GPCR:$cd, special_capreg:$scr, C0), 2>;
577+
def : InstAlias<"ct.cspecialw $scr, $cs",
578+
(CSpecialRW C0, special_capreg:$scr, GPCRNoC0:$cs), 2>;
579+
}
580+
509581
//===----------------------------------------------------------------------===//
510582
// Fast Register-Clearing Instructions
511583
//===----------------------------------------------------------------------===//
@@ -527,6 +599,16 @@ def : InstAlias<"crrl $rd, $rs1", (CRRL GPR:$rd, GPR:$rs1)>;
527599
def : InstAlias<"cram $rd, $rs1", (CRAM GPR:$rd, GPR:$rs1)>;
528600
}
529601

602+
let Predicates = [HasCheriot] in {
603+
def : InstAlias<"ct.croundrepresentablelength $rd, $rs1", (CRRL GPR:$rd,
604+
GPR:$rs1)>;
605+
def : InstAlias<"ct.crepresentablealignmentmask $rd, $rs1", (CRAM GPR:$rd,
606+
GPR:$rs1)>;
607+
608+
def : InstAlias<"ct.crrl $rd, $rs1", (CRRL GPR:$rd, GPR:$rs1), 2>;
609+
def : InstAlias<"ct.cram $rd, $rs1", (CRAM GPR:$rd, GPR:$rs1), 2>;
610+
}
611+
530612
//===----------------------------------------------------------------------===//
531613
// Tag-Memory Access Instructions
532614
//===----------------------------------------------------------------------===//
@@ -786,6 +868,36 @@ def : InstAlias<"cjalr $rs, $offset", (CJALR C1, GPCR:$rs, simm12:$of
786868
def : InstAlias<"cjalr $rd, $rs, $offset", (CJALR GPCR:$rd, GPCR:$rs, simm12:$offset), 0>;
787869
} // Predicates = [HasCheri, IsCapMode]
788870

871+
let Predicates = [HasCheriot] in {
872+
def : InstAlias<"ct.auipcc $rd, $imm20", (AUIPCC GPCR:$rd,
873+
uimm20_auipc:$imm20)>;
874+
def : InstAlias<"ct.auicgp $rd, $imm20", (AUICGP GPCR:$rd,
875+
uimm20_auigp:$imm20)>;
876+
def : InstAlias<"ct.cjal $rd, $imm20", (CJAL GPCR:$rd,
877+
simm21_lsb0_jal:$imm20)>;
878+
def : InstAlias<"ct.cjalr $rd, ${imm12}(${rs1})", (CJALR GPCR:$rd, GPCR:$rs1,
879+
simm12:$imm12)>;
880+
881+
def : InstAlias<"ct.cjal $offset", (CJAL C1, simm21_lsb0_jal:$offset), 2>;
882+
def : InstAlias<"ct.cj $offset", (CJAL C0, simm21_lsb0_jal:$offset), 0>;
883+
884+
def : InstAlias<"ct.cjr $rs", (CJALR C0, GPCR:$rs, 0), 8>;
885+
def : InstAlias<"ct.cjr ${offset}(${rs})",
886+
(CJALR C0, GPCR:$rs, simm12:$offset), 5>;
887+
def : InstAlias<"ct.cjalr $rs", (CJALR C1, GPCR:$rs, 0), 8>;
888+
def : InstAlias<"ct.cjalr ${offset}(${rs})",
889+
(CJALR C1, GPCR:$rs, simm12:$offset), 5>;
890+
def : InstAlias<"ct.cjalr $rd, $rs", (CJALR GPCR:$rd, GPCR:$rs, 0), 7>;
891+
def : InstAlias<"ct.cret", (CJALR C0, C1, 0), 9>;
892+
893+
def : InstAlias<"ct.cjr $rs, $offset", (CJALR C0, GPCR:$rs, simm12:$offset),
894+
0>;
895+
def : InstAlias<"ct.cjalr $rs, $offset", (CJALR C1, GPCR:$rs, simm12:$offset),
896+
0>;
897+
def : InstAlias<"ct.cjalr $rd, $rs, $offset",
898+
(CJALR GPCR:$rd, GPCR:$rs, simm12:$offset), 0>;
899+
}
900+
789901
// Expands to an instruction alias with and without a c prefix for loads/stores
790902
multiclass CPrefixedInstAlias<string Asm, dag Result> {
791903
def : InstAlias<"c" # Asm, Result, 0>;
@@ -834,6 +946,13 @@ defm : CPrefixedInstAlias<"sc $rs2, (${rs1})",
834946
(CSC_64 GPCR:$rs2, GPCR:$rs1, 0)>;
835947
}
836948

949+
let Predicates = [HasCheriot] in {
950+
def : InstAlias<"ct.clc $rd, ${imm12}(${rs1})", (CLC_64 GPCR:$rd, GPCR:$rs1,
951+
simm12:$imm12)>;
952+
def : InstAlias<"ct.csc $rd, ${imm12}(${rs1})", (CSC_64 GPCR:$rd, GPCR:$rs1,
953+
simm12:$imm12)>;
954+
}
955+
837956
let Predicates = [HasCheri, IsRV64, IsCapMode] in {
838957
let DecoderNamespace = "CapModeOnly_",
839958
hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
@@ -1884,6 +2003,12 @@ def PseudoCCALL : Pseudo<(outs), (ins cap_call_symbol:$func), []> {
18842003
let AsmString = "ccall\t$func";
18852004
}
18862005

2006+
let Predicates = [HasCheriot] in {
2007+
def : InstAlias<"ct.ccall $rd, $func", (PseudoCCALLReg GPCR:$rd,
2008+
cap_call_symbol:$func)>;
2009+
def : InstAlias<"ct.ccall $func", (PseudoCCALL cap_call_symbol:$func)>;
2010+
}
2011+
18872012
// The PseudoCompartmentCall of expands to AUIPCC, CLC_64, C_CJALR (10 bytes),
18882013
// but the setup to obtain the callee capability from an import table can
18892014
// require up to 8 additional bytes.
@@ -1932,6 +2057,10 @@ def PseudoCTAIL : Pseudo<(outs), (ins cap_call_symbol:$dst), []> {
19322057
let AsmString = "ctail\t$dst";
19332058
}
19342059

2060+
let Predicates = [HasCheriot] in def : InstAlias<
2061+
"ct.ctail $dst",
2062+
(PseudoCTAIL cap_call_symbol:$dst)>;
2063+
19352064
let Predicates = [HasCheri, IsCapMode, IsPureCapABI],
19362065
isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [C2] in
19372066
def PseudoCTAILIndirect : Pseudo<(outs), (ins GPCRNoC0C1:$rs1),
@@ -1953,6 +2082,11 @@ def PseudoCJump : Pseudo<(outs GPCR:$rd),
19532082
let AsmString = "cjump\t$target, $rd";
19542083
}
19552084

2085+
let Predicates = [HasCheriot] in def : InstAlias<
2086+
"ct.cjump $target, $rd",
2087+
(PseudoCJump GPCR:$rd,
2088+
pseudo_cap_jump_symbol:$target)>;
2089+
19562090
defm : CheriLdPat<sextloadi8, CLB>, Requires<[HasCheri, IsCapMode]>;
19572091
defm : CheriLdPat<extloadi8, CLB>, Requires<[HasCheri, IsCapMode]>;
19582092
defm : CheriLdPat<sextloadi16, CLH>, Requires<[HasCheri, IsCapMode]>;

llvm/test/MC/RISCV/cheri/cheriot.s

Lines changed: 113 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,122 @@
1-
# RUN: llvm-mc %s -triple=riscv32cheriot -mcpu=cheriot -mattr=+xcheri -riscv-no-aliases -show-encoding \
2-
# RUN: | FileCheck %s
1+
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --version 5
2+
// RUN: llvm-mc %s -triple=riscv32cheriot -mcpu=cheriot -mattr=+xcheri,+xcheriot -show-encoding | FileCheck %s -check-prefixes=CHERIOT
3+
// RUN: llvm-mc %s -triple=riscv32 -mattr=+xcheri,+cap-mode -show-encoding | FileCheck %s -check-prefixes=CHERI
34

45
csetboundsrounddown cra, cra, zero
5-
# CHECK: encoding: [0xdb,0x80,0x00,0x14]
6+
// CHERIOT: ct.csetboundsrounddown cra, cra, zero # encoding: [0xdb,0x80,0x00,0x14]
7+
// CHERI: csetboundsrounddown cra, cra, zero # encoding: [0xdb,0x80,0x00,0x14]
68
csetboundsrounddown cra, ca5, zero
7-
# CHECK: encoding: [0xdb,0x80,0x07,0x14]
9+
// CHERIOT: ct.csetboundsrounddown cra, ca5, zero # encoding: [0xdb,0x80,0x07,0x14]
10+
// CHERI: csetboundsrounddown cra, ca5, zero # encoding: [0xdb,0x80,0x07,0x14]
811
csetboundsrounddown cra, cra, a5
9-
# CHECK: encoding: [0xdb,0x80,0xf0,0x14]
12+
// CHERIOT: ct.csetboundsrounddown cra, cra, a5 # encoding: [0xdb,0x80,0xf0,0x14]
13+
// CHERI: csetboundsrounddown cra, cra, a5 # encoding: [0xdb,0x80,0xf0,0x14]
1014
csetboundsrounddown cra, ca5, a5
11-
# CHECK: encoding: [0xdb,0x80,0xf7,0x14]
15+
// CHERIOT: ct.csetboundsrounddown cra, ca5, a5 # encoding: [0xdb,0x80,0xf7,0x14]
16+
// CHERI: csetboundsrounddown cra, ca5, a5 # encoding: [0xdb,0x80,0xf7,0x14]
1217
csetboundsrounddown ca5, cra, zero
13-
# CHECK: [0xdb,0x87,0x00,0x14]
18+
// CHERIOT: ct.csetboundsrounddown ca5, cra, zero # encoding: [0xdb,0x87,0x00,0x14]
19+
// CHERI: csetboundsrounddown ca5, cra, zero # encoding: [0xdb,0x87,0x00,0x14]
1420
csetboundsrounddown ca5, ca5, zero
15-
# CHECK: [0xdb,0x87,0x07,0x14]
21+
// CHERIOT: ct.csetboundsrounddown ca5, ca5, zero # encoding: [0xdb,0x87,0x07,0x14]
22+
// CHERI: csetboundsrounddown ca5, ca5, zero # encoding: [0xdb,0x87,0x07,0x14]
1623
csetboundsrounddown ca5, cra, a5
17-
# CHECK: [0xdb,0x87,0xf0,0x14]
24+
// CHERIOT: ct.csetboundsrounddown ca5, cra, a5 # encoding: [0xdb,0x87,0xf0,0x14]
25+
// CHERI: csetboundsrounddown ca5, cra, a5 # encoding: [0xdb,0x87,0xf0,0x14]
1826
csetboundsrounddown ca5, ca5, a5
19-
# CHECK: [0xdb,0x87,0xf7,0x14]
27+
// CHERIOT: ct.csetboundsrounddown ca5, ca5, a5 # encoding: [0xdb,0x87,0xf7,0x14]
28+
// CHERI: csetboundsrounddown ca5, ca5, a5 # encoding: [0xdb,0x87,0xf7,0x14]
29+
30+
candperm ca1, ca5, x2
31+
// CHERIOT: ct.candperm ca1, ca5, sp # encoding: [0xdb,0x85,0x27,0x1a]
32+
// CHERI: candperm ca1, ca5, sp # encoding: [0xdb,0x85,0x27,0x1a]
33+
ccleartag ca1, ca5
34+
// CHERIOT: ct.ccleartag ca1, ca5 # encoding: [0xdb,0x85,0xb7,0xfe]
35+
// CHERI: ccleartag ca1, ca5 # encoding: [0xdb,0x85,0xb7,0xfe]
36+
cgetbase x2, ca5
37+
// CHERIOT: ct.cgetbase sp, ca5 # encoding: [0x5b,0x81,0x27,0xfe]
38+
// CHERI: cgetbase sp, ca5 # encoding: [0x5b,0x81,0x27,0xfe]
39+
cgethigh x2, ca5
40+
// CHERIOT: ct.cgethigh sp, ca5 # encoding: [0x5b,0x81,0x77,0xff]
41+
// CHERI: cgethigh sp, ca5 # encoding: [0x5b,0x81,0x77,0xff]
42+
cgetlen x2, ca5
43+
// CHERIOT: ct.cgetlen sp, ca5 # encoding: [0x5b,0x81,0x37,0xfe]
44+
// CHERI: cgetlen sp, ca5 # encoding: [0x5b,0x81,0x37,0xfe]
45+
cgetperm x2, ca5
46+
// CHERIOT: ct.cgetperm sp, ca5 # encoding: [0x5b,0x81,0x07,0xfe]
47+
// CHERI: cgetperm sp, ca5 # encoding: [0x5b,0x81,0x07,0xfe]
48+
cgettag x2, ca5
49+
// CHERIOT: ct.cgettag sp, ca5 # encoding: [0x5b,0x81,0x47,0xfe]
50+
// CHERI: cgettag sp, ca5 # encoding: [0x5b,0x81,0x47,0xfe]
51+
cgettype x2, ca5
52+
// CHERIOT: ct.cgettype sp, ca5 # encoding: [0x5b,0x81,0x17,0xfe]
53+
// CHERI: cgettype sp, ca5 # encoding: [0x5b,0x81,0x17,0xfe]
54+
cincoffset ca1, ca2, x2
55+
// CHERIOT: ct.cincoffset ca1, ca2, sp # encoding: [0xdb,0x05,0x26,0x22]
56+
// CHERI: cincoffset ca1, ca2, sp # encoding: [0xdb,0x05,0x26,0x22]
57+
cincoffset ca1, ca2, 3
58+
// CHERIOT: ct.cincoffset ca1, ca2, 3 # encoding: [0xdb,0x15,0x36,0x00]
59+
// CHERI: cincoffset ca1, ca2, 3 # encoding: [0xdb,0x15,0x36,0x00]
60+
cincoffsetimm ca1, ca2, 3
61+
// CHERIOT: ct.cincoffset ca1, ca2, 3 # encoding: [0xdb,0x15,0x36,0x00]
62+
// CHERI: cincoffset ca1, ca2, 3 # encoding: [0xdb,0x15,0x36,0x00]
63+
clc c1, (ca2)
64+
// CHERIOT: ct.clc cra, 0(ca2) # encoding: [0x83,0x30,0x06,0x00]
65+
// CHERI: clc cra, 0(ca2) # encoding: [0x83,0x30,0x06,0x00]
66+
clc c1, 7(ca2)
67+
// CHERIOT: ct.clc cra, 7(ca2) # encoding: [0x83,0x30,0x76,0x00]
68+
// CHERI: clc cra, 7(ca2) # encoding: [0x83,0x30,0x76,0x00]
69+
cmove ca1, ca2
70+
// CHERIOT: ct.cmove ca1, ca2 # encoding: [0xdb,0x05,0xa6,0xfe]
71+
// CHERI: cmove ca1, ca2 # encoding: [0xdb,0x05,0xa6,0xfe]
72+
cram x2, x5
73+
// CHERIOT: cram sp, t0 # encoding: [0x5b,0x81,0x92,0xfe]
74+
// CHERI: cram sp, t0 # encoding: [0x5b,0x81,0x92,0xfe]
75+
crepresentablealignmentmask x2, x5
76+
// CHERIOT: cram sp, t0 # encoding: [0x5b,0x81,0x92,0xfe]
77+
// CHERI: cram sp, t0 # encoding: [0x5b,0x81,0x92,0xfe]
78+
crrl x2, x5
79+
// CHERIOT: crrl sp, t0 # encoding: [0x5b,0x81,0x82,0xfe]
80+
// CHERI: crrl sp, t0 # encoding: [0x5b,0x81,0x82,0xfe]
81+
croundrepresentablelength x2, x5
82+
// CHERIOT: crrl sp, t0 # encoding: [0x5b,0x81,0x82,0xfe]
83+
// CHERI: crrl sp, t0 # encoding: [0x5b,0x81,0x82,0xfe]
84+
csc c1, (ca2)
85+
// CHERIOT: ct.csc cra, 0(ca2) # encoding: [0x23,0x30,0x16,0x00]
86+
// CHERI: csc cra, 0(ca2) # encoding: [0x23,0x30,0x16,0x00]
87+
csc c1, 7(ca2)
88+
// CHERIOT: ct.csc cra, 7(ca2) # encoding: [0xa3,0x33,0x16,0x00]
89+
// CHERI: csc cra, 7(ca2) # encoding: [0xa3,0x33,0x16,0x00]
90+
cseal ca1, ca2, ca3
91+
// CHERIOT: ct.cseal ca1, ca2, ca3 # encoding: [0xdb,0x05,0xd6,0x16]
92+
// CHERI: cseal ca1, ca2, ca3 # encoding: [0xdb,0x05,0xd6,0x16]
93+
csetaddr ca5, ca3, x2
94+
// CHERIOT: ct.csetaddr ca5, ca3, sp # encoding: [0xdb,0x87,0x26,0x20]
95+
// CHERI: csetaddr ca5, ca3, sp # encoding: [0xdb,0x87,0x26,0x20]
96+
csetbounds ca5, ca3, x2
97+
// CHERIOT: ct.csetbounds ca5, ca3, sp # encoding: [0xdb,0x87,0x26,0x10]
98+
// CHERI: csetbounds ca5, ca3, sp # encoding: [0xdb,0x87,0x26,0x10]
99+
csetbounds ca5, ca3, 3
100+
// CHERIOT: ct.csetbounds ca5, ca3, 3 # encoding: [0xdb,0xa7,0x36,0x00]
101+
// CHERI: csetbounds ca5, ca3, 3 # encoding: [0xdb,0xa7,0x36,0x00]
102+
csetboundsimm ca5, ca3, 3
103+
// CHERIOT: ct.csetbounds ca5, ca3, 3 # encoding: [0xdb,0xa7,0x36,0x00]
104+
// CHERI: csetbounds ca5, ca3, 3 # encoding: [0xdb,0xa7,0x36,0x00]
105+
csetboundsexact ca5, ca3, x2
106+
// CHERIOT: ct.csetboundsexact ca5, ca3, sp # encoding: [0xdb,0x87,0x26,0x12]
107+
// CHERI: csetboundsexact ca5, ca3, sp # encoding: [0xdb,0x87,0x26,0x12]
108+
csetequalexact x2, ca5, ca3
109+
// CHERIOT: ct.cseqx sp, ca5, ca3 # encoding: [0x5b,0x81,0xd7,0x42]
110+
// CHERI: cseqx sp, ca5, ca3 # encoding: [0x5b,0x81,0xd7,0x42]
111+
cseqx x2, ca5, ca3
112+
// CHERIOT: ct.cseqx sp, ca5, ca3 # encoding: [0x5b,0x81,0xd7,0x42]
113+
// CHERI: cseqx sp, ca5, ca3 # encoding: [0x5b,0x81,0xd7,0x42]
114+
csethigh ca5, ca3, x7
115+
// CHERIOT: ct.csethigh ca5, ca3, t2 # encoding: [0xdb,0x87,0x76,0x2c]
116+
// CHERI: csethigh ca5, ca3, t2 # encoding: [0xdb,0x87,0x76,0x2c]
117+
ctestsubset x7, ca5, ca3
118+
// CHERIOT: ct.ctestsubset t2, ca5, ca3 # encoding: [0xdb,0x83,0xd7,0x40]
119+
// CHERI: ctestsubset t2, ca5, ca3 # encoding: [0xdb,0x83,0xd7,0x40]
120+
cunseal ca5, ca3, ca1
121+
// CHERIOT: ct.cunseal ca5, ca3, ca1 # encoding: [0xdb,0x87,0xb6,0x18]
122+
// CHERI: cunseal ca5, ca3, ca1 # encoding: [0xdb,0x87,0xb6,0x18]

0 commit comments

Comments
 (0)