@@ -1267,23 +1267,34 @@ class GCSRtIn<bits<3> op1, bits<3> op2, string mnemonic,
12671267 let Inst{15-8} = 0b01110111;
12681268 let Inst{7-5} = op2;
12691269 let Predicates = [HasGCS];
1270+ let hasSideEffects = 1;
12701271}
12711272
1273+ let mayStore = 1, mayLoad = 1 in
12721274def GCSSS1 : GCSRtIn<0b011, 0b010, "gcsss1">;
1275+ let mayStore = 1 in
12731276def GCSPUSHM : GCSRtIn<0b011, 0b000, "gcspushm">;
12741277
12751278class GCSRtOut<bits<3> op1, bits<3> op2, string mnemonic,
12761279 list<dag> pattern = []>
1277- : RtSystemI<1, (outs GPR64:$Rt), (ins), mnemonic, "\t$Rt", pattern> {
1280+ : RtSystemI<1, (outs GPR64:$Rt), (ins GPR64:$src ), mnemonic, "\t$Rt", pattern> {
12781281 let Inst{20-19} = 0b01;
12791282 let Inst{18-16} = op1;
12801283 let Inst{15-8} = 0b01110111;
12811284 let Inst{7-5} = op2;
12821285 let Predicates = [HasGCS];
1286+ let hasSideEffects = 1;
1287+ // The input register is unchanged when GCS is disabled, so we need it as
1288+ // both an input and output operand.
1289+ let Constraints = "$src = $Rt";
12831290}
12841291
1292+ let mayStore = 1, mayLoad = 1 in
12851293def GCSSS2 : GCSRtOut<0b011, 0b011, "gcsss2">;
1286- def GCSPOPM : GCSRtOut<0b011, 0b001, "gcspopm">;
1294+ // FIXME: mayStore = 1 only needed to match the intrinsic definition
1295+ let mayStore = 1, mayLoad = 1 in
1296+ def GCSPOPM : GCSRtOut<0b011, 0b001, "gcspopm",
1297+ [(set GPR64:$Rt, (int_aarch64_gcspopm GPR64:$src))]>;
12871298def GCSPOPM_NoOp : InstAlias<"gcspopm", (GCSPOPM XZR)>, Requires<[HasGCS]>; // Rt defaults to XZR if absent
12881299
12891300def GCSB_DSYNC_disable : InstAlias<"gcsb\tdsync", (HINT 19), 0>;
@@ -1292,7 +1303,8 @@ def GCSB_DSYNC : InstAlias<"gcsb\tdsync", (HINT 19), 1>, Requires<[HasGC
12921303def : TokenAlias<"DSYNC", "dsync">;
12931304
12941305let Uses = [X16], Defs = [X16], CRm = 0b0101 in {
1295- def CHKFEAT : SystemNoOperands<0b000, "hint\t#40">;
1306+ def CHKFEAT : SystemNoOperands<0b000, "hint\t#40",
1307+ [(set X16, (int_aarch64_chkfeat X16))]>;
12961308}
12971309def : InstAlias<"chkfeat\tx16", (CHKFEAT), 0>;
12981310def : InstAlias<"chkfeat\tx16", (CHKFEAT), 1>, Requires<[HasCHK]>;
@@ -1311,7 +1323,6 @@ class GCSSt<string mnemonic, bits<3> op>
13111323def GCSSTR : GCSSt<"gcsstr", 0b000>;
13121324def GCSSTTR : GCSSt<"gcssttr", 0b001>;
13131325
1314-
13151326// ARMv8.2-A Dot Product
13161327let Predicates = [HasDotProd] in {
13171328defm SDOT : SIMDThreeSameVectorDot<0, 0, "sdot", AArch64sdot>;
0 commit comments