@@ -1267,23 +1267,34 @@ class GCSRtIn<bits<3> op1, bits<3> op2, string mnemonic,
1267
1267
let Inst{15-8} = 0b01110111;
1268
1268
let Inst{7-5} = op2;
1269
1269
let Predicates = [HasGCS];
1270
+ let hasSideEffects = 1;
1270
1271
}
1271
1272
1273
+ let mayStore = 1, mayLoad = 1 in
1272
1274
def GCSSS1 : GCSRtIn<0b011, 0b010, "gcsss1">;
1275
+ let mayStore = 1 in
1273
1276
def GCSPUSHM : GCSRtIn<0b011, 0b000, "gcspushm">;
1274
1277
1275
1278
class GCSRtOut<bits<3> op1, bits<3> op2, string mnemonic,
1276
1279
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> {
1278
1281
let Inst{20-19} = 0b01;
1279
1282
let Inst{18-16} = op1;
1280
1283
let Inst{15-8} = 0b01110111;
1281
1284
let Inst{7-5} = op2;
1282
1285
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";
1283
1290
}
1284
1291
1292
+ let mayStore = 1, mayLoad = 1 in
1285
1293
def 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))]>;
1287
1298
def GCSPOPM_NoOp : InstAlias<"gcspopm", (GCSPOPM XZR)>, Requires<[HasGCS]>; // Rt defaults to XZR if absent
1288
1299
1289
1300
def GCSB_DSYNC_disable : InstAlias<"gcsb\tdsync", (HINT 19), 0>;
@@ -1292,7 +1303,8 @@ def GCSB_DSYNC : InstAlias<"gcsb\tdsync", (HINT 19), 1>, Requires<[HasGC
1292
1303
def : TokenAlias<"DSYNC", "dsync">;
1293
1304
1294
1305
let 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))]>;
1296
1308
}
1297
1309
def : InstAlias<"chkfeat\tx16", (CHKFEAT), 0>;
1298
1310
def : InstAlias<"chkfeat\tx16", (CHKFEAT), 1>, Requires<[HasCHK]>;
@@ -1311,7 +1323,6 @@ class GCSSt<string mnemonic, bits<3> op>
1311
1323
def GCSSTR : GCSSt<"gcsstr", 0b000>;
1312
1324
def GCSSTTR : GCSSt<"gcssttr", 0b001>;
1313
1325
1314
-
1315
1326
// ARMv8.2-A Dot Product
1316
1327
let Predicates = [HasDotProd] in {
1317
1328
defm SDOT : SIMDThreeSameVectorDot<0, 0, "sdot", AArch64sdot>;
0 commit comments