@@ -36,6 +36,8 @@ class MyVarInst<MyMemOperand memory_op> : Instruction {
36
36
(operand "$dst", 4),
37
37
// Testing operand referencing with a certain bit range.
38
38
(slice "$dst", 3, 1),
39
+ // Testing slice hi/lo swap.
40
+ (slice "$dst", 1, 3),
39
41
// Testing custom encoder
40
42
(operand "$dst", 2, (encoder "myCustomEncoder"))
41
43
);
@@ -57,9 +59,9 @@ def FOO16 : MyVarInst<MemOp16<"src">>;
57
59
def FOO32 : MyVarInst<MemOp32<"src">>;
58
60
59
61
// The fixed bits part
60
- // CHECK: {/*NumBits*/41 ,
62
+ // CHECK: {/*NumBits*/44 ,
61
63
// CHECK-SAME: // FOO16
62
- // CHECK: {/*NumBits*/57 ,
64
+ // CHECK: {/*NumBits*/60 ,
63
65
// CHECK-SAME: // FOO32
64
66
// CHECK: UINT64_C(46848), // FOO16
65
67
// CHECK: UINT64_C(46848), // FOO32
@@ -78,9 +80,12 @@ def FOO32 : MyVarInst<MemOp32<"src">>;
78
80
// 2nd dst
79
81
// CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/36, Scratch, Fixups, STI);
80
82
// CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 36);
83
+ // Slice hi/lo swap
84
+ // CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/39, Scratch, Fixups, STI);
85
+ // CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 39);
81
86
// dst w/ custom encoder
82
- // CHECK: myCustomEncoder(MI, /*OpIdx=*/0, /*Pos=*/39 , Scratch, Fixups, STI);
83
- // CHECK: Inst.insertBits(Scratch.extractBits(2, 0), 39 );
87
+ // CHECK: myCustomEncoder(MI, /*OpIdx=*/0, /*Pos=*/42 , Scratch, Fixups, STI);
88
+ // CHECK: Inst.insertBits(Scratch.extractBits(2, 0), 42 );
84
89
85
90
// CHECK-LABEL: case ::FOO32: {
86
91
// CHECK: Scratch.getBitWidth() < 32
@@ -96,6 +101,9 @@ def FOO32 : MyVarInst<MemOp32<"src">>;
96
101
// 2nd dst
97
102
// CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/52, Scratch, Fixups, STI);
98
103
// CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 52);
104
+ // Slice hi/lo swap
105
+ // CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/55, Scratch, Fixups, STI);
106
+ // CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 55);
99
107
// dst w/ custom encoder
100
- // CHECK: myCustomEncoder(MI, /*OpIdx=*/0, /*Pos=*/55 , Scratch, Fixups, STI);
101
- // CHECK: Inst.insertBits(Scratch.extractBits(2, 0), 55 );
108
+ // CHECK: myCustomEncoder(MI, /*OpIdx=*/0, /*Pos=*/58 , Scratch, Fixups, STI);
109
+ // CHECK: Inst.insertBits(Scratch.extractBits(2, 0), 58 );
0 commit comments