Skip to content

Commit bca0f24

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 bca0f24

File tree

3 files changed

+257
-10
lines changed

3 files changed

+257
-10
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

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

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

llvm/lib/Target/RISCV/RISCVInstrInfoXCheri.td

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,25 @@ 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",
394+
(CGetPerm GPR:$rd, GPCR:$rs1)>;
395+
def : InstAlias<"ct.cgettype $rd, $rs1",
396+
(CGetType GPR:$rd, GPCR:$rs1)>;
397+
def : InstAlias<"ct.cgetbase $rd, $rs1",
398+
(CGetBase GPR:$rd, GPCR:$rs1)>;
399+
def : InstAlias<"ct.cgetlen $rd, $rs1",
400+
(CGetLen GPR:$rd, GPCR:$rs1)>;
401+
def : InstAlias<"ct.cgettag $rd, $rs1",
402+
(CGetTag GPR:$rd, GPCR:$rs1)>;
403+
def : InstAlias<"ct.cgethigh $rd, $rs1",
404+
(CGetHigh GPR:$rd, GPCR:$rs1)>;
405+
def : InstAlias<"ct.cgettop $rd, $rs1",
406+
(CGetTop GPR:$rd, GPCR:$rs1)>;
407+
def : InstAlias<"ct.cgetaddr $rd, $rs1",
408+
(PseudoCGetAddr GPR:$rd, GPCR:$rs1)>;
409+
}
410+
392411
//===----------------------------------------------------------------------===//
393412
// Capability-Modification Instructions
394413
//===----------------------------------------------------------------------===//
@@ -434,6 +453,44 @@ def : InstAlias<"csetboundsimm $cd, $cs1, $imm",
434453
(CSetBoundsImm GPCR:$cd, GPCR:$cs1, uimm12:$imm), 0>;
435454
}
436455

