@@ -32,9 +32,23 @@ pub struct InstructionTable {
3232
3333impl InstructionTable {
3434 pub fn new ( ) -> Self {
35- let table = rspirv:: grammar:: CoreInstructionTable :: iter ( )
35+ let mut table: FxHashMap < _ , _ > = rspirv:: grammar:: CoreInstructionTable :: iter ( )
3636 . map ( |inst| ( inst. opname , inst) )
3737 . collect ( ) ;
38+
39+ // Add aliases for EXT/KHR instructions whose suffixes were removed
40+ for inst in rspirv:: grammar:: CoreInstructionTable :: iter ( ) {
41+ match inst. opname {
42+ "DemoteToHelperInvocation" => {
43+ table. insert ( "DemoteToHelperInvocationEXT" , inst) ;
44+ }
45+ "IsHelperInvocation" => {
46+ table. insert ( "IsHelperInvocationEXT" , inst) ;
47+ }
48+ _ => { }
49+ }
50+ }
51+
3852 Self { table }
3953 }
4054}
@@ -1529,6 +1543,32 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
15291543 Ok ( x) => inst. operands . push ( dr:: Operand :: StoreCacheControl ( x) ) ,
15301544 Err ( ( ) ) => self . err ( format ! ( "unknown StoreCacheControl {word}" ) ) ,
15311545 } ,
1546+ // New operand kinds added in newer SPIR-V versions - not yet supported in inline asm
1547+ ( OperandKind :: RawAccessChainOperands , Some ( word) ) => {
1548+ self . err ( format ! ( "RawAccessChainOperands not yet supported: {word}" ) ) ;
1549+ }
1550+ ( OperandKind :: CooperativeMatrixReduce , Some ( word) ) => {
1551+ self . err ( format ! ( "CooperativeMatrixReduce not yet supported: {word}" ) ) ;
1552+ }
1553+ ( OperandKind :: TensorClampMode , Some ( word) ) => {
1554+ self . err ( format ! ( "TensorClampMode not yet supported: {word}" ) ) ;
1555+ }
1556+ ( OperandKind :: TensorAddressingOperands , Some ( word) ) => {
1557+ self . err ( format ! ( "TensorAddressingOperands not yet supported: {word}" ) ) ;
1558+ }
1559+ ( OperandKind :: FPEncoding , Some ( word) ) => {
1560+ self . err ( format ! ( "FPEncoding not yet supported: {word}" ) ) ;
1561+ }
1562+ ( OperandKind :: NamedMaximumNumberOfRegisters , Some ( word) ) => {
1563+ self . err ( format ! ( "NamedMaximumNumberOfRegisters not yet supported: {word}" ) ) ;
1564+ }
1565+ ( OperandKind :: MatrixMultiplyAccumulateOperands , Some ( word) ) => {
1566+ self . err ( format ! ( "MatrixMultiplyAccumulateOperands not yet supported: {word}" ) ) ;
1567+ }
1568+ // Catch-all for any other new operand kinds
1569+ ( kind, Some ( word) ) => {
1570+ self . err ( format ! ( "unsupported operand kind {kind:?}: {word}" ) ) ;
1571+ }
15321572 ( kind, None ) => match token {
15331573 Token :: Word ( _) => bug ! ( ) ,
15341574 Token :: String ( _) => {
@@ -1565,14 +1605,14 @@ pub const IMAGE_OPERANDS: &[(&str, ImageOperands)] = &[
15651605 ( "MakeTexelAvailable" , ImageOperands :: MAKE_TEXEL_AVAILABLE ) ,
15661606 (
15671607 "MakeTexelAvailableKHR" ,
1568- ImageOperands :: MAKE_TEXEL_AVAILABLE_KHR ,
1608+ ImageOperands :: MAKE_TEXEL_AVAILABLE ,
15691609 ) ,
15701610 ( "MakeTexelVisible" , ImageOperands :: MAKE_TEXEL_VISIBLE ) ,
1571- ( "MakeTexelVisibleKHR" , ImageOperands :: MAKE_TEXEL_VISIBLE_KHR ) ,
1611+ ( "MakeTexelVisibleKHR" , ImageOperands :: MAKE_TEXEL_VISIBLE ) ,
15721612 ( "NonPrivateTexel" , ImageOperands :: NON_PRIVATE_TEXEL ) ,
1573- ( "NonPrivateTexelKHR" , ImageOperands :: NON_PRIVATE_TEXEL_KHR ) ,
1613+ ( "NonPrivateTexelKHR" , ImageOperands :: NON_PRIVATE_TEXEL ) ,
15741614 ( "VolatileTexel" , ImageOperands :: VOLATILE_TEXEL ) ,
1575- ( "VolatileTexelKHR" , ImageOperands :: VOLATILE_TEXEL_KHR ) ,
1615+ ( "VolatileTexelKHR" , ImageOperands :: VOLATILE_TEXEL ) ,
15761616 ( "SignExtend" , ImageOperands :: SIGN_EXTEND ) ,
15771617 ( "ZeroExtend" , ImageOperands :: ZERO_EXTEND ) ,
15781618] ;
@@ -1610,7 +1650,7 @@ pub const FUNCTION_CONTROL: &[(&str, FunctionControl)] = &[
16101650] ;
16111651pub const MEMORY_SEMANTICS : & [ ( & str , MemorySemantics ) ] = & [
16121652 ( "Relaxed" , MemorySemantics :: RELAXED ) ,
1613- ( "None" , MemorySemantics :: NONE ) ,
1653+ ( "None" , MemorySemantics :: RELAXED ) ,
16141654 ( "Acquire" , MemorySemantics :: ACQUIRE ) ,
16151655 ( "Release" , MemorySemantics :: RELEASE ) ,
16161656 ( "AcquireRelease" , MemorySemantics :: ACQUIRE_RELEASE ) ,
@@ -1631,11 +1671,11 @@ pub const MEMORY_SEMANTICS: &[(&str, MemorySemantics)] = &[
16311671 ) ,
16321672 ( "ImageMemory" , MemorySemantics :: IMAGE_MEMORY ) ,
16331673 ( "OutputMemory" , MemorySemantics :: OUTPUT_MEMORY ) ,
1634- ( "OutputMemoryKHR" , MemorySemantics :: OUTPUT_MEMORY_KHR ) ,
1674+ ( "OutputMemoryKHR" , MemorySemantics :: OUTPUT_MEMORY ) ,
16351675 ( "MakeAvailable" , MemorySemantics :: MAKE_AVAILABLE ) ,
1636- ( "MakeAvailableKHR" , MemorySemantics :: MAKE_AVAILABLE_KHR ) ,
1676+ ( "MakeAvailableKHR" , MemorySemantics :: MAKE_AVAILABLE ) ,
16371677 ( "MakeVisible" , MemorySemantics :: MAKE_VISIBLE ) ,
1638- ( "MakeVisibleKHR" , MemorySemantics :: MAKE_VISIBLE_KHR ) ,
1678+ ( "MakeVisibleKHR" , MemorySemantics :: MAKE_VISIBLE ) ,
16391679 ( "Volatile" , MemorySemantics :: VOLATILE ) ,
16401680] ;
16411681pub const MEMORY_ACCESS : & [ ( & str , MemoryAccess ) ] = & [
@@ -1646,17 +1686,17 @@ pub const MEMORY_ACCESS: &[(&str, MemoryAccess)] = &[
16461686 ( "MakePointerAvailable" , MemoryAccess :: MAKE_POINTER_AVAILABLE ) ,
16471687 (
16481688 "MakePointerAvailableKHR" ,
1649- MemoryAccess :: MAKE_POINTER_AVAILABLE_KHR ,
1689+ MemoryAccess :: MAKE_POINTER_AVAILABLE ,
16501690 ) ,
16511691 ( "MakePointerVisible" , MemoryAccess :: MAKE_POINTER_VISIBLE ) ,
16521692 (
16531693 "MakePointerVisibleKHR" ,
1654- MemoryAccess :: MAKE_POINTER_VISIBLE_KHR ,
1694+ MemoryAccess :: MAKE_POINTER_VISIBLE ,
16551695 ) ,
16561696 ( "NonPrivatePointer" , MemoryAccess :: NON_PRIVATE_POINTER ) ,
16571697 (
16581698 "NonPrivatePointerKHR" ,
1659- MemoryAccess :: NON_PRIVATE_POINTER_KHR ,
1699+ MemoryAccess :: NON_PRIVATE_POINTER ,
16601700 ) ,
16611701] ;
16621702pub const KERNEL_PROFILING_INFO : & [ ( & str , KernelProfilingInfo ) ] = & [
0 commit comments