@@ -36,6 +36,8 @@ class MyVarInst<MyMemOperand memory_op> : Instruction {
3636 (operand "$dst", 4),
3737 // Testing operand referencing with a certain bit range.
3838 (slice "$dst", 3, 1),
39+ // Testing slice ho/lo swap.
40+ (slice "$dst", 1, 3),
3941 // Testing custom encoder
4042 (operand "$dst", 2, (encoder "myCustomEncoder"))
4143 );
@@ -57,9 +59,9 @@ def FOO16 : MyVarInst<MemOp16<"src">>;
5759def FOO32 : MyVarInst<MemOp32<"src">>;
5860
5961// The fixed bits part
60- // CHECK: {/*NumBits*/41 ,
62+ // CHECK: {/*NumBits*/44 ,
6163// CHECK-SAME: // FOO16
62- // CHECK: {/*NumBits*/57 ,
64+ // CHECK: {/*NumBits*/60 ,
6365// CHECK-SAME: // FOO32
6466// CHECK: UINT64_C(46848), // FOO16
6567// CHECK: UINT64_C(46848), // FOO32
@@ -78,9 +80,12 @@ def FOO32 : MyVarInst<MemOp32<"src">>;
7880// 2nd dst
7981// CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/36, Scratch, Fixups, STI);
8082// CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 36);
83+ // Slice hi/low swap
84+ // CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/39, Scratch, Fixups, STI);
85+ // CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 39);
8186// 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 );
8489
8590// CHECK-LABEL: case ::FOO32: {
8691// CHECK: Scratch.getBitWidth() < 32
@@ -96,6 +101,9 @@ def FOO32 : MyVarInst<MemOp32<"src">>;
96101// 2nd dst
97102// CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/52, Scratch, Fixups, STI);
98103// CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 52);
104+ // Slice hi/low swap
105+ // CHECK: getMachineOpValue(MI, MI.getOperand(0), /*Pos=*/55, Scratch, Fixups, STI);
106+ // CHECK: Inst.insertBits(Scratch.extractBits(3, 1), 55);
99107// 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