456+
let Predicates = [HasCheriot] in {
457+
def : InstAlias<"ct.cseal $rd, $rs1, $rs2",
458+
(CSeal GPCR:$rd, GPCR:$rs1, GPCR:$rs2)>;
459+
def : InstAlias<"ct.cunseal $rd, $rs1, $rs2",
460+
(CUnseal GPCR:$rd, GPCR:$rs1, GPCR:$rs2)>;
461+
def : InstAlias<"ct.candperm $rd, $rs1, $rs2",
462+
(CAndPerm GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
463+
def : InstAlias<"ct.csetaddr $rd, $rs1, $rs2",
464+
(CSetAddr GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
465+
def : InstAlias<"ct.csethigh $rd, $rs1, $rs2",
466+
(CSetHigh GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
467+
def : InstAlias<"ct.cincaddr $rd, $rs1, $rs2",
468+
(CIncOffset GPCR:$rd, GPCR:$rs1, GPR:$rs2), 0>;
469+
def : InstAlias<"ct.cincoffset $rd, $rs1, $rs2",
470+
(CIncOffset GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
471+
def : InstAlias<"ct.cincaddr $rd, $rs1, $rs2",
472+
(CIncOffsetImm GPCR:$rd, GPCR:$rs1, simm12:$rs2), 0>;
473+
def : InstAlias<"ct.cincoffset $rd, $rs1, $rs2",
474+
(CIncOffsetImm GPCR:$rd, GPCR:$rs1, simm12:$rs2)>;
475+
def : InstAlias<"ct.csetbounds $rd, $rs1, $rs2",
476+
(CSetBounds GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
477+
def : InstAlias<"ct.csetboundsexact $rd, $rs1, $rs2",
478+
(CSetBoundsExact GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
479+
def : InstAlias<"ct.csetbounds $rd, $rs1, $rs2",
480+
(CSetBoundsImm GPCR:$rd, GPCR:$rs1, uimm12:$rs2)>;
481+
def : InstAlias<"ct.csetboundsrounddown $rd, $rs1, $rs2",
482+
(CSetBoundsRoundDown GPCR:$rd, GPCR:$rs1, GPR:$rs2)>;
483+
def : InstAlias<"ct.ccleartag $rd, $rs1",
484+
(CClearTag GPCR:$rd, GPCR:$rs1)>;
485+
486+
def : InstAlias<"ct.cincaddrimm $cd, $cs1, $imm",
487+
(CIncOffsetImm GPCR:$cd, GPCR:$cs1, simm12:$imm), 0>;
488+
def : InstAlias<"ct.cincoffsetimm $cd, $cs1, $imm",
489+
(CIncOffsetImm GPCR:$cd, GPCR:$cs1, simm12:$imm), 0>;
490+
def : InstAlias<"ct.csetboundsimm $cd, $cs1, $imm",
491+
(CSetBoundsImm GPCR:$cd, GPCR:$cs1, uimm12:$imm), 0>;
492+
}
493+
437494
//===----------------------------------------------------------------------===//
438495
// Pointer-Arithmetic Instructions
439496
//===----------------------------------------------------------------------===//
@@ -452,6 +509,13 @@ let isMoveReg = 1, isReMaterializable = 1, isAsCheapAsAMove = 1,
452509
def CMove : Cheri_r<0xa, "cmove", GPCR>;
453510
}
454511

512+
let Predicates = [HasCheriot] in {
513+
def : InstAlias<"ct.cmove $rd, $rs1",
514+
(CMove GPCR:$rd, GPCR:$rs1)>;
515+
def : InstAlias<"ct.csub $rd, $rs1, $rs2",
516+
(PseudoCSub GPR:$rd, GPCR:$rs1, GPCR:$rs2)>;
517+
}
518+
455519
//===----------------------------------------------------------------------===//
456520
// Control-Flow Instructions
457521
//===----------------------------------------------------------------------===//
@@ -490,6 +554,15 @@ def CSEQX : Cheri_rr<0x21, "csetequalexact", GPR, GPCR, GPCR>;
490554
def : InstAlias<"cseqx $rd, $cs1, $cs2", (CSEQX GPR:$rd, GPCR:$cs1, GPCR:$cs2)>;
491555
}
492556

557+
let Predicates = [HasCheriot] in {
558+
def : InstAlias<"ct.ctestsubset $rd, $rs1, $rs2",
559+
(CTestSubset GPR:$rd, GPCRC0IsDDC:$rs1, GPCR:$rs2)>;
560+
def : InstAlias<"ct.csetequalexact $rd, $rs1, $rs2",
561+
(CSEQX GPR:$rd, GPCR:$rs1, GPCR:$rs2), 0>;
562+
def : InstAlias<"ct.cseqx $rd, $cs1, $cs2",
563+
(CSEQX GPR:$rd, GPCR:$cs1, GPCR:$cs2), 2>;
564+
}
565+
493566
//===----------------------------------------------------------------------===//
494567
// Special Capabilty Register Access Instructions
495568
//===----------------------------------------------------------------------===//
@@ -506,6 +579,15 @@ def : InstAlias<"cspecialw $scr, $cs",
506579
(CSpecialRW C0, special_capreg:$scr, GPCRNoC0:$cs)>;
507580
}
508581

582+
let Predicates = [HasCheriot] in {
583+
def : InstAlias<"ct.cspecialrw $rd, $imm5, $rs1",
584+
(CSpecialRW GPCR:$rd, special_capreg:$imm5, GPCR:$rs1)>;
585+
def : InstAlias<"ct.cspecialr $cd, $scr",
586+
(CSpecialRW GPCR:$cd, special_capreg:$scr, C0), 2>;
587+
def : InstAlias<"ct.cspecialw $scr, $cs",
588+
(CSpecialRW C0, special_capreg:$scr, GPCRNoC0:$cs), 2>;
589+
}
590+
509591
//===----------------------------------------------------------------------===//
510592
// Fast Register-Clearing Instructions
511593
//===----------------------------------------------------------------------===//
@@ -527,6 +609,16 @@ def : InstAlias<"crrl $rd, $rs1", (CRRL GPR:$rd, GPR:$rs1)>;
527609
def : InstAlias<"cram $rd, $rs1", (CRAM GPR:$rd, GPR:$rs1)>;
528610
}
529611

612+
let Predicates = [HasCheriot] in {
613+
def : InstAlias<"ct.croundrepresentablelength $rd, $rs1",
614+
(CRRL GPR:$rd, GPR:$rs1)>;
615+
def : InstAlias<"ct.crepresentablealignmentmask $rd, $rs1",
616+
(CRAM GPR:$rd, GPR:$rs1)>;
617+
618+
def : InstAlias<"ct.crrl $rd, $rs1", (CRRL GPR:$rd, GPR:$rs1), 2>;
619+
def : InstAlias<"ct.cram $rd, $rs1", (CRAM GPR:$rd, GPR:$rs1), 2>;
620+
}
621+
530622
//===----------------------------------------------------------------------===//
531623
// Tag-Memory Access Instructions
532624
//===----------------------------------------------------------------------===//
@@ -786,6 +878,31 @@ def : InstAlias<"cjalr $rs, $offset", (CJALR C1, GPCR:$rs, simm12:$of
786878
def : InstAlias<"cjalr $rd, $rs, $offset", (CJALR GPCR:$rd, GPCR:$rs, simm12:$offset), 0>;
787879
} // Predicates = [HasCheri, IsCapMode]
788880

881+
let Predicates = [HasCheriot] in {
882+
def : InstAlias<"ct.auipcc $rd, $imm20",
883+
(AUIPCC GPCR:$rd, uimm20_auipc:$imm20)>;
884+
def : InstAlias<"ct.auicgp $rd, $imm20",
885+
(AUICGP GPCR:$rd, uimm20_auigp:$imm20)>;
886+
def : InstAlias<"ct.cjal $rd, $imm20",
887+
(CJAL GPCR:$rd, simm21_lsb0_jal:$imm20)>;
888+
def : InstAlias<"ct.cjalr $rd, ${imm12}(${rs1})",
889+
(CJALR GPCR:$rd, GPCR:$rs1, simm12:$imm12)>;
890+
891+
def : InstAlias<"ct.cjal $offset", (CJAL C1, simm21_lsb0_jal:$offset), 2>;
892+
def : InstAlias<"ct.cj $offset", (CJAL C0, simm21_lsb0_jal:$offset), 0>;
893+
894+
def : InstAlias<"ct.cjr $rs", (CJALR C0, GPCR:$rs, 0), 8>;
895+
def : InstAlias<"ct.cjr ${offset}(${rs})", (CJALR C0, GPCR:$rs, simm12:$offset), 5>;
896+
def : InstAlias<"ct.cjalr $rs", (CJALR C1, GPCR:$rs, 0), 8>;
897+
def : InstAlias<"ct.cjalr ${offset}(${rs})", (CJALR C1, GPCR:$rs, simm12:$offset), 5>;
898+
def : InstAlias<"ct.cjalr $rd, $rs", (CJALR GPCR:$rd, GPCR:$rs, 0), 7>;
899+
def : InstAlias<"ct.cret", (CJALR C0, C1, 0), 9>;
900+
901+
def : InstAlias<"ct.cjr $rs, $offset", (CJALR C0, GPCR:$rs, simm12:$offset), 0>;
902+
def : InstAlias<"ct.cjalr $rs, $offset", (CJALR C1, GPCR:$rs, simm12:$offset), 0>;
903+
def : InstAlias<"ct.cjalr $rd, $rs, $offset", (CJALR GPCR:$rd, GPCR:$rs, simm12:$offset), 0>;
904+
}
905+
789906
// Expands to an instruction alias with and without a c prefix for loads/stores
790907
multiclass CPrefixedInstAlias<string Asm, dag Result> {
791908
def : InstAlias<"c" # Asm, Result, 0>;
@@ -834,6 +951,13 @@ defm : CPrefixedInstAlias<"sc $rs2, (${rs1})",
834951
(CSC_64 GPCR:$rs2, GPCR:$rs1, 0)>;
835952
}
836953

954+
let Predicates = [HasCheriot] in {
955+
def : InstAlias<"ct.clc $rd, ${imm12}(${rs1})",
956+
(CLC_64 GPCR:$rd, GPCR:$rs1, simm12:$imm12)>;
957+
def : InstAlias<"ct.csc $rd, ${imm12}(${rs1})",
958+
(CSC_64 GPCR:$rd, GPCR:$rs1, simm12:$imm12)>;
959+
}
960+
837961
let Predicates = [HasCheri, IsRV64, IsCapMode] in {
838962
let DecoderNamespace = "CapModeOnly_",
839963
hasSideEffects = 0, mayLoad = 1, mayStore = 0 in
@@ -1884,6 +2008,13 @@ def PseudoCCALL : Pseudo<(outs), (ins cap_call_symbol:$func), []> {
18842008
let AsmString = "ccall\t$func";
18852009
}
18862010

2011+
let Predicates = [HasCheriot] in {
2012+
def : InstAlias<"ct.ccall $rd, $func",
2013+
(PseudoCCALLReg GPCR:$rd, cap_call_symbol:$func)>;
2014+
def : InstAlias<"ct.ccall $func",
2015+
(PseudoCCALL cap_call_symbol:$func)>;
2016+
}
2017+
18872018
// The PseudoCompartmentCall of expands to AUIPCC, CLC_64, C_CJALR (10 bytes),
18882019
// but the setup to obtain the callee capability from an import table can
18892020
// require up to 8 additional bytes.
@@ -1932,6 +2063,10 @@ def PseudoCTAIL : Pseudo<(outs), (ins cap_call_symbol:$dst), []> {
19322063
let AsmString = "ctail\t$dst";
19332064
}
19342065

2066+
let Predicates = [HasCheriot] in
2067+
def : InstAlias<"ct.ctail $dst",
2068+
(PseudoCTAIL cap_call_symbol:$dst)>;
2069+
19352070
let Predicates = [HasCheri, IsCapMode, IsPureCapABI],
19362071
isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [C2] in
19372072
def PseudoCTAILIndirect : Pseudo<(outs), (ins GPCRNoC0C1:$rs1),
@@ -1953,6 +2088,10 @@ def PseudoCJump : Pseudo<(outs GPCR:$rd),
19532088
let AsmString = "cjump\t$target, $rd";
19542089
}
19552090

2091+
let Predicates = [HasCheriot] in
2092+
def : InstAlias<"ct.cjump $target, $rd",
2093+
(PseudoCJump GPCR:$rd, pseudo_cap_jump_symbol:$target)>;
2094+
19562095
defm : CheriLdPat<sextloadi8, CLB>, Requires<[HasCheri, IsCapMode]>;
19572096
defm : CheriLdPat<extloadi8, CLB>, Requires<[HasCheri, IsCapMode]>;
19582097
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)