Skip to content

Commit 8ce1a11

Browse files
committed
Tentatively use proposed OpUnknown syntax
1 parent a0403e7 commit 8ce1a11

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,8 @@ void SPIRVInstPrinter::printUnknownType(const MCInst *MI, raw_ostream &O) {
327327
// Encode the instruction enumerant and word count into the opcode
328328
const auto OpCode = (0xFF & NumOps) << 16 | (0xFF & Enumerant);
329329

330-
// Print the opcode using the spirv-as arbitrary integer syntax
331-
// https://github.com/KhronosGroup/SPIRV-Tools/blob/main/docs/syntax.md#arbitrary-integers
332-
O << "!0x" << Twine::utohexstr(OpCode) << " ";
330+
// Print the opcode using the spirv-as unknown opcode syntax
331+
O << "OpUnknown(" << Enumerant << ", " << NumOps << ") ";
333332

334333
// The result ID must be printed after the opcode when using this syntax
335334
printOperand(MI, 0, O);

llvm/test/CodeGen/SPIRV/inline/type.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
; CHECK: [[uint32_4:%[0-9]+]] = OpConstant [[uint32_t]] 4
1414
%integral_constant_4 = type target("spirv.IntegralConstant", i32, 4)
1515

16-
; CHECK: !0x4001c [[array_t:%[0-9]+]] [[image_t]] [[uint32_4]]
16+
; CHECK: OpUnknown(28, 4) [[array_t:%[0-9]+]] [[image_t]] [[uint32_4]]
1717
%ArrayTex2D = type target("spirv.Type", %type_2d_image, %integral_constant_4, 28, 0, 0)
1818

1919
; CHECK: [[getTexArray_t:%[0-9]+]] = OpTypeFunction [[array_t]]
2020

21-
; CHECK: !0x40015 [[int_t:%[0-9]+]] 32 1
21+
; CHECK: OpUnknown(21, 4) [[int_t:%[0-9]+]] 32 1
2222
%int_t = type target("spirv.Type", %literal_32, %literal_true, 21, 0, 0)
2323

2424
; CHECK: [[getInt_t:%[0-9]+]] = OpTypeFunction [[int_t]]

0 commit comments

Comments
 (0)