Bladeren bron

Add GL_ARM_tensors

Add support for the GL_ARM_tensors extension.

Co-authored-by: Neil Hickey <[email protected]>
Co-authored-by: Pedro Olsen Ferreira <[email protected]>
Signed-off-by: Sven van Haastregt <[email protected]>
Sven van Haastregt 2 maanden geleden
bovenliggende
commit
e9d166cd3b
51 gewijzigde bestanden met toevoegingen van 2486 en 836 verwijderingen
  1. 2 1
      SPIRV/GLSL.ext.ARM.h
  2. 90 0
      SPIRV/GlslangToSpv.cpp
  3. 20 0
      SPIRV/SpvBuilder.cpp
  4. 2 0
      SPIRV/SpvBuilder.h
  5. 28 0
      SPIRV/doc.cpp
  6. 32 2
      SPIRV/spirv.hpp11
  7. 9 0
      Test/baseResults/spv.tensorARM.access_qualifiers.comp.out
  8. 325 0
      Test/baseResults/spv.tensorARM.all_accesses.comp.out
  9. 47 0
      Test/baseResults/spv.tensorARM.array.comp.out
  10. 104 0
      Test/baseResults/spv.tensorARM.declare.comp.out
  11. 91 0
      Test/baseResults/spv.tensorARM.frag.out
  12. 18 0
      Test/baseResults/spv.tensorARM.invalid_access.comp.out
  13. 29 0
      Test/baseResults/spv.tensorARM.invalid_declare.comp.out
  14. 6 0
      Test/baseResults/spv.tensorARM.invalid_operands.comp.out
  15. 11 0
      Test/baseResults/spv.tensorARM.invalid_params.comp.out
  16. 7 0
      Test/baseResults/spv.tensorARM.invalid_size.comp.out
  17. 8 0
      Test/baseResults/spv.tensorARM.invalid_tensor_type.comp.out
  18. 85 0
      Test/baseResults/spv.tensorARM.params.comp.out
  19. 71 0
      Test/baseResults/spv.tensorARM.read.comp.out
  20. 71 0
      Test/baseResults/spv.tensorARM.size.comp.out
  21. 1 0
      Test/baseResults/validation_fails.txt
  22. 35 0
      Test/spv.tensorARM.access_qualifiers.comp
  23. 90 0
      Test/spv.tensorARM.all_accesses.comp
  24. 9 0
      Test/spv.tensorARM.array.comp
  25. 28 0
      Test/spv.tensorARM.declare.comp
  26. 18 0
      Test/spv.tensorARM.frag
  27. 33 0
      Test/spv.tensorARM.invalid_access.comp
  28. 18 0
      Test/spv.tensorARM.invalid_declare.comp
  29. 12 0
      Test/spv.tensorARM.invalid_operands.comp
  30. 30 0
      Test/spv.tensorARM.invalid_params.comp
  31. 12 0
      Test/spv.tensorARM.invalid_size.comp
  32. 8 0
      Test/spv.tensorARM.invalid_tensor_type.comp
  33. 26 0
      Test/spv.tensorARM.params.comp
  34. 17 0
      Test/spv.tensorARM.read.comp
  35. 17 0
      Test/spv.tensorARM.size.comp
  36. 1 0
      glslang/Include/BaseTypes.h
  37. 41 10
      glslang/Include/Types.h
  38. 5 0
      glslang/Include/intermediate.h
  39. 39 0
      glslang/MachineIndependent/Initialize.cpp
  40. 122 4
      glslang/MachineIndependent/ParseHelper.cpp
  41. 1 1
      glslang/MachineIndependent/ParseHelper.h
  42. 8 0
      glslang/MachineIndependent/Scan.cpp
  43. 3 1
      glslang/MachineIndependent/SymbolTable.cpp
  44. 9 0
      glslang/MachineIndependent/Versions.cpp
  45. 1 0
      glslang/MachineIndependent/Versions.h
  46. 15 8
      glslang/MachineIndependent/glslang.y
  47. 512 510
      glslang/MachineIndependent/glslang_tab.cpp
  48. 300 299
      glslang/MachineIndependent/glslang_tab.cpp.h
  49. 4 0
      glslang/MachineIndependent/intermOut.cpp
  50. 1 0
      glslang/MachineIndependent/parseVersions.h
  51. 14 0
      gtests/Spv.FromFile.cpp

+ 2 - 1
SPIRV/GLSL.ext.ARM.h

@@ -28,9 +28,10 @@
 #define GLSLextARM_H
 #define GLSLextARM_H
 
 
 static const int GLSLextARMVersion = 100;
 static const int GLSLextARMVersion = 100;
-static const int GLSLextARMRevision = 1;
+static const int GLSLextARMRevision = 2;
 
 
 static const char* const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins";
 static const char* const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins";
 static const char* const E_SPV_ARM_cooperative_matrix_layouts = "SPV_ARM_cooperative_matrix_layouts";
 static const char* const E_SPV_ARM_cooperative_matrix_layouts = "SPV_ARM_cooperative_matrix_layouts";
+static const char* const E_SPV_ARM_tensors = "SPV_ARM_tensors";
 
 
 #endif  // #ifndef GLSLextARM_H
 #endif  // #ifndef GLSLextARM_H

+ 90 - 0
SPIRV/GlslangToSpv.cpp

@@ -1505,6 +1505,10 @@ bool IsDescriptorResource(const glslang::TType& type)
         type.getBasicType() == glslang::EbtAccStruct)
         type.getBasicType() == glslang::EbtAccStruct)
         return type.getQualifier().isUniformOrBuffer();
         return type.getQualifier().isUniformOrBuffer();
 
 
+    // Tensors are tied to a descriptor.
+    if (type.isTensorARM())
+        return true;
+
     // None of the above.
     // None of the above.
     return false;
     return false;
 }
 }
@@ -3580,6 +3584,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
         builder.addCapability(spv::Capability::TextureBlockMatchQCOM);
         builder.addCapability(spv::Capability::TextureBlockMatchQCOM);
         builder.addExtension(spv::E_SPV_QCOM_image_processing);
         builder.addExtension(spv::E_SPV_QCOM_image_processing);
         break;
         break;
+    case glslang::EOpTensorWriteARM:
+        noReturnValue = true;
+        break;
 
 
     case glslang::EOpImageBlockMatchWindowSSDQCOM:
     case glslang::EOpImageBlockMatchWindowSSDQCOM:
     case glslang::EOpImageBlockMatchWindowSADQCOM:
     case glslang::EOpImageBlockMatchWindowSADQCOM:
@@ -3830,6 +3837,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
             if (arg == 0 || arg == 2)
             if (arg == 0 || arg == 2)
                 lvalue = true;
                 lvalue = true;
             break;
             break;
+        case glslang::EOpTensorReadARM:
+            if (arg == 2)
+                lvalue = true;
+            break;
         default:
         default:
             break;
             break;
         }
         }
@@ -4331,6 +4342,66 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
         idImmOps.push_back(spv::IdImmediate(true, operands[0])); // A
         idImmOps.push_back(spv::IdImmediate(true, operands[0])); // A
         builder.createNoResultOp(spv::Op::OpCooperativeVectorReduceSumAccumulateNV, idImmOps);
         builder.createNoResultOp(spv::Op::OpCooperativeVectorReduceSumAccumulateNV, idImmOps);
         result = 0;
         result = 0;
+    } else if (node->getOp() == glslang::EOpTensorReadARM ||
+               node->getOp() == glslang::EOpTensorWriteARM) {
+        const bool isWrite = node->getOp() == glslang::EOpTensorWriteARM;
+        const unsigned int tensorMinOperandCount = 3;
+        assert(operands.size() >= tensorMinOperandCount);
+        std::vector<spv::IdImmediate> idImmOps;
+
+        idImmOps.push_back(spv::IdImmediate(true, operands[0])); // tensor
+        idImmOps.push_back(spv::IdImmediate(true, operands[1])); // coords
+        if (isWrite) {
+            idImmOps.push_back(spv::IdImmediate(true, operands[2])); // value
+        }
+
+        // Analyze the tensor operands
+        spv::IdImmediate tensorOperands = { false, uint32_t(spv::TensorOperandsMask::MaskNone) };
+        bool pushExtraArg = false;
+        if (operands.size() > tensorMinOperandCount) {
+            auto enumVal = builder.getConstantScalar(operands[tensorMinOperandCount]);
+
+            if (enumVal & uint32_t(spv::TensorOperandsMask::NontemporalARM)) {
+                tensorOperands.word |= uint32_t(spv::TensorOperandsMask::NontemporalARM);
+            }
+            if (enumVal & uint32_t(spv::TensorOperandsMask::OutOfBoundsValueARM)) {
+                tensorOperands.word |= uint32_t(spv::TensorOperandsMask::OutOfBoundsValueARM);
+                assert(operands.size() >= tensorMinOperandCount + 2 &&
+                    "TensorOperandsOutOfBoundsValueMask requires an additional value");
+                pushExtraArg = true;
+            }
+        }
+
+        // Append optional tensor operands if the mask was non-zero.
+        if (tensorOperands.word) {
+            idImmOps.push_back(tensorOperands);
+            if (pushExtraArg)
+                idImmOps.push_back(spv::IdImmediate(true, operands[tensorMinOperandCount + 1]));
+        }
+
+        if (isWrite) {
+            builder.createNoResultOp(spv::Op::OpTensorWriteARM, idImmOps);
+            result = 0;
+        } else {
+            // Use the result argument type as the OpTensorReadARM result type.
+            const glslang::TType &resArgType = glslangOperands[2]->getAsTyped()->getType();
+            spv::Id retType = convertGlslangToSpvType(resArgType);
+            result = builder.createOp(spv::Op::OpTensorReadARM, retType, idImmOps);
+            // Store the result to the result argument.
+            builder.createStore(result, operands[2]);
+        }
+    } else if (node->getOp() == glslang::EOpTensorSizeARM) {
+        // Expected operands are (tensor, dimension)
+        assert(operands.size() == 2);
+
+        spv::Id tensorOp = operands[0];
+        spv::Id dimOp = operands[1];
+        assert(builder.isTensorTypeARM(builder.getTypeId(tensorOp)) && "operand #0 must be a tensor");
+
+        std::vector<spv::IdImmediate> idImmOps;
+        idImmOps.push_back(spv::IdImmediate(true, tensorOp));
+        idImmOps.push_back(spv::IdImmediate(true, dimOp));
+        result = builder.createOp(spv::Op::OpTensorQuerySizeARM, resultType(), idImmOps);
     } else if (atomic) {
     } else if (atomic) {
         // Handle all atomics
         // Handle all atomics
         glslang::TBasicType typeProxy = (node->getOp() == glslang::EOpAtomicStore)
         glslang::TBasicType typeProxy = (node->getOp() == glslang::EOpAtomicStore)
@@ -5304,6 +5375,25 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
 
 
         spvType = builder.makeCooperativeMatrixTypeKHR(spvType, scope, rows, cols, use);
         spvType = builder.makeCooperativeMatrixTypeKHR(spvType, scope, rows, cols, use);
     }
     }
+    else if (type.isTensorARM()) {
+        builder.addCapability(spv::Capability::TensorsARM);
+        builder.addExtension(spv::E_SPV_ARM_tensors);
+        if (type.getBasicType() == glslang::EbtInt8 || type.getBasicType() == glslang::EbtUint8) {
+            builder.addCapability(spv::Capability::Int8);
+        } else if (type.getBasicType() == glslang::EbtInt16 ||
+                   type.getBasicType() == glslang::EbtUint16) {
+            builder.addCapability(spv::Capability::Int16);
+        } else if (type.getBasicType() == glslang::EbtInt64 ||
+                   type.getBasicType() == glslang::EbtUint64) {
+            builder.addCapability(spv::Capability::Int64);
+        } else if (type.getBasicType() == glslang::EbtFloat16) {
+            builder.addCapability(spv::Capability::Float16);
+        }
+
+        spv::Id rank = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0);
+
+        spvType = builder.makeTensorTypeARM(spvType, rank);
+    }
 
 
     if (type.isCoopVecNV()) {
     if (type.isCoopVecNV()) {
         builder.addCapability(spv::Capability::CooperativeVectorNV);
         builder.addCapability(spv::Capability::CooperativeVectorNV);

+ 20 - 0
SPIRV/SpvBuilder.cpp

@@ -652,6 +652,26 @@ Id Builder::makeCooperativeVectorTypeNV(Id componentType, Id components)
     return type->getResultId();
     return type->getResultId();
 }
 }
 
 
+Id Builder::makeTensorTypeARM(Id elementType, Id rank)
+{
+    // See if an OpTypeTensorARM with same element type and rank already exists.
+    for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeTensorARM)].size(); ++t) {
+        const Instruction *type = groupedTypes[enumCast(Op::OpTypeTensorARM)][t];
+        if (type->getIdOperand(0) == elementType && type->getIdOperand(1) == rank)
+            return type->getResultId();
+    }
+
+    // Not found, make it.
+    std::unique_ptr<Instruction> type(new Instruction(getUniqueId(), NoType, Op::OpTypeTensorARM));
+    type->addIdOperand(elementType);
+    type->addIdOperand(rank);
+    groupedTypes[enumCast(Op::OpTypeTensorARM)].push_back(type.get());
+    module.mapInstruction(type.get());
+    Id resultID = type->getResultId();
+    constantsTypesGlobals.push_back(std::move(type));
+    return resultID;
+}
+
 Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands)
 Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands)
 {
 {
     // try to find it
     // try to find it

+ 2 - 0
SPIRV/SpvBuilder.h

@@ -225,6 +225,7 @@ public:
     Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols);
     Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols);
     Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType);
     Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType);
     Id makeCooperativeVectorTypeNV(Id componentType, Id components);
     Id makeCooperativeVectorTypeNV(Id componentType, Id components);
+    Id makeTensorTypeARM(Id elementType, Id rank);
     Id makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
     Id makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
 
 
     // SPIR-V NonSemantic Shader DebugInfo Instructions
     // SPIR-V NonSemantic Shader DebugInfo Instructions
@@ -322,6 +323,7 @@ public:
     }
     }
     bool isTensorViewType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeTensorViewNV; }
     bool isTensorViewType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeTensorViewNV; }
     bool isCooperativeVectorType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeCooperativeVectorNV; }
     bool isCooperativeVectorType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeCooperativeVectorNV; }
+    bool isTensorTypeARM(Id typeId)    const { return getTypeClass(typeId) == Op::OpTypeTensorARM; }
     bool isAggregateType(Id typeId)    const
     bool isAggregateType(Id typeId)    const
         { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
         { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
     bool isImageType(Id typeId)        const { return getTypeClass(typeId) == Op::OpTypeImage; }
     bool isImageType(Id typeId)        const { return getTypeClass(typeId) == Op::OpTypeImage; }

+ 28 - 0
SPIRV/doc.cpp

@@ -1080,6 +1080,7 @@ const char* CapabilityString(int info)
     case (int)Capability::TileImageStencilReadAccessEXT:         return "TileImageStencilReadAccessEXT";
     case (int)Capability::TileImageStencilReadAccessEXT:         return "TileImageStencilReadAccessEXT";
 
 
     case (int)Capability::CooperativeMatrixLayoutsARM:             return "CooperativeMatrixLayoutsARM";
     case (int)Capability::CooperativeMatrixLayoutsARM:             return "CooperativeMatrixLayoutsARM";
+    case (int)Capability::TensorsARM:                              return "TensorsARM";
 
 
     case (int)Capability::FragmentShadingRateKHR:                  return "FragmentShadingRateKHR";
     case (int)Capability::FragmentShadingRateKHR:                  return "FragmentShadingRateKHR";
 
 
@@ -1626,6 +1627,11 @@ const char* OpcodeString(int op)
     case (int)Op::OpTensorViewSetStrideNV:           return "OpTensorViewSetStrideNV";
     case (int)Op::OpTensorViewSetStrideNV:           return "OpTensorViewSetStrideNV";
     case (int)Op::OpTensorViewSetClipNV:             return "OpTensorViewSetClipNV";
     case (int)Op::OpTensorViewSetClipNV:             return "OpTensorViewSetClipNV";
 
 
+    case (int)Op::OpTypeTensorARM:                   return "OpTypeTensorARM";
+    case (int)Op::OpTensorReadARM:                   return "OpTensorReadARM";
+    case (int)Op::OpTensorWriteARM:                  return "OpTensorWriteARM";
+    case (int)Op::OpTensorQuerySizeARM:              return "OpTensorQuerySizeARM";
+
     case (int)Op::OpTypeCooperativeVectorNV:         return "OpTypeCooperativeVectorNV";
     case (int)Op::OpTypeCooperativeVectorNV:         return "OpTypeCooperativeVectorNV";
     case (int)Op::OpCooperativeVectorMatrixMulNV:    return "OpCooperativeVectorMatrixMulNV";
     case (int)Op::OpCooperativeVectorMatrixMulNV:    return "OpCooperativeVectorMatrixMulNV";
     case (int)Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV";
     case (int)Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV";
@@ -1833,6 +1839,10 @@ void Parameterize()
         InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].setResultAndType(false, false);
         InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].setResultAndType(false, false);
         InstructionDesc[enumCast(Op::OpCooperativeVectorReduceSumAccumulateNV)].setResultAndType(false, false);
         InstructionDesc[enumCast(Op::OpCooperativeVectorReduceSumAccumulateNV)].setResultAndType(false, false);
 
 
+        InstructionDesc[enumCast(Op::OpTypeTensorARM)].setResultAndType(true, false);
+        InstructionDesc[enumCast(Op::OpTensorReadARM)].setResultAndType(true, true);
+        InstructionDesc[enumCast(Op::OpTensorWriteARM)].setResultAndType(false, false);
+
         // Specific additional context-dependent operands
         // Specific additional context-dependent operands
 
 
         ExecutionModeOperands[enumCast(ExecutionMode::Invocations)].push(OperandLiteralNumber, "'Number of <<Invocation,invocations>>'");
         ExecutionModeOperands[enumCast(ExecutionMode::Invocations)].push(OperandLiteralNumber, "'Number of <<Invocation,invocations>>'");
@@ -3805,6 +3815,24 @@ void Parameterize()
         InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Vector2'");
         InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Vector2'");
         InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Accumulator'");
         InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Accumulator'");
         InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'");
         InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'");
+
+        InstructionDesc[enumCast(Op::OpTypeTensorARM)].operands.push(OperandId, "'Element Type'");
+        InstructionDesc[enumCast(Op::OpTypeTensorARM)].operands.push(OperandId, "'Rank'");
+
+        InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandId, "'Tensor'");
+        InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandId, "'Coordinate'");
+        InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandLiteralNumber, "'Tensor Operand'", true);
+        InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandVariableIds, "'Tensor Operands'");
+
+        InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Tensor'");
+        InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Coordinate'");
+        InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Object'");
+        InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandLiteralNumber, "'Tensor Operand'", true);
+        InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandVariableIds, "'Tensor Operands'");
+
+        InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Tensor'");
+        InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Dimension'", true);
+
     });
     });
 }
 }
 
 

+ 32 - 2
SPIRV/spirv.hpp11

@@ -1070,8 +1070,9 @@ enum class Capability : unsigned {
     TileImageColorReadAccessEXT = 4166,
     TileImageColorReadAccessEXT = 4166,
     TileImageDepthReadAccessEXT = 4167,
     TileImageDepthReadAccessEXT = 4167,
     TileImageStencilReadAccessEXT = 4168,
     TileImageStencilReadAccessEXT = 4168,
-    CooperativeMatrixLayoutsARM = 4201,
-    Float8EXT = 4212,
+    TensorsARM = 4174,
+    CooperativeMatrixLayoutsARM = 4201,
+    Float8EXT = 4212,
     Float8CooperativeMatrixEXT = 4213,
     Float8CooperativeMatrixEXT = 4213,
     FragmentShadingRateKHR = 4422,
     FragmentShadingRateKHR = 4422,
     SubgroupBallotKHR = 4423,
     SubgroupBallotKHR = 4423,
@@ -1460,6 +1461,18 @@ enum class TensorAddressingOperandsMask : unsigned {
     DecodeFunc = 0x00000002,
     DecodeFunc = 0x00000002,
 };
 };
 
 
+enum class TensorOperandsShift : unsigned {
+    NontemporalARM = 0,
+    OutOfBoundsValueARM = 1,
+    Max = 0x7fffffff,
+};
+
+enum class TensorOperandsMask : unsigned {
+    MaskNone = 0,
+    NontemporalARM = 0x00000001,
+    OutOfBoundsValueARM = 0x00000002,
+};
+
 enum class InitializationModeQualifier : unsigned {
 enum class InitializationModeQualifier : unsigned {
     InitOnDeviceReprogramINTEL = 0,
     InitOnDeviceReprogramINTEL = 0,
     InitOnDeviceResetINTEL = 1,
     InitOnDeviceResetINTEL = 1,
@@ -1926,6 +1939,10 @@ enum class Op : unsigned {
     OpColorAttachmentReadEXT = 4160,
     OpColorAttachmentReadEXT = 4160,
     OpDepthAttachmentReadEXT = 4161,
     OpDepthAttachmentReadEXT = 4161,
     OpStencilAttachmentReadEXT = 4162,
     OpStencilAttachmentReadEXT = 4162,
+    OpTypeTensorARM = 4163,
+    OpTensorReadARM = 4164,
+    OpTensorWriteARM = 4165,
+    OpTensorQuerySizeARM = 4166,
     OpTerminateInvocation = 4416,
     OpTerminateInvocation = 4416,
     OpTypeUntypedPointerKHR = 4417,
     OpTypeUntypedPointerKHR = 4417,
     OpUntypedVariableKHR = 4418,
     OpUntypedVariableKHR = 4418,
@@ -2735,6 +2752,10 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
     case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
     case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
     case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
     case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
     case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
+    case Op::OpTypeTensorARM: *hasResult = true; *hasResultType = false; break;
+    case Op::OpTensorReadARM: *hasResult = true; *hasResultType = true; break;
+    case Op::OpTensorWriteARM: *hasResult = false; *hasResultType = false; break;
+    case Op::OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break;
     case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
     case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
     case Op::OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break;
     case Op::OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break;
     case Op::OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break;
     case Op::OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break;
@@ -3944,6 +3965,7 @@ inline const char* CapabilityToString(Capability value) {
     case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
     case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
     case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
     case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
     case Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT";
     case Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT";
+    case Capability::TensorsARM: return "TensorsARM";
     case Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM";
     case Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM";
     case Capability::Float8EXT: return "Float8EXT";
     case Capability::Float8EXT: return "Float8EXT";
     case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT";
     case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT";
@@ -4671,6 +4693,10 @@ inline const char* OpToString(Op value) {
     case Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT";
     case Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT";
     case Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT";
     case Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT";
     case Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT";
     case Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT";
+    case Op::OpTypeTensorARM: return "OpTypeTensorARM";
+    case Op::OpTensorReadARM: return "OpTensorReadARM";
+    case Op::OpTensorWriteARM: return "OpTensorWriteARM";
+    case Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM";
     case Op::OpTerminateInvocation: return "OpTerminateInvocation";
     case Op::OpTerminateInvocation: return "OpTerminateInvocation";
     case Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR";
     case Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR";
     case Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR";
     case Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR";
@@ -5171,6 +5197,10 @@ constexpr TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a,
 constexpr TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); }
 constexpr TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); }
 constexpr TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); }
 constexpr TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); }
 constexpr TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); }
 constexpr TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); }
+constexpr TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); }
+constexpr TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); }
+constexpr TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); }
+constexpr TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); }
 constexpr MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); }
 constexpr MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); }
 constexpr MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); }
 constexpr MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); }
 constexpr MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); }
 constexpr MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); }

+ 9 - 0
Test/baseResults/spv.tensorARM.access_qualifiers.comp.out

@@ -0,0 +1,9 @@
+spv.tensorARM.access_qualifiers.comp
+ERROR: 0:25: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter 
+ERROR: 0:26: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter 
+ERROR: 0:33: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter 
+ERROR: 0:34: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter 
+ERROR: 4 compilation errors.  No code generated.
+
+
+SPIR-V is not generated for failed compile or link

+ 325 - 0
Test/baseResults/spv.tensorARM.all_accesses.comp.out

@@ -0,0 +1,325 @@
+spv.tensorARM.all_accesses.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 199
+
+                              Capability Shader
+                              Capability Float16
+                              Capability Float64
+                              Capability Int64
+                              Capability Int16
+                              Capability Int8
+                              Capability TensorsARM
+                              Extension  "SPV_ARM_tensors"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main"
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source GLSL 460
+                              SourceExtension  "GL_ARM_tensors"
+                              SourceExtension  "GL_EXT_shader_explicit_arithmetic_types"
+                              Name 4  "main"
+                              Name 10  "coords"
+                              Name 15  "iw8"
+                              Name 19  "iw16"
+                              Name 23  "iw"
+                              Name 27  "iw64"
+                              Name 31  "it8"
+                              Name 37  "it16"
+                              Name 43  "it32"
+                              Name 49  "it64"
+                              Name 56  "iwv"
+                              Name 63  "ir8"
+                              Name 67  "ir16"
+                              Name 71  "ir"
+                              Name 75  "ir64"
+                              Name 79  "irv"
+                              Name 83  "uw8"
+                              Name 87  "uw16"
+                              Name 90  "uw"
+                              Name 93  "uw64"
+                              Name 97  "ut8"
+                              Name 103  "ut16"
+                              Name 109  "ut32"
+                              Name 115  "ut64"
+                              Name 121  "uwv"
+                              Name 128  "ur8"
+                              Name 132  "ur16"
+                              Name 136  "ur"
+                              Name 140  "ur64"
+                              Name 144  "urv"
+                              Name 148  "fw"
+                              Name 152  "fw16"
+                              Name 156  "fw64"
+                              Name 160  "ft16"
+                              Name 166  "ft32"
+                              Name 172  "ft64"
+                              Name 178  "fwv"
+                              Name 185  "fr16"
+                              Name 189  "fr"
+                              Name 193  "fr64"
+                              Name 197  "frv"
+                              Decorate 31(it8) Binding 0
+                              Decorate 31(it8) DescriptorSet 0
+                              Decorate 37(it16) Binding 1
+                              Decorate 37(it16) DescriptorSet 0
+                              Decorate 43(it32) Binding 2
+                              Decorate 43(it32) DescriptorSet 0
+                              Decorate 49(it64) Binding 3
+                              Decorate 49(it64) DescriptorSet 0
+                              Decorate 97(ut8) Binding 4
+                              Decorate 97(ut8) DescriptorSet 0
+                              Decorate 103(ut16) Binding 5
+                              Decorate 103(ut16) DescriptorSet 0
+                              Decorate 109(ut32) Binding 6
+                              Decorate 109(ut32) DescriptorSet 0
+                              Decorate 115(ut64) Binding 7
+                              Decorate 115(ut64) DescriptorSet 0
+                              Decorate 160(ft16) Binding 8
+                              Decorate 160(ft16) DescriptorSet 0
+                              Decorate 166(ft32) Binding 9
+                              Decorate 166(ft32) DescriptorSet 0
+                              Decorate 172(ft64) Binding 10
+                              Decorate 172(ft64) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:      6(int) Constant 1
+               8:             TypeArray 6(int) 7
+               9:             TypePointer Function 8
+              11:      6(int) Constant 0
+              12:           8 ConstantComposite 11
+              13:             TypeInt 8 1
+              14:             TypePointer Function 13(int8_t)
+              16:  13(int8_t) Constant 1
+              17:             TypeInt 16 1
+              18:             TypePointer Function 17(int16_t)
+              20: 17(int16_t) Constant 1
+              21:             TypeInt 32 1
+              22:             TypePointer Function 21(int)
+              24:     21(int) Constant 1
+              25:             TypeInt 64 1
+              26:             TypePointer Function 25(int64_t)
+              28: 25(int64_t) Constant 1 0
+              29:             TypeTensorARM 13(int8_t) 7
+              30:             TypePointer UniformConstant 29
+         31(it8):     30(ptr) Variable UniformConstant
+              35:             TypeTensorARM 17(int16_t) 7
+              36:             TypePointer UniformConstant 35
+        37(it16):     36(ptr) Variable UniformConstant
+              41:             TypeTensorARM 21(int) 7
+              42:             TypePointer UniformConstant 41
+        43(it32):     42(ptr) Variable UniformConstant
+              47:             TypeTensorARM 25(int64_t) 7
+              48:             TypePointer UniformConstant 47
+        49(it64):     48(ptr) Variable UniformConstant
+              53:      6(int) Constant 4
+              54:             TypeArray 21(int) 53
+              55:             TypePointer Function 54
+              57:          54 ConstantComposite 24 24 24 24
+              81:             TypeInt 8 0
+              82:             TypePointer Function 81(int8_t)
+              84:  81(int8_t) Constant 1
+              85:             TypeInt 16 0
+              86:             TypePointer Function 85(int16_t)
+              88: 85(int16_t) Constant 1
+              89:             TypePointer Function 6(int)
+              91:             TypeInt 64 0
+              92:             TypePointer Function 91(int64_t)
+              94: 91(int64_t) Constant 1 0
+              95:             TypeTensorARM 81(int8_t) 7
+              96:             TypePointer UniformConstant 95
+         97(ut8):     96(ptr) Variable UniformConstant
+             101:             TypeTensorARM 85(int16_t) 7
+             102:             TypePointer UniformConstant 101
+       103(ut16):    102(ptr) Variable UniformConstant
+             107:             TypeTensorARM 6(int) 7
+             108:             TypePointer UniformConstant 107
+       109(ut32):    108(ptr) Variable UniformConstant
+             113:             TypeTensorARM 91(int64_t) 7
+             114:             TypePointer UniformConstant 113
+       115(ut64):    114(ptr) Variable UniformConstant
+             119:             TypeArray 6(int) 53
+             120:             TypePointer Function 119
+             122:         119 ConstantComposite 7 7 7 7
+             146:             TypeFloat 32
+             147:             TypePointer Function 146(float)
+             149:  146(float) Constant 1065353216
+             150:             TypeFloat 16
+             151:             TypePointer Function 150(float16_t)
+             153:150(float16_t) Constant 15360
+             154:             TypeFloat 64
+             155:             TypePointer Function 154(float64_t)
+             157:154(float64_t) Constant 0 1072693248
+             158:             TypeTensorARM 150(float16_t) 7
+             159:             TypePointer UniformConstant 158
+       160(ft16):    159(ptr) Variable UniformConstant
+             164:             TypeTensorARM 146(float) 7
+             165:             TypePointer UniformConstant 164
+       166(ft32):    165(ptr) Variable UniformConstant
+             170:             TypeTensorARM 154(float64_t) 7
+             171:             TypePointer UniformConstant 170
+       172(ft64):    171(ptr) Variable UniformConstant
+             176:             TypeArray 146(float) 53
+             177:             TypePointer Function 176
+             179:         176 ConstantComposite 149 149 149 149
+         4(main):           2 Function None 3
+               5:             Label
+      10(coords):      9(ptr) Variable Function
+         15(iw8):     14(ptr) Variable Function
+        19(iw16):     18(ptr) Variable Function
+          23(iw):     22(ptr) Variable Function
+        27(iw64):     26(ptr) Variable Function
+         56(iwv):     55(ptr) Variable Function
+         63(ir8):     14(ptr) Variable Function
+        67(ir16):     18(ptr) Variable Function
+          71(ir):     22(ptr) Variable Function
+        75(ir64):     26(ptr) Variable Function
+         79(irv):     55(ptr) Variable Function
+         83(uw8):     82(ptr) Variable Function
+        87(uw16):     86(ptr) Variable Function
+          90(uw):     89(ptr) Variable Function
+        93(uw64):     92(ptr) Variable Function
+        121(uwv):    120(ptr) Variable Function
+        128(ur8):     82(ptr) Variable Function
+       132(ur16):     86(ptr) Variable Function
+         136(ur):     89(ptr) Variable Function
+       140(ur64):     92(ptr) Variable Function
+        144(urv):    120(ptr) Variable Function
+         148(fw):    147(ptr) Variable Function
+       152(fw16):    151(ptr) Variable Function
+       156(fw64):    155(ptr) Variable Function
+        178(fwv):    177(ptr) Variable Function
+       185(fr16):    151(ptr) Variable Function
+         189(fr):    147(ptr) Variable Function
+       193(fr64):    155(ptr) Variable Function
+        197(frv):    177(ptr) Variable Function
+                              Store 10(coords) 12
+                              Store 15(iw8) 16
+                              Store 19(iw16) 20
+                              Store 23(iw) 24
+                              Store 27(iw64) 28
+              32:          29 Load 31(it8)
+              33:           8 Load 10(coords)
+              34:  13(int8_t) Load 15(iw8)
+                              TensorWriteARM 32 33 34
+              38:          35 Load 37(it16)
+              39:           8 Load 10(coords)
+              40: 17(int16_t) Load 19(iw16)
+                              TensorWriteARM 38 39 40
+              44:          41 Load 43(it32)
+              45:           8 Load 10(coords)
+              46:     21(int) Load 23(iw)
+                              TensorWriteARM 44 45 46
+              50:          47 Load 49(it64)
+              51:           8 Load 10(coords)
+              52: 25(int64_t) Load 27(iw64)
+                              TensorWriteARM 50 51 52
+                              Store 56(iwv) 57
+              58:          41 Load 43(it32)
+              59:           8 Load 10(coords)
+              60:          54 Load 56(iwv)
+                              TensorWriteARM 58 59 60
+              61:          29 Load 31(it8)
+              62:           8 Load 10(coords)
+              64:  13(int8_t) TensorReadARM 61 62
+                              Store 63(ir8) 64
+              65:          35 Load 37(it16)
+              66:           8 Load 10(coords)
+              68: 17(int16_t) TensorReadARM 65 66
+                              Store 67(ir16) 68
+              69:          41 Load 43(it32)
+              70:           8 Load 10(coords)
+              72:     21(int) TensorReadARM 69 70
+                              Store 71(ir) 72
+              73:          47 Load 49(it64)
+              74:           8 Load 10(coords)
+              76: 25(int64_t) TensorReadARM 73 74
+                              Store 75(ir64) 76
+              77:          41 Load 43(it32)
+              78:           8 Load 10(coords)
+              80:          54 TensorReadARM 77 78
+                              Store 79(irv) 80
+                              Store 83(uw8) 84
+                              Store 87(uw16) 88
+                              Store 90(uw) 7
+                              Store 93(uw64) 94
+              98:          95 Load 97(ut8)
+              99:           8 Load 10(coords)
+             100:  81(int8_t) Load 83(uw8)
+                              TensorWriteARM 98 99 100
+             104:         101 Load 103(ut16)
+             105:           8 Load 10(coords)
+             106: 85(int16_t) Load 87(uw16)
+                              TensorWriteARM 104 105 106
+             110:         107 Load 109(ut32)
+             111:           8 Load 10(coords)
+             112:      6(int) Load 90(uw)
+                              TensorWriteARM 110 111 112
+             116:         113 Load 115(ut64)
+             117:           8 Load 10(coords)
+             118: 91(int64_t) Load 93(uw64)
+                              TensorWriteARM 116 117 118
+                              Store 121(uwv) 122
+             123:         107 Load 109(ut32)
+             124:           8 Load 10(coords)
+             125:         119 Load 121(uwv)
+                              TensorWriteARM 123 124 125
+             126:          95 Load 97(ut8)
+             127:           8 Load 10(coords)
+             129:  81(int8_t) TensorReadARM 126 127
+                              Store 128(ur8) 129
+             130:         101 Load 103(ut16)
+             131:           8 Load 10(coords)
+             133: 85(int16_t) TensorReadARM 130 131
+                              Store 132(ur16) 133
+             134:         107 Load 109(ut32)
+             135:           8 Load 10(coords)
+             137:      6(int) TensorReadARM 134 135
+                              Store 136(ur) 137
+             138:         113 Load 115(ut64)
+             139:           8 Load 10(coords)
+             141: 91(int64_t) TensorReadARM 138 139
+                              Store 140(ur64) 141
+             142:         107 Load 109(ut32)
+             143:           8 Load 10(coords)
+             145:         119 TensorReadARM 142 143
+                              Store 144(urv) 145
+                              Store 148(fw) 149
+                              Store 152(fw16) 153
+                              Store 156(fw64) 157
+             161:         158 Load 160(ft16)
+             162:           8 Load 10(coords)
+             163:150(float16_t) Load 152(fw16)
+                              TensorWriteARM 161 162 163
+             167:         164 Load 166(ft32)
+             168:           8 Load 10(coords)
+             169:  146(float) Load 148(fw)
+                              TensorWriteARM 167 168 169
+             173:         170 Load 172(ft64)
+             174:           8 Load 10(coords)
+             175:154(float64_t) Load 156(fw64)
+                              TensorWriteARM 173 174 175
+                              Store 178(fwv) 179
+             180:         164 Load 166(ft32)
+             181:           8 Load 10(coords)
+             182:         176 Load 178(fwv)
+                              TensorWriteARM 180 181 182
+             183:         158 Load 160(ft16)
+             184:           8 Load 10(coords)
+             186:150(float16_t) TensorReadARM 183 184
+                              Store 185(fr16) 186
+             187:         164 Load 166(ft32)
+             188:           8 Load 10(coords)
+             190:  146(float) TensorReadARM 187 188
+                              Store 189(fr) 190
+             191:         170 Load 172(ft64)
+             192:           8 Load 10(coords)
+             194:154(float64_t) TensorReadARM 191 192
+                              Store 193(fr64) 194
+             195:         164 Load 166(ft32)
+             196:           8 Load 10(coords)
+             198:         176 TensorReadARM 195 196
+                              Store 197(frv) 198
+                              Return
+                              FunctionEnd

+ 47 - 0
Test/baseResults/spv.tensorARM.array.comp.out

@@ -0,0 +1,47 @@
+spv.tensorARM.array.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 27
+
+                              Capability Shader
+                              Capability TensorsARM
+                              Extension  "SPV_ARM_tensors"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main"
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source GLSL 460
+                              SourceExtension  "GL_ARM_tensors"
+                              Name 4  "main"
+                              Name 8  "x"
+                              Name 14  "ta"
+                              Decorate 14(ta) Binding 0
+                              Decorate 14(ta) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypePointer Function 6(int)
+               9:             TypeInt 32 1
+              10:      6(int) Constant 2
+              11:             TypeTensorARM 9(int) 10
+              12:             TypeArray 11 10
+              13:             TypePointer UniformConstant 12
+          14(ta):     13(ptr) Variable UniformConstant
+              15:      9(int) Constant 0
+              16:             TypePointer UniformConstant 11
+              19:      6(int) Constant 0
+              21:      9(int) Constant 1
+              24:      6(int) Constant 1
+         4(main):           2 Function None 3
+               5:             Label
+            8(x):      7(ptr) Variable Function
+              17:     16(ptr) AccessChain 14(ta) 15
+              18:          11 Load 17
+              20:      6(int) TensorQuerySizeARM 18 19
+              22:     16(ptr) AccessChain 14(ta) 21
+              23:          11 Load 22
+              25:      6(int) TensorQuerySizeARM 23 24
+              26:      6(int) IAdd 20 25
+                              Store 8(x) 26
+                              Return
+                              FunctionEnd

+ 104 - 0
Test/baseResults/spv.tensorARM.declare.comp.out

@@ -0,0 +1,104 @@
+spv.tensorARM.declare.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 66
+
+                              Capability Shader
+                              Capability TensorsARM
+                              Extension  "SPV_ARM_tensors"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main"
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source GLSL 460
+                              SourceExtension  "GL_ARM_tensors"
+                              SourceExtension  "GL_EXT_shader_explicit_arithmetic_types"
+                              Name 4  "main"
+                              Name 11  "tb"
+                              Name 17  "b"
+                              Name 23  "barr"
+                              Name 28  "t"
+                              Name 33  "i32"
+                              Name 42  "vec"
+                              Name 48  "vecthree"
+                              Name 55  "vecfour"
+                              Decorate 11(tb) Binding 1
+                              Decorate 11(tb) DescriptorSet 0
+                              Decorate 28(t) Binding 0
+                              Decorate 28(t) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeBool
+               7:             TypeInt 32 0
+               8:      7(int) Constant 2
+               9:             TypeTensorARM 6(bool) 8
+              10:             TypePointer UniformConstant 9
+          11(tb):     10(ptr) Variable UniformConstant
+              13:             TypeArray 7(int) 8
+              14:      7(int) Constant 0
+              15:          13 ConstantComposite 14 14
+              16:             TypePointer Function 6(bool)
+              20:      7(int) Constant 4
+              21:             TypeArray 6(bool) 20
+              22:             TypePointer Function 21
+              25:             TypeInt 32 1
+              26:             TypeTensorARM 25(int) 20
+              27:             TypePointer UniformConstant 26
+           28(t):     27(ptr) Variable UniformConstant
+              30:             TypeArray 7(int) 20
+              31:          30 ConstantComposite 14 14 14 14
+              32:             TypePointer Function 25(int)
+              34:     25(int) Constant 33
+              37:      7(int) Constant 1
+              38:      7(int) Constant 3
+              39:          30 ConstantComposite 37 8 38 20
+              40:             TypeArray 25(int) 8
+              41:             TypePointer Function 40
+              45:          30 ConstantComposite 38 8 37 14
+              46:             TypeArray 25(int) 38
+              47:             TypePointer Function 46
+              51:      7(int) Constant 99
+              52:          30 ConstantComposite 51 51 51 51
+              53:             TypeArray 25(int) 20
+              54:             TypePointer Function 53
+              62:          30 ConstantComposite 20 38 8 37
+         4(main):           2 Function None 3
+               5:             Label
+           17(b):     16(ptr) Variable Function
+        23(barr):     22(ptr) Variable Function
+         33(i32):     32(ptr) Variable Function
+         42(vec):     41(ptr) Variable Function
+    48(vecthree):     47(ptr) Variable Function
+     55(vecfour):     54(ptr) Variable Function
+              12:           9 Load 11(tb)
+              18:     6(bool) TensorReadARM 12 15
+                              Store 17(b) 18
+              19:           9 Load 11(tb)
+              24:          21 TensorReadARM 19 15
+                              Store 23(barr) 24
+              29:          26 Load 28(t)
+              35:     25(int) TensorReadARM 29 31 2 34
+                              Store 33(i32) 35
+              36:          26 Load 28(t)
+              43:          40 TensorReadARM 36 39
+                              Store 42(vec) 43
+              44:          26 Load 28(t)
+              49:          46 TensorReadARM 44 45
+                              Store 48(vecthree) 49
+              50:          26 Load 28(t)
+              56:          53 TensorReadARM 50 52
+                              Store 55(vecfour) 56
+              57:           9 Load 11(tb)
+              58:     6(bool) Load 17(b)
+                              TensorWriteARM 57 15 58
+              59:           9 Load 11(tb)
+              60:          21 Load 23(barr)
+                              TensorWriteARM 59 15 60
+              61:          26 Load 28(t)
+              63:     25(int) Load 33(i32)
+                              TensorWriteARM 61 62 63
+              64:          26 Load 28(t)
+              65:          40 Load 42(vec)
+                              TensorWriteARM 64 31 65 1
+                              Return
+                              FunctionEnd

+ 91 - 0
Test/baseResults/spv.tensorARM.frag.out

@@ -0,0 +1,91 @@
+spv.tensorARM.frag
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 55
+
+                              Capability Shader
+                              Capability Int8
+                              Capability TensorsARM
+                              Extension  "SPV_ARM_tensors"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 25 49
+                              ExecutionMode 4 OriginUpperLeft
+                              Source GLSL 450
+                              SourceExtension  "GL_ARM_tensors"
+                              SourceExtension  "GL_EXT_shader_explicit_arithmetic_types"
+                              Name 4  "main"
+                              Name 8  "size_d1"
+                              Name 13  "tens"
+                              Name 17  "size_d2"
+                              Name 21  "coord_x"
+                              Name 25  "gl_FragCoord"
+                              Name 33  "coord_y"
+                              Name 40  "tensorValue"
+                              Name 49  "outColor"
+                              Decorate 13(tens) Binding 0
+                              Decorate 13(tens) DescriptorSet 0
+                              Decorate 25(gl_FragCoord) BuiltIn FragCoord
+                              Decorate 49(outColor) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypePointer Function 6(int)
+               9:             TypeInt 8 0
+              10:      6(int) Constant 3
+              11:             TypeTensorARM 9(int8_t) 10
+              12:             TypePointer UniformConstant 11
+        13(tens):     12(ptr) Variable UniformConstant
+              15:      6(int) Constant 1
+              19:      6(int) Constant 2
+              22:             TypeFloat 32
+              23:             TypeVector 22(float) 4
+              24:             TypePointer Input 23(fvec4)
+25(gl_FragCoord):     24(ptr) Variable Input
+              26:      6(int) Constant 0
+              27:             TypePointer Input 22(float)
+              39:             TypePointer Function 9(int8_t)
+              41:   9(int8_t) Constant 0
+              45:             TypeArray 6(int) 10
+              48:             TypePointer Output 23(fvec4)
+    49(outColor):     48(ptr) Variable Output
+              50:   22(float) Constant 0
+              53:   22(float) Constant 1132396544
+         4(main):           2 Function None 3
+               5:             Label
+      8(size_d1):      7(ptr) Variable Function
+     17(size_d2):      7(ptr) Variable Function
+     21(coord_x):      7(ptr) Variable Function
+     33(coord_y):      7(ptr) Variable Function
+ 40(tensorValue):     39(ptr) Variable Function
+              14:          11 Load 13(tens)
+              16:      6(int) TensorQuerySizeARM 14 15
+                              Store 8(size_d1) 16
+              18:          11 Load 13(tens)
+              20:      6(int) TensorQuerySizeARM 18 19
+                              Store 17(size_d2) 20
+              28:     27(ptr) AccessChain 25(gl_FragCoord) 26
+              29:   22(float) Load 28
+              30:      6(int) ConvertFToU 29
+              31:      6(int) Load 8(size_d1)
+              32:      6(int) UMod 30 31
+                              Store 21(coord_x) 32
+              34:     27(ptr) AccessChain 25(gl_FragCoord) 15
+              35:   22(float) Load 34
+              36:      6(int) ConvertFToU 35
+              37:      6(int) Load 17(size_d2)
+              38:      6(int) UMod 36 37
+                              Store 33(coord_y) 38
+                              Store 40(tensorValue) 41
+              42:          11 Load 13(tens)
+              43:      6(int) Load 33(coord_y)
+              44:      6(int) Load 21(coord_x)
+              46:          45 CompositeConstruct 43 44 15
+              47:   9(int8_t) TensorReadARM 42 46
+                              Store 40(tensorValue) 47
+              51:   9(int8_t) Load 40(tensorValue)
+              52:   22(float) ConvertUToF 51
+              54:   23(fvec4) CompositeConstruct 50 52 50 53
+                              Store 49(outColor) 54
+                              Return
+                              FunctionEnd

+ 18 - 0
Test/baseResults/spv.tensorARM.invalid_access.comp.out

@@ -0,0 +1,18 @@
+spv.tensorARM.invalid_access.comp
+ERROR: 0:11: 'coord' : number of coordinates does not match tensor rank 
+ERROR: 0:12: 'coord' : number of coordinates does not match tensor rank 
+ERROR: 0:12: 'data' :  data argument type (float) does not match tensor element type (int)
+ERROR: 0:14: 'coord' : number of coordinates does not match tensor rank 
+ERROR: 0:15: 'coord' : number of coordinates does not match tensor rank 
+ERROR: 0:15: 'data' :  data argument type (float) does not match tensor element type (int)
+ERROR: 0:19: 'data' :  data argument type (uint) does not match tensor element type (int)
+ERROR: 0:20: 'data' :  data argument type (uint) does not match tensor element type (int)
+ERROR: 0:23: 'tensorOps' : out-of-bounds value is only valid with tensorReadARM 
+ERROR: 0:26: 'tensorOps' : expecting out-of-bounds value as next argument 
+ERROR: 0:28: 'vararg' : argument following gl_TensorOperandsOutOfBoundsValueARM must be constant 
+ERROR: 0:30: 'vararg' :  out-of-bounds value type (float) does not match tensor element type (int)
+ERROR: 0:32: 'vararg' :  out-of-bounds value type (uint) does not match tensor element type (int)
+ERROR: 13 compilation errors.  No code generated.
+
+
+SPIR-V is not generated for failed compile or link

+ 29 - 0
Test/baseResults/spv.tensorARM.invalid_declare.comp.out

@@ -0,0 +1,29 @@
+spv.tensorARM.invalid_declare.comp
+ERROR: 0:5: '' : tensor type is missing type parameters 
+ERROR: 0:5: 'noparams' : expected two type parameters 
+ERROR: 0:5: 'tensorARM' : tensorARM types can only be used in uniform variables or function parameters: noparams
+ERROR: 0:6: '' : tensor rank must be greater than or equal to 1 
+ERROR: 0:6: 'zero' : unexpected type parameters 
+ERROR: 0:7: '' : type parameter must be a non-negative integer
+ERROR: 0:7: '' : tensor rank must be greater than or equal to 1 
+ERROR: 0:7: 'tensorARM' : tensorARM types can only be used in uniform variables or function parameters: minus_one
+ERROR: 0:8: '' : tensor type requires exactly 1 rank specifier 
+ERROR: 0:8: 'too_many' : expected two type parameters 
+ERROR: 0:8: 'tensorARM' : tensorARM types can only be used in uniform variables or function parameters: too_many
+ERROR: 0:9: 'bad_type' : expected bool, integer or floating point type parameter 
+ERROR: 0:9: 'bad_type' : illegal use of type 'void' 
+ERROR: 0:12: '' : tensor type is missing type parameters 
+ERROR: 0:12: 'noparams2' : expected two type parameters 
+ERROR: 0:13: '' : tensor rank must be greater than or equal to 1 
+ERROR: 0:13: 'zero2' : unexpected type parameters 
+ERROR: 0:13: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan 
+ERROR: 0:14: '' : type parameter must be a non-negative integer
+ERROR: 0:14: '' : tensor rank must be greater than or equal to 1 
+ERROR: 0:15: '' : tensor type requires exactly 1 rank specifier 
+ERROR: 0:15: 'too_many2' : expected two type parameters 
+ERROR: 0:16: 'bad_type2' : expected bool, integer or floating point type parameter 
+ERROR: 0:16: 'bad_type2' : illegal use of type 'void' 
+ERROR: 24 compilation errors.  No code generated.
+
+
+SPIR-V is not generated for failed compile or link

+ 6 - 0
Test/baseResults/spv.tensorARM.invalid_operands.comp.out

@@ -0,0 +1,6 @@
+spv.tensorARM.invalid_operands.comp
+ERROR: 0:11: 'tensorOps' : tensor operands argument must be a constant integral expression 
+ERROR: 1 compilation errors.  No code generated.
+
+
+SPIR-V is not generated for failed compile or link

+ 11 - 0
Test/baseResults/spv.tensorARM.invalid_params.comp.out

@@ -0,0 +1,11 @@
+spv.tensorARM.invalid_params.comp
+ERROR: 0:12: '' : tensor type is missing type parameters 
+ERROR: 0:16: '' : tensor type is missing type parameters 
+ERROR: 0:20: '' : tensor type requires exactly 1 rank specifier 
+ERROR: 0:21: 'dim' : dimension argument exceeds tensor rank 
+ERROR: 0:29: 'partiallySpecialized' : no matching overloaded function found 
+ERROR: 0:29: 'assign' :  cannot convert from ' const float' to 'layout( column_major std430 offset=0) temp highp uint'
+ERROR: 6 compilation errors.  No code generated.
+
+
+SPIR-V is not generated for failed compile or link

+ 7 - 0
Test/baseResults/spv.tensorARM.invalid_size.comp.out

@@ -0,0 +1,7 @@
+spv.tensorARM.invalid_size.comp
+ERROR: 0:10: 'dim' : dimension argument exceeds tensor rank 
+ERROR: 0:11: 'dim' : dimension argument must be constant 
+ERROR: 2 compilation errors.  No code generated.
+
+
+SPIR-V is not generated for failed compile or link

+ 8 - 0
Test/baseResults/spv.tensorARM.invalid_tensor_type.comp.out

@@ -0,0 +1,8 @@
+spv.tensorARM.invalid_tensor_type.comp
+ERROR: 0:6: '' :  syntax error, unexpected RIGHT_ANGLE, expecting LEFT_PAREN
+ERROR: 1 compilation errors.  No code generated.
+
+
+ERROR: Linking compute stage: Missing entry point: Each stage requires one entry point
+
+SPIR-V is not generated for failed compile or link

+ 85 - 0
Test/baseResults/spv.tensorARM.params.comp.out

@@ -0,0 +1,85 @@
+spv.tensorARM.params.comp
+Validation failed
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 45
+
+                              Capability Shader
+                              Capability TensorsARM
+                              Extension  "SPV_ARM_tensors"
+                              Extension  "SPV_KHR_storage_buffer_storage_class"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main"
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source GLSL 460
+                              SourceExtension  "GL_ARM_tensors"
+                              SourceExtension  "GL_EXT_shader_explicit_arithmetic_types"
+                              Name 4  "main"
+                              Name 14  "unusedTensorParams(Ti1<4>;Ti1<4>;"
+                              Name 12  ""
+                              Name 13  ""
+                              Name 18  "tensorParam(Ti1<4>;"
+                              Name 17  "t"
+                              Name 21  "qualifiedTensorParam(Ti1<4>;"
+                              Name 20  "t"
+                              Name 33  "tu"
+                              Name 36  "buff"
+                              MemberName 36(buff) 0  "out_data"
+                              Name 38  ""
+                              Decorate 13 NonWritable
+                              Decorate 20(t) NonWritable
+                              Decorate 33(tu) Binding 0
+                              Decorate 33(tu) DescriptorSet 0
+                              Decorate 35 ArrayStride 4
+                              Decorate 36(buff) Block
+                              MemberDecorate 36(buff) 0 Offset 0
+                              Decorate 38 Binding 1
+                              Decorate 38 DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 1
+               7:             TypeInt 32 0
+               8:      7(int) Constant 4
+               9:             TypeTensorARM 6(int) 8
+              10:             TypePointer UniformConstant 9
+              11:             TypeFunction 2 10(ptr) 10(ptr)
+              16:             TypeFunction 7(int) 10(ptr)
+              25:      7(int) Constant 0
+          33(tu):     10(ptr) Variable UniformConstant
+              35:             TypeRuntimeArray 7(int)
+        36(buff):             TypeStruct 35
+              37:             TypePointer StorageBuffer 36(buff)
+              38:     37(ptr) Variable StorageBuffer
+              39:      6(int) Constant 0
+              43:             TypePointer StorageBuffer 7(int)
+         4(main):           2 Function None 3
+               5:             Label
+              34:           2 FunctionCall 14(unusedTensorParams(Ti1<4>;Ti1<4>;) 33(tu) 33(tu)
+              40:      7(int) FunctionCall 18(tensorParam(Ti1<4>;) 33(tu)
+              41:      7(int) FunctionCall 21(qualifiedTensorParam(Ti1<4>;) 33(tu)
+              42:      7(int) IAdd 40 41
+              44:     43(ptr) AccessChain 38 39 39
+                              Store 44 42
+                              Return
+                              FunctionEnd
+14(unusedTensorParams(Ti1<4>;Ti1<4>;):           2 Function None 11
+              12:     10(ptr) FunctionParameter
+              13:     10(ptr) FunctionParameter
+              15:             Label
+                              Return
+                              FunctionEnd
+18(tensorParam(Ti1<4>;):      7(int) Function None 16
+           17(t):     10(ptr) FunctionParameter
+              19:             Label
+              24:           9 Load 17(t)
+              26:      7(int) TensorQuerySizeARM 24 25
+                              ReturnValue 26
+                              FunctionEnd
+21(qualifiedTensorParam(Ti1<4>;):      7(int) Function None 16
+           20(t):     10(ptr) FunctionParameter
+              22:             Label
+              29:           9 Load 20(t)
+              30:      7(int) TensorQuerySizeARM 29 25
+                              ReturnValue 30
+                              FunctionEnd

+ 71 - 0
Test/baseResults/spv.tensorARM.read.comp.out

@@ -0,0 +1,71 @@
+spv.tensorARM.read.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 38
+
+                              Capability Shader
+                              Capability TensorsARM
+                              Extension  "SPV_ARM_tensors"
+                              Extension  "SPV_KHR_storage_buffer_storage_class"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main"
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source GLSL 460
+                              SourceExtension  "GL_ARM_tensors"
+                              SourceExtension  "GL_EXT_shader_explicit_arithmetic_types"
+                              Name 4  "main"
+                              Name 11  "t"
+                              Name 19  "one"
+                              Name 25  "two"
+                              Name 30  "buff"
+                              MemberName 30(buff) 0  "out_data"
+                              Name 32  ""
+                              Decorate 11(t) Binding 0
+                              Decorate 11(t) DescriptorSet 0
+                              Decorate 29 ArrayStride 4
+                              Decorate 30(buff) Block
+                              MemberDecorate 30(buff) 0 Offset 0
+                              Decorate 32 Binding 1
+                              Decorate 32 DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 1
+               7:             TypeInt 32 0
+               8:      7(int) Constant 4
+               9:             TypeTensorARM 6(int) 8
+              10:             TypePointer UniformConstant 9
+           11(t):     10(ptr) Variable UniformConstant
+              13:             TypeArray 7(int) 8
+              14:      7(int) Constant 1
+              15:      7(int) Constant 2
+              16:      7(int) Constant 3
+              17:          13 ConstantComposite 14 15 16 8
+              18:             TypePointer Function 6(int)
+              20:      6(int) Constant 11
+              23:             TypeArray 6(int) 15
+              24:             TypePointer Function 23
+              26:      7(int) Constant 0
+              29:             TypeRuntimeArray 6(int)
+        30(buff):             TypeStruct 29
+              31:             TypePointer StorageBuffer 30(buff)
+              32:     31(ptr) Variable StorageBuffer
+              33:      6(int) Constant 0
+              34:      6(int) Constant 1
+              35:             TypePointer StorageBuffer 6(int)
+         4(main):           2 Function None 3
+               5:             Label
+         19(one):     18(ptr) Variable Function
+         25(two):     24(ptr) Variable Function
+              12:           9 Load 11(t)
+              21:      6(int) TensorReadARM 12 17 2 20
+                              Store 19(one) 21
+              22:           9 Load 11(t)
+              27:          23 TensorReadARM 22 17
+                              Store 25(two) 27
+              28:           9 Load 11(t)
+              36:     35(ptr) AccessChain 32 33 34
+              37:      6(int) TensorReadARM 28 17
+                              Store 36 37
+                              Return
+                              FunctionEnd

+ 71 - 0
Test/baseResults/spv.tensorARM.size.comp.out

@@ -0,0 +1,71 @@
+spv.tensorARM.size.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 41
+
+                              Capability Shader
+                              Capability TensorsARM
+                              Extension  "SPV_ARM_tensors"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main"
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source GLSL 460
+                              SourceExtension  "GL_ARM_tensors"
+                              Name 4  "main"
+                              Name 8  "x"
+                              Name 14  "rank1"
+                              Name 23  "rank2"
+                              Name 35  "rank4"
+                              Decorate 14(rank1) Binding 0
+                              Decorate 14(rank1) DescriptorSet 0
+                              Decorate 23(rank2) Binding 1
+                              Decorate 23(rank2) DescriptorSet 0
+                              Decorate 35(rank4) Binding 2
+                              Decorate 35(rank4) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypePointer Private 6(int)
+            8(x):      7(ptr) Variable Private
+               9:      6(int) Constant 0
+              10:             TypeInt 32 1
+              11:      6(int) Constant 1
+              12:             TypeTensorARM 10(int) 11
+              13:             TypePointer UniformConstant 12
+       14(rank1):     13(ptr) Variable UniformConstant
+              19:             TypeFloat 32
+              20:      6(int) Constant 2
+              21:             TypeTensorARM 19(float) 20
+              22:             TypePointer UniformConstant 21
+       23(rank2):     22(ptr) Variable UniformConstant
+              32:      6(int) Constant 4
+              33:             TypeTensorARM 6(int) 32
+              34:             TypePointer UniformConstant 33
+       35(rank4):     34(ptr) Variable UniformConstant
+              37:      6(int) Constant 3
+         4(main):           2 Function None 3
+               5:             Label
+                              Store 8(x) 9
+              15:          12 Load 14(rank1)
+              16:      6(int) TensorQuerySizeARM 15 9
+              17:      6(int) Load 8(x)
+              18:      6(int) IAdd 17 16
+                              Store 8(x) 18
+              24:          21 Load 23(rank2)
+              25:      6(int) TensorQuerySizeARM 24 9
+              26:      6(int) Load 8(x)
+              27:      6(int) IAdd 26 25
+                              Store 8(x) 27
+              28:          21 Load 23(rank2)
+              29:      6(int) TensorQuerySizeARM 28 11
+              30:      6(int) Load 8(x)
+              31:      6(int) IAdd 30 29
+                              Store 8(x) 31
+              36:          33 Load 35(rank4)
+              38:      6(int) TensorQuerySizeARM 36 37
+              39:      6(int) Load 8(x)
+              40:      6(int) IAdd 39 38
+                              Store 8(x) 40
+                              Return
+                              FunctionEnd

+ 1 - 0
Test/baseResults/validation_fails.txt

@@ -77,4 +77,5 @@ Test/baseResults/spv.queryL.frag.out
 Test/baseResults/spv.separate.frag.out
 Test/baseResults/spv.separate.frag.out
 Test/baseResults/spv.sparseTextureClamp.frag.out
 Test/baseResults/spv.sparseTextureClamp.frag.out
 Test/baseResults/spv.sparseTexture.frag.out
 Test/baseResults/spv.sparseTexture.frag.out
+Test/baseResults/spv.tensorARM.params.comp.out
 Test/baseResults/vk.relaxed.errorcheck.vert.out
 Test/baseResults/vk.relaxed.errorcheck.vert.out

+ 35 - 0
Test/spv.tensorARM.access_qualifiers.comp

@@ -0,0 +1,35 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+
+readonly layout(set=0, binding=1) uniform tensorARM<int, 2> roTens;
+writeonly layout(set=0, binding=0) uniform tensorARM<int, 2> woTens;
+readonly writeonly layout(set=0, binding=1) uniform tensorARM<int, 2> rowoTens;
+layout(set=0, binding=2) uniform tensorARM<int, 2> rwTens;
+shared uint x;
+
+void main() {
+  // tensorSizeARM should be callable with any tensor regardless of access qualifiers.
+  x = 0;
+  x += tensorSizeARM(roTens, 0);
+  x += tensorSizeARM(woTens, 0);
+  x += tensorSizeARM(rowoTens, 1);
+  x += tensorSizeARM(rwTens, 1);
+
+  int d = 4;
+  // Valid tensorWriteARM calls.
+  tensorWriteARM(woTens, uint[](0, 0), d);
+  tensorWriteARM(rwTens, uint[](0, 0), d);
+
+  // Invalid tensorWriteARM calls.
+  tensorWriteARM(rowoTens, uint[](0, 0), d);
+  tensorWriteARM(roTens, uint[](0, 0), d);
+
+  // Valid tensorReadARM calls.
+  tensorReadARM(roTens, uint[](0, 0), d);
+  tensorReadARM(rwTens, uint[](0, 0), d);
+
+  // Invalid tensorReadARM calls.
+  tensorReadARM(rowoTens, uint[](0, 0), d);
+  tensorReadARM(woTens, uint[](0, 0), d);
+}

+ 90 - 0
Test/spv.tensorARM.all_accesses.comp

@@ -0,0 +1,90 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+#extension GL_EXT_shader_explicit_arithmetic_types : enable
+
+// Int types
+uniform tensorARM<int8_t, 1> it8;
+uniform tensorARM<int16_t, 1> it16;
+uniform tensorARM<int, 1> it32;
+uniform tensorARM<int64_t, 1> it64;
+
+// Uint types
+uniform tensorARM<uint8_t, 1> ut8;
+uniform tensorARM<uint16_t, 1> ut16;
+uniform tensorARM<uint, 1> ut32;
+uniform tensorARM<uint64_t, 1> ut64;
+
+// Float types
+uniform tensorARM<float16_t, 1> ft16;
+uniform tensorARM<float, 1> ft32;
+uniform tensorARM<float64_t, 1> ft64;
+
+void main() {
+    uint coords[] = {0};
+
+    // Int types
+    int8_t iw8 = int8_t(1);
+    int16_t iw16 = 1s;
+    int iw = 1;
+    int64_t iw64 = 1l;
+    tensorWriteARM(it8, coords, iw8);
+    tensorWriteARM(it16, coords, iw16);
+    tensorWriteARM(it32, coords, iw);
+    tensorWriteARM(it64, coords, iw64);
+    int iwv[4] = int[](1, 1, 1, 1);
+    tensorWriteARM(it32, coords, iwv);
+
+    int8_t ir8;
+    int16_t ir16;
+    int ir;
+    int64_t ir64;
+    tensorReadARM(it8, coords, ir8);
+    tensorReadARM(it16, coords, ir16);
+    tensorReadARM(it32, coords, ir);
+    tensorReadARM(it64, coords, ir64);
+    int irv[4];
+    tensorReadARM(it32, coords, irv);
+
+    // Uint types
+    uint8_t uw8 = uint8_t(1);
+    uint16_t uw16 = 1s;
+    uint uw = 1;
+    uint64_t uw64 = 1l;
+    tensorWriteARM(ut8, coords, uw8);
+    tensorWriteARM(ut16, coords, uw16);
+    tensorWriteARM(ut32, coords, uw);
+    tensorWriteARM(ut64, coords, uw64);
+    uint uwv[4] = uint[](1, 1, 1, 1);
+    tensorWriteARM(ut32, coords, uwv);
+
+    uint8_t ur8;
+    uint16_t ur16;
+    uint ur;
+    uint64_t ur64;
+    tensorReadARM(ut8, coords, ur8);
+    tensorReadARM(ut16, coords, ur16);
+    tensorReadARM(ut32, coords, ur);
+    tensorReadARM(ut64, coords, ur64);
+    uint urv[4];
+    tensorReadARM(ut32, coords, urv);
+
+    // Float types
+    float fw = 1.0;
+    float16_t fw16 = 1.0hf;
+    float64_t fw64 = 1.0;
+    tensorWriteARM(ft16, coords, fw16);
+    tensorWriteARM(ft32, coords, fw);
+    tensorWriteARM(ft64, coords, fw64);
+    float fwv[4] = float[](1.0, 1.0, 1.0, 1.0);
+    tensorWriteARM(ft32, coords, fwv);
+
+    float fr;
+    float16_t fr16;
+    float64_t fr64;
+    tensorReadARM(ft16, coords, fr16);
+    tensorReadARM(ft32, coords, fr);
+    tensorReadARM(ft64, coords, fr64);
+    float frv[4];
+    tensorReadARM(ft32, coords, frv);
+}

+ 9 - 0
Test/spv.tensorARM.array.comp

@@ -0,0 +1,9 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+
+layout(set=0, binding=0) uniform tensorARM<int, 2> ta[2];
+
+void main() {
+  uint x = tensorSizeARM(ta[0], 0) + tensorSizeARM(ta[1], 1);
+}

+ 28 - 0
Test/spv.tensorARM.declare.comp

@@ -0,0 +1,28 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+#extension GL_EXT_shader_explicit_arithmetic_types : enable
+
+layout(binding = 0) uniform tensorARM<int32_t, 4> t;
+layout(set = 0, binding = 1) uniform tensorARM<bool, 2> tb;
+
+void main()
+{
+    bool b;
+    bool barr[4];
+    int32_t i32;
+    int32_t vec[2];
+    int32_t vecthree[3];
+    int32_t vecfour[4];
+    tensorReadARM(tb, uint[](0, 0), b);
+    tensorReadARM(tb, uint[](0, 0), barr);
+    tensorReadARM(t, uint[](0,0,0,0), i32, gl_TensorOperandsOutOfBoundsValueARM, 33);
+    tensorReadARM(t, uint[](1,2,3,4), vec);
+    tensorReadARM(t, uint[](3,2,1,0), vecthree);
+    tensorReadARM(t, uint[](99,99,99,99), vecfour);
+
+    tensorWriteARM(tb, uint[](0, 0), b);
+    tensorWriteARM(tb, uint[](0, 0), barr);
+    tensorWriteARM(t, uint[](4,3,2,1), i32);
+    tensorWriteARM(t, uint[](0,0,0,0), vec, gl_TensorOperandsNonTemporalARM);
+}

+ 18 - 0
Test/spv.tensorARM.frag

@@ -0,0 +1,18 @@
+#version 450
+#extension GL_ARM_tensors : require
+#extension GL_EXT_shader_explicit_arithmetic_types : require
+
+layout(location = 0) out vec4 outColor;
+
+layout(set=0, binding=0) uniform tensorARM<uint8_t, 3> tens;
+
+void main() {
+    const uint size_d1 = tensorSizeARM(tens, 1);
+    const uint size_d2 = tensorSizeARM(tens, 2);
+    const uint coord_x = uint(gl_FragCoord.x) % size_d1;
+    const uint coord_y = uint(gl_FragCoord.y) % size_d2;
+
+    uint8_t tensorValue = uint8_t(0);
+    tensorReadARM(tens, uint[](coord_y, coord_x, 1), tensorValue);
+    outColor = vec4(0.0, tensorValue, 0.0, 255.0);
+}

+ 33 - 0
Test/spv.tensorARM.invalid_access.comp

@@ -0,0 +1,33 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+
+uniform tensorARM<int, 1> t;
+
+void main() {
+  // Type checking should render these accesses invalid
+  int i = 33;
+  float w = 1.5;
+  tensorWriteARM(t, uint[](0,0), i);
+  tensorWriteARM(t, uint[](0,0), w);
+  float r;
+  tensorReadARM(t, uint[](0,0), i);
+  tensorReadARM(t, uint[](0,0), r);
+
+  // Signed vs unsigned.
+  uint u = 34;
+  tensorReadARM(t, uint[](0), u);
+  tensorWriteARM(t, uint[](0), u);
+
+  // OutOfBounds value is only valid with tensorReadARM.
+  tensorWriteARM(t, uint[](1), i, gl_TensorOperandsOutOfBoundsValueARM, 14);
+
+  // OutOfBounds value must be provided.
+  tensorReadARM(t, uint[](1), i, gl_TensorOperandsOutOfBoundsValueARM);
+  // OutOfBounds value must be constant.
+  tensorReadARM(t, uint[](2), i, gl_TensorOperandsOutOfBoundsValueARM, i);
+  // OutOfBounds value type must match tensor element type.
+  tensorReadARM(t, uint[](3), i, gl_TensorOperandsOutOfBoundsValueARM, 3.14);
+  // OutOfBounds value type must match tensor element type.
+  tensorReadARM(t, uint[](3), i, gl_TensorOperandsOutOfBoundsValueARM, 3u);
+}

+ 18 - 0
Test/spv.tensorARM.invalid_declare.comp

@@ -0,0 +1,18 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+
+tensorARM noparams;
+tensorARM<int, 0> zero;
+tensorARM<int, -1> minus_one;
+tensorARM<int, 1, 2, 3> too_many;
+tensorARM<void, 2> bad_type;
+
+// Repeat the above, but now with the uniform keyword.
+uniform tensorARM noparams2;
+uniform tensorARM<int, 0> zero2;
+uniform tensorARM<int, -1> minus_one2;
+uniform tensorARM<int, 1, 2, 3> too_many2;
+uniform tensorARM<void, 2> bad_type2;
+
+void main() {}

+ 12 - 0
Test/spv.tensorARM.invalid_operands.comp

@@ -0,0 +1,12 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+
+uniform tensorARM<int, 2> t;
+
+void main() {
+  int ret;
+  // error: operands is not a constant expression.
+  uint operands = gl_TensorOperandsNonTemporalARM | gl_TensorOperandsOutOfBoundsValueARM;
+  tensorReadARM(t, uint[](0,0), ret, operands, 1);
+}

+ 30 - 0
Test/spv.tensorARM.invalid_params.comp

@@ -0,0 +1,30 @@
+#version 460 core
+#extension GL_ARM_tensors : enable
+#extension GL_EXT_shader_explicit_arithmetic_types : enable
+
+layout(set = 0, binding = 0) uniform tensorARM<int32_t, 4> tu;
+layout(set = 0, binding = 1) uniform tensorARM<int32_t, 2> td;
+
+layout(set = 0, binding = 2, std430) buffer buff {
+  uint out_data[];
+};
+
+void unusedTensorParam(tensorARM) {
+  return;
+}
+
+uint getDim0Size(tensorARM t) {
+  return tensorSizeARM(t, 0);
+}
+
+uint partiallySpecialized(tensorARM<int> t) {
+  return tensorSizeARM(t, 1);
+}
+
+void main() {
+  unusedTensorParam(tu);
+  unusedTensorParam(td);
+  out_data[0] = getDim0Size(tu);
+  out_data[0] += getDim0Size(td);
+  out_data[0] += partiallySpecialized(tu);
+}

+ 12 - 0
Test/spv.tensorARM.invalid_size.comp

@@ -0,0 +1,12 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+
+uniform tensorARM<int, 2> t;
+shared uint p;
+
+void main() {
+  uint s = 0;
+  s += tensorSizeARM(t, 2);
+  s += tensorSizeARM(t, p);
+}

+ 8 - 0
Test/spv.tensorARM.invalid_tensor_type.comp

@@ -0,0 +1,8 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+#extension GL_EXT_shader_explicit_arithmetic_types : enable
+
+tensorARM<1, float64_t> t;
+
+void main() {}

+ 26 - 0
Test/spv.tensorARM.params.comp

@@ -0,0 +1,26 @@
+#version 460 core
+#extension GL_ARM_tensors : enable
+#extension GL_EXT_shader_explicit_arithmetic_types : enable
+
+layout(set = 0, binding = 0) uniform tensorARM<int32_t, 4> tu;
+
+layout(set = 0, binding = 1, std430) buffer buff {
+  uint out_data[];
+};
+
+void unusedTensorParams(tensorARM<int32_t, 4>, readonly tensorARM<int32_t, 4>) {
+  return;
+}
+
+uint tensorParam(tensorARM<int32_t, 4> t) {
+  return tensorSizeARM(t, 0);
+}
+
+uint qualifiedTensorParam(readonly tensorARM<int32_t, 4> t) {
+  return tensorSizeARM(t, 0);
+}
+
+void main() {
+  unusedTensorParams(tu, tu);
+  out_data[0] = tensorParam(tu) + qualifiedTensorParam(tu);
+}

+ 17 - 0
Test/spv.tensorARM.read.comp

@@ -0,0 +1,17 @@
+#version 460 core
+#extension GL_ARM_tensors : enable
+#extension GL_EXT_shader_explicit_arithmetic_types : enable
+
+layout(set = 0, binding = 0) uniform tensorARM<int32_t, 4> t;
+
+layout(set = 0, binding = 1, std430) buffer buff {
+  int32_t out_data[];
+};
+
+void main() {
+    int32_t one;
+    int32_t two[2];
+    tensorReadARM(t, uint[](1,2,3,4), one, gl_TensorOperandsOutOfBoundsValueARM, 11);
+    tensorReadARM(t, uint[](1,2,3,4), two);
+    tensorReadARM(t, uint[](1,2,3,4), out_data[1]);
+}

+ 17 - 0
Test/spv.tensorARM.size.comp

@@ -0,0 +1,17 @@
+#version 460 core
+
+#extension GL_ARM_tensors : enable
+
+layout(set=0, binding=0) uniform tensorARM<int, 1> rank1;
+layout(set=0, binding=1) uniform tensorARM<float, 2> rank2;
+layout(set=0, binding=2) uniform tensorARM<uint, 4> rank4;
+
+uint x;
+
+void main() {
+  x = 0;
+  x += tensorSizeARM(rank1, 0);
+  x += tensorSizeARM(rank2, 0);
+  x += tensorSizeARM(rank2, 1);
+  x += tensorSizeARM(rank4, 3);
+}

+ 1 - 0
glslang/Include/BaseTypes.h

@@ -74,6 +74,7 @@ enum TBasicType {
     EbtTensorLayoutNV,
     EbtTensorLayoutNV,
     EbtTensorViewNV,
     EbtTensorViewNV,
     EbtCoopvecNV,
     EbtCoopvecNV,
+    EbtTensorARM,
     // SPIR-V type defined by spirv_type
     // SPIR-V type defined by spirv_type
     EbtSpirvType,
     EbtSpirvType,
 
 

+ 41 - 10
glslang/Include/Types.h

@@ -1502,6 +1502,7 @@ public:
     bool coopmatKHR : 1;
     bool coopmatKHR : 1;
     bool coopvecNV  : 1;
     bool coopvecNV  : 1;
     bool tileAttachmentQCOM: 1;
     bool tileAttachmentQCOM: 1;
+    uint32_t tensorRankARM : 4;
     TArraySizes* arraySizes;
     TArraySizes* arraySizes;
     const TType* userDef;
     const TType* userDef;
     TSourceLoc loc;
     TSourceLoc loc;
@@ -1513,7 +1514,8 @@ public:
     bool isCoopmatNV() const { return coopmatNV; }
     bool isCoopmatNV() const { return coopmatNV; }
     bool isCoopmatKHR() const { return coopmatKHR; }
     bool isCoopmatKHR() const { return coopmatKHR; }
     bool isCoopvecNV() const { return coopvecNV; }
     bool isCoopvecNV() const { return coopvecNV; }
-    bool isCoopmatOrvec() const { return isCoopmat() || isCoopvecNV(); }
+    bool isTensorARM() const { return tensorRankARM; }
+    bool hasTypeParameter() const { return isCoopmat() || isCoopvecNV() || isTensorARM(); }
 
 
     bool isTensorLayoutNV() const { return basicType == EbtTensorLayoutNV; }
     bool isTensorLayoutNV() const { return basicType == EbtTensorLayoutNV; }
     bool isTensorViewNV() const { return basicType == EbtTensorViewNV; }
     bool isTensorViewNV() const { return basicType == EbtTensorViewNV; }
@@ -1532,6 +1534,7 @@ public:
         coopmatKHR = false;
         coopmatKHR = false;
         coopvecNV = false;
         coopvecNV = false;
         tileAttachmentQCOM = false;
         tileAttachmentQCOM = false;
+        tensorRankARM = 0;
         spirvType = nullptr;
         spirvType = nullptr;
     }
     }
 
 
@@ -1592,7 +1595,7 @@ public:
     explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
     explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
                    bool isVector = false) :
                    bool isVector = false) :
                             basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
                             basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             spirvType(nullptr)
                             {
                             {
                                 assert(vs >= 0);
                                 assert(vs >= 0);
@@ -1608,7 +1611,7 @@ public:
     TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
     TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
           bool isVector = false) :
           bool isVector = false) :
                             basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
                             basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             spirvType(nullptr)
                             {
                             {
                                 assert(vs >= 0);
                                 assert(vs >= 0);
@@ -1626,7 +1629,7 @@ public:
     explicit TType(const TPublicType& p) :
     explicit TType(const TPublicType& p) :
                             basicType(p.basicType),
                             basicType(p.basicType),
                             vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(p.coopvecNV),
                             vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(p.coopvecNV),
-                            tileAttachmentQCOM(p.tileAttachmentQCOM), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters),
+                            tileAttachmentQCOM(p.tileAttachmentQCOM), tensorRankARM(p.tensorRankARM), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters),
                             spirvType(p.spirvType)
                             spirvType(p.spirvType)
                             {
                             {
                                 if (basicType == EbtSampler)
                                 if (basicType == EbtSampler)
@@ -1679,11 +1682,17 @@ public:
                                 if (p.isCoopvecNV() && p.typeParameters) {
                                 if (p.isCoopvecNV() && p.typeParameters) {
                                     basicType = p.typeParameters->basicType;
                                     basicType = p.typeParameters->basicType;
                                 }
                                 }
+                                if (p.isTensorARM() && p.typeParameters) {
+                                    basicType = p.typeParameters->basicType;
+                                    if (p.typeParameters->arraySizes->getNumDims() > 0) {
+                                        tensorRankARM = static_cast<uint32_t>(p.typeParameters->arraySizes->getDimSize(0)) & 0b1111;
+                                    }
+                                }
                             }
                             }
     // for construction of sampler types
     // for construction of sampler types
     TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
     TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
         basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
         basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-        tileAttachmentQCOM(false), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
+        tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
         sampler(sampler), typeParameters(nullptr), spirvType(nullptr)
         sampler(sampler), typeParameters(nullptr), spirvType(nullptr)
     {
     {
         qualifier.clear();
         qualifier.clear();
@@ -1741,7 +1750,7 @@ public:
     // for making structures, ...
     // for making structures, ...
     TType(TTypeList* userDef, const TString& n) :
     TType(TTypeList* userDef, const TString& n) :
                             basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
                             basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             spirvType(nullptr)
                             {
                             {
                                 sampler.clear();
                                 sampler.clear();
@@ -1751,7 +1760,7 @@ public:
     // For interface blocks
     // For interface blocks
     TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
     TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
                             basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
                             basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            tileAttachmentQCOM(false), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), tensorRankARM(0), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             spirvType(nullptr)
                             {
                             {
                                 sampler.clear();
                                 sampler.clear();
@@ -1760,7 +1769,7 @@ public:
     // for block reference (first parameter must be EbtReference)
     // for block reference (first parameter must be EbtReference)
     explicit TType(TBasicType t, const TType &p, const TString& n) :
     explicit TType(TBasicType t, const TType &p, const TString& n) :
                             basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false),
                             basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false),
-                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             spirvType(nullptr)
                             {
                             {
                                 assert(t == EbtReference);
                                 assert(t == EbtReference);
@@ -1800,6 +1809,7 @@ public:
         coopmatKHRUseValid = copyOf.coopmatKHRUseValid;
         coopmatKHRUseValid = copyOf.coopmatKHRUseValid;
         coopvecNV = copyOf.isCoopVecNV();
         coopvecNV = copyOf.isCoopVecNV();
         tileAttachmentQCOM = copyOf.tileAttachmentQCOM;
         tileAttachmentQCOM = copyOf.tileAttachmentQCOM;
+        tensorRankARM = copyOf.tensorRankARM;
     }
     }
 
 
     // Make complete copy of the whole type graph rooted at 'copyOf'.
     // Make complete copy of the whole type graph rooted at 'copyOf'.
@@ -1919,7 +1929,9 @@ public:
     }
     }
     virtual bool isOpaque() const { return basicType == EbtSampler
     virtual bool isOpaque() const { return basicType == EbtSampler
             || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
             || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
-            || basicType == EbtHitObjectNV || isTileAttachmentQCOM(); }
+            || basicType == EbtHitObjectNV || isTileAttachmentQCOM()
+            || isTensorARM();
+    }
     virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
     virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
 
 
     virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); }
     virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); }
@@ -1936,8 +1948,10 @@ public:
     bool isCoopMatNV() const { return coopmatNV; }
     bool isCoopMatNV() const { return coopmatNV; }
     bool isCoopMatKHR() const { return coopmatKHR; }
     bool isCoopMatKHR() const { return coopmatKHR; }
     bool isCoopVecNV() const { return coopvecNV; }
     bool isCoopVecNV() const { return coopvecNV; }
-    bool isCoopMatOrVec() const { return isCoopMat() || isCoopVecNV(); }
     bool isTileAttachmentQCOM() const { return tileAttachmentQCOM; }
     bool isTileAttachmentQCOM() const { return tileAttachmentQCOM; }
+    bool isTensorARM() const { return tensorRankARM; }
+    bool hasTypeParameter() const { return isCoopMat() || isCoopVecNV() || isTensorARM(); }
+    int getTensorRankARM() const { return static_cast<int>(tensorRankARM); }
     bool isReference() const { return getBasicType() == EbtReference; }
     bool isReference() const { return getBasicType() == EbtReference; }
     bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
     bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
     int getCoopMatKHRuse() const { return static_cast<int>(coopmatKHRuse); }
     int getCoopMatKHRuse() const { return static_cast<int>(coopmatKHRuse); }
@@ -1999,6 +2013,11 @@ public:
 
 
     virtual bool containsNonOpaque() const
     virtual bool containsNonOpaque() const
     {
     {
+        if (isTensorARM()) {
+            // Tensors have a numerical basicType even though it is Opaque
+            return false;
+        }
+
         const auto nonOpaque = [](const TType* t) {
         const auto nonOpaque = [](const TType* t) {
             switch (t->basicType) {
             switch (t->basicType) {
             case EbtVoid:
             case EbtVoid:
@@ -2187,6 +2206,7 @@ public:
         case EbtTensorLayoutNV:    return "tensorLayoutNV";
         case EbtTensorLayoutNV:    return "tensorLayoutNV";
         case EbtTensorViewNV:      return "tensorViewNV";
         case EbtTensorViewNV:      return "tensorViewNV";
         case EbtCoopvecNV:         return "coopvecNV";
         case EbtCoopvecNV:         return "coopvecNV";
+        case EbtTensorARM:         return "tensorARM";
         default:                   return "unknown type";
         default:                   return "unknown type";
         }
         }
     }
     }
@@ -2799,6 +2819,7 @@ public:
               isCoopMatNV() == right.isCoopMatNV() &&
               isCoopMatNV() == right.isCoopMatNV() &&
               isCoopMatKHR() == right.isCoopMatKHR() &&
               isCoopMatKHR() == right.isCoopMatKHR() &&
               isCoopVecNV() == right.isCoopVecNV() &&
               isCoopVecNV() == right.isCoopVecNV() &&
+               isTensorARM() == right.isTensorARM() &&
                sameStructType(right, lpidx, rpidx) &&
                sameStructType(right, lpidx, rpidx) &&
                sameReferenceType(right);
                sameReferenceType(right);
     }
     }
@@ -2866,9 +2887,18 @@ public:
         if (isTensorViewNV()) {
         if (isTensorViewNV()) {
             return right.isTensorViewNV() && right.typeParameters == nullptr && typeParameters != nullptr;
             return right.isTensorViewNV() && right.typeParameters == nullptr && typeParameters != nullptr;
         }
         }
+        if (isTensorARM()) {
+            return right.isTensorARM() && right.typeParameters == nullptr && typeParameters != nullptr;
+        }
+
         return false;
         return false;
     }
     }
 
 
+    bool sameTensorBaseTypeARM(const TType &right) const {
+        return (typeParameters == nullptr || right.typeParameters == nullptr ||
+                (tensorRankARM == right.tensorRankARM && getBasicType() == right.getBasicType()));
+    }
+
     bool sameCoopVecBaseType(const TType &right) const {
     bool sameCoopVecBaseType(const TType &right) const {
         bool rv = false;
         bool rv = false;
 
 
@@ -3016,6 +3046,7 @@ protected:
     bool coopmatKHRUseValid   : 1;  // True if coopmatKHRuse has been set
     bool coopmatKHRUseValid   : 1;  // True if coopmatKHRuse has been set
     bool coopvecNV       : 1;
     bool coopvecNV       : 1;
     bool tileAttachmentQCOM : 1;
     bool tileAttachmentQCOM : 1;
+    uint32_t tensorRankARM       : 4;  // 0 means not a tensor; non-zero indicates the tensor rank.
     TQualifier qualifier;
     TQualifier qualifier;
 
 
     TArraySizes* arraySizes;    // nullptr unless an array; can be shared across types
     TArraySizes* arraySizes;    // nullptr unless an array; can be shared across types

+ 5 - 0
glslang/Include/intermediate.h

@@ -479,6 +479,10 @@ enum TOperator {
     EOpCooperativeVectorOuterProductAccumulateNV,
     EOpCooperativeVectorOuterProductAccumulateNV,
     EOpCooperativeVectorReduceSumAccumulateNV,
     EOpCooperativeVectorReduceSumAccumulateNV,
 
 
+    EOpTensorReadARM,
+    EOpTensorWriteARM,
+    EOpTensorSizeARM,
+
     EOpBeginInvocationInterlock, // Fragment only
     EOpBeginInvocationInterlock, // Fragment only
     EOpEndInvocationInterlock, // Fragment only
     EOpEndInvocationInterlock, // Fragment only
 
 
@@ -1104,6 +1108,7 @@ public:
     virtual int getVectorSize() const { return type.getVectorSize(); }
     virtual int getVectorSize() const { return type.getVectorSize(); }
     virtual int getMatrixCols() const { return type.getMatrixCols(); }
     virtual int getMatrixCols() const { return type.getMatrixCols(); }
     virtual int getMatrixRows() const { return type.getMatrixRows(); }
     virtual int getMatrixRows() const { return type.getMatrixRows(); }
+    virtual int getTensorRankARM() const { return type.getTensorRankARM(); }
     virtual bool isMatrix() const { return type.isMatrix(); }
     virtual bool isMatrix() const { return type.isMatrix(); }
     virtual bool isArray()  const { return type.isArray(); }
     virtual bool isArray()  const { return type.isArray(); }
     virtual bool isVector() const { return type.isVector(); }
     virtual bool isVector() const { return type.isVector(); }

+ 39 - 0
glslang/MachineIndependent/Initialize.cpp

@@ -4937,6 +4937,29 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "tensorViewNV setTensorViewClipNV(tensorViewNV v, uint clipRowOffset, uint clipRowSpan, uint clipColOffset, uint clipColSpan);\n"
             "tensorViewNV setTensorViewClipNV(tensorViewNV v, uint clipRowOffset, uint clipRowSpan, uint clipColOffset, uint clipColSpan);\n"
             "\n"
             "\n"
         );
         );
+
+        // GL_ARM_tensors builtins.
+        static const char *tensorDataTypesARM[] = {
+            "bool",
+            "int8_t", "int16_t", "int32_t", "int64_t",
+            "uint8_t", "uint16_t", "uint32_t", "uint64_t",
+            "float16_t", "float32_t", "float64_t",
+        };
+        std::ostringstream ostream;
+        for (auto t : tensorDataTypesARM) {
+            // Scalar
+            ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], out "
+                    << t << " data, uint tensorOperands = 0U, ...);\n";
+            ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], "
+                    << t << " data, uint tensorOperands = 0U, ...);\n";
+            // Array
+            ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], "
+                    << t << " data[], uint tensorOperands = 0U, ...);\n";
+            ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], "
+                    << t << " data[], uint tensorOperands = 0U, ...);\n";
+        }
+        ostream << "uint tensorSizeARM(readonly writeonly tensorARM t, uint dim);\n";
+        commonBuiltins.append(ostream.str());
     }
     }
 
 
     if (profile != EEsProfile && version >= 450) {
     if (profile != EEsProfile && version >= 450) {
@@ -8328,6 +8351,12 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
         snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits);
         snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits);
         s.append(builtInConstant);
         s.append(builtInConstant);
 
 
+        // GL_ARM_tensors operands.
+        snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsNonTemporalARM = 0x1U;");
+        s.append(builtInConstant);
+        snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsOutOfBoundsValueARM = 0x2U;");
+        s.append(builtInConstant);
+
         s.append("\n");
         s.append("\n");
     }
     }
 
 
@@ -9749,6 +9778,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setFunctionExtensions("setTensorViewClipNV",            1, &E_GL_NV_cooperative_matrix2);
             symbolTable.setFunctionExtensions("setTensorViewClipNV",            1, &E_GL_NV_cooperative_matrix2);
         }
         }
 
 
+        {
+            symbolTable.setFunctionExtensions("tensorReadARM",   1, &E_GL_ARM_tensors);
+            symbolTable.setFunctionExtensions("tensorWriteARM",  1, &E_GL_ARM_tensors);
+            symbolTable.setFunctionExtensions("tensorSizeARM",   1, &E_GL_ARM_tensors);
+        }
+
         {
         {
             symbolTable.setFunctionExtensions("coopVecMatMulNV",                    1, &E_GL_NV_cooperative_vector);
             symbolTable.setFunctionExtensions("coopVecMatMulNV",                    1, &E_GL_NV_cooperative_vector);
             symbolTable.setFunctionExtensions("coopVecMatMulAddNV",                 1, &E_GL_NV_cooperative_vector);
             symbolTable.setFunctionExtensions("coopVecMatMulAddNV",                 1, &E_GL_NV_cooperative_vector);
@@ -11065,6 +11100,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
         symbolTable.relateToOperator("setTensorViewStrideNV",        EOpTensorViewSetStrideNV);
         symbolTable.relateToOperator("setTensorViewStrideNV",        EOpTensorViewSetStrideNV);
         symbolTable.relateToOperator("setTensorViewClipNV",          EOpTensorViewSetClipNV);
         symbolTable.relateToOperator("setTensorViewClipNV",          EOpTensorViewSetClipNV);
 
 
+        symbolTable.relateToOperator("tensorReadARM",                EOpTensorReadARM);
+        symbolTable.relateToOperator("tensorWriteARM",               EOpTensorWriteARM);
+        symbolTable.relateToOperator("tensorSizeARM",                EOpTensorSizeARM);
+
         if (profile != EEsProfile && version >= 460) {
         if (profile != EEsProfile && version >= 460) {
             symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV);
             symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV);
             symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV);
             symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV);

+ 122 - 4
glslang/MachineIndependent/ParseHelper.cpp

@@ -2103,7 +2103,7 @@ void TParseContext::addInputArgumentConversions(const TFunction& function, TInte
         TIntermTyped* arg = function.getParamCount() == 1 ? arguments->getAsTyped() : (aggregate ? aggregate->getSequence()[i]->getAsTyped() : arguments->getAsTyped());
         TIntermTyped* arg = function.getParamCount() == 1 ? arguments->getAsTyped() : (aggregate ? aggregate->getSequence()[i]->getAsTyped() : arguments->getAsTyped());
         if (*function[i].type != arg->getType()) {
         if (*function[i].type != arg->getType()) {
             if (function[i].type->getQualifier().isParamInput() &&
             if (function[i].type->getQualifier().isParamInput() &&
-               !function[i].type->isCoopMat()) {
+               !function[i].type->isCoopMat() && !function[i].type->isTensorARM()) {
                 // In-qualified arguments just need an extra node added above the argument to
                 // In-qualified arguments just need an extra node added above the argument to
                 // convert to the correct type.
                 // convert to the correct type.
                 arg = intermediate.addConversion(EOpFunctionCall, *function[i].type, arg);
                 arg = intermediate.addConversion(EOpFunctionCall, *function[i].type, arg);
@@ -3200,6 +3200,76 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
         }
         }
         break;
         break;
     }
     }
+    case EOpTensorReadARM:
+    case EOpTensorWriteARM:
+    {
+        const TType &tensorType = (*argp)[0]->getAsTyped()->getType();
+
+        // Check that coordinates argument length matches rank of tensor argument.
+        int tensorRank = tensorType.getTensorRankARM();
+        const TArraySizes *coordArgArrayTy = (*argp)[1]->getAsTyped()->getType().getArraySizes();
+        assert(coordArgArrayTy->getNumDims() == 1 && "expecting 1D coordinate array");
+        if (coordArgArrayTy->getDimSize(0) != tensorRank) {
+            error(loc, "number of coordinates does not match tensor rank", "coord", "");
+        }
+
+        // Check that tensor element type matches data argument.
+        TBasicType eltTy = tensorType.getBasicType();
+        TBasicType argTy = (*argp)[2]->getAsTyped()->getType().getBasicType();
+        if (eltTy != argTy) {
+            error(loc, "", "data", "data argument type (%s) does not match tensor element type (%s)",
+                  TType::getBasicString(argTy), TType::getBasicString(eltTy));
+        }
+
+        // Check optional tensor operands.
+        if (argp->size() > 3) {
+            const TIntermConstantUnion* opArg = (*argp)[3]->getAsConstantUnion();
+            if (!opArg) {
+                error(loc, "tensor operands argument must be a constant integral expression", "tensorOps", "");
+            }
+            const unsigned int ops = opArg ? opArg->getConstArray()[0].getUConst() : 0;
+            const int gl_TensorOperandsOutOfBoundsValueARM = 0x2;
+            if (ops & gl_TensorOperandsOutOfBoundsValueARM) {
+                // Out-of-bounds values can only be used with reads.
+                if (callNode.getOp() != EOpTensorReadARM) {
+                    error(loc, "out-of-bounds value is only valid with tensorReadARM", "tensorOps", "");
+                }
+                // Check that an out-of-bounds value is present.
+                if (argp->size() == 4) {
+                    error(loc, "expecting out-of-bounds value as next argument", "tensorOps", "");
+                } else {
+                    // Check constantness of out-of-bounds value.
+                    const TIntermConstantUnion* oobArg = (*argp)[4]->getAsConstantUnion();
+                    if (!oobArg) {
+                        error(loc, "argument following gl_TensorOperandsOutOfBoundsValueARM must be constant", "vararg",
+                              "");
+                    } else if (oobArg->getType().getBasicType() != tensorType.getBasicType()) {
+                        // The type of the OOB value does not match the tensor type.
+                        error(loc, "", "vararg",
+                            "out-of-bounds value type (%s) does not match tensor element type (%s)",
+                            TType::getBasicString(oobArg->getBasicType()), TType::getBasicString(eltTy));
+
+                    }
+                }
+            }
+        }
+        break;
+    }
+
+    case EOpTensorSizeARM:
+    {
+        unsigned int tensorRank = (*argp)[0]->getAsTyped()->getType().getTensorRankARM();
+        const TIntermConstantUnion *dimArg = (*argp)[1]->getAsConstantUnion();
+        if (dimArg) {
+            if (dimArg->getConstArray()[0].getUConst() >= tensorRank) {
+                error(loc, "dimension argument exceeds tensor rank", "dim", "");
+            }
+        } else {
+            error(loc, "dimension argument must be constant", "dim", "");
+        }
+        break;
+    }
+
     default:
     default:
         break;
         break;
     }
     }
@@ -4320,6 +4390,9 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const
                  error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
                  error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
         }
         }
     }
     }
+    else if (type.isTensorARM() && type.getQualifier().storage != EvqUniform) {
+        error(loc, "tensorARM types can only be used in uniform variables or function parameters:", "tensorARM", identifier.c_str());
+    }
 }
 }
 
 
 void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, const TString& identifier)
 void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, const TString& identifier)
@@ -4476,7 +4549,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
     if (! symbolTable.atGlobalLevel())
     if (! symbolTable.atGlobalLevel())
         return;
         return;
 
 
-    if (!(publicType.userDef && publicType.userDef->isReference()) && !parsingBuiltins) {
+    if (!(publicType.userDef && publicType.userDef->isReference()) && !publicType.isTensorARM() && !parsingBuiltins) {
         if (qualifier.isMemoryQualifierImageAndSSBOOnly() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) {
         if (qualifier.isMemoryQualifierImageAndSSBOOnly() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) {
             error(loc, "memory qualifiers cannot be used on this type", "", "");
             error(loc, "memory qualifiers cannot be used on this type", "", "");
         } else if (qualifier.isMemory() && (publicType.basicType != EbtSampler) && !publicType.qualifier.isUniformOrBuffer()) {
         } else if (qualifier.isMemory() && (publicType.basicType != EbtSampler) && !publicType.qualifier.isUniformOrBuffer()) {
@@ -4827,7 +4900,7 @@ TPrecisionQualifier TParseContext::getDefaultPrecision(TPublicType& publicType)
         return defaultPrecision[publicType.basicType];
         return defaultPrecision[publicType.basicType];
 }
 }
 
 
-void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier, bool isCoopMatOrVec)
+void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier, bool hasTypeParameter)
 {
 {
     // Built-in symbols are allowed some ambiguous precisions, to be pinned down
     // Built-in symbols are allowed some ambiguous precisions, to be pinned down
     // later by context.
     // later by context.
@@ -4837,7 +4910,7 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba
     if (baseType == EbtAtomicUint && qualifier.precision != EpqNone && qualifier.precision != EpqHigh)
     if (baseType == EbtAtomicUint && qualifier.precision != EpqNone && qualifier.precision != EpqHigh)
         error(loc, "atomic counters can only be highp", "atomic_uint", "");
         error(loc, "atomic counters can only be highp", "atomic_uint", "");
 
 
-    if (isCoopMatOrVec)
+    if (hasTypeParameter)
         return;
         return;
 
 
     if (baseType == EbtFloat || baseType == EbtUint || baseType == EbtInt || baseType == EbtSampler || baseType == EbtAtomicUint) {
     if (baseType == EbtFloat || baseType == EbtUint || baseType == EbtInt || baseType == EbtSampler || baseType == EbtAtomicUint) {
@@ -7755,6 +7828,8 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu
             return from.sameCoopMatBaseType(to);
             return from.sameCoopMatBaseType(to);
         if (from.isCoopVecNV() && to.isCoopVecNV())
         if (from.isCoopVecNV() && to.isCoopVecNV())
             return from.sameCoopVecBaseType(to);
             return from.sameCoopVecBaseType(to);
+        if (from.isTensorARM() && to.isTensorARM())
+            return from.sameTensorBaseTypeARM(to);
         return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType());
         return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType());
     };
     };
 
 
@@ -7867,6 +7942,8 @@ const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc,
             return from.sameCoopMatBaseType(to);
             return from.sameCoopMatBaseType(to);
         if (from.isCoopVecNV() && to.isCoopVecNV())
         if (from.isCoopVecNV() && to.isCoopVecNV())
             return from.sameCoopVecBaseType(to);
             return from.sameCoopVecBaseType(to);
+        if (from.isTensorARM() && to.isTensorARM())
+            return from.sameTensorBaseTypeARM(to);
         return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType());
         return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType());
     };
     };
 
 
@@ -8073,6 +8150,24 @@ void TParseContext::typeParametersCheck(const TSourceLoc& loc, const TPublicType
             }
             }
         }
         }
     }
     }
+    if (publicType.isTensorARM()) {
+        if (publicType.typeParameters == nullptr) {
+            error(loc, "tensor type is missing type parameters", "", "");
+            return;
+        }
+        if (publicType.typeParameters->arraySizes == nullptr) {
+            error(loc, "tensor type is missing rank information", "", "");
+            return;
+        }
+        if (publicType.typeParameters->arraySizes->getNumDims() != 1) {
+            error(loc, "tensor type requires exactly 1 rank specifier", "", "");
+            return;
+        }
+        if (publicType.typeParameters->arraySizes->getDimSize(0) < 1) {
+            error(loc, "tensor rank must be greater than or equal to 1", "", "");
+            return;
+        }
+    }
 }
 }
 
 
 bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType,
 bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType,
@@ -8495,6 +8590,29 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
         } else if (publicType.typeParameters->arraySizes->getDimSize(0) <= 0) {
         } else if (publicType.typeParameters->arraySizes->getDimSize(0) <= 0) {
             error(loc, "expected positive number of components", identifier.c_str(), "");
             error(loc, "expected positive number of components", identifier.c_str(), "");
         }
         }
+    } else if (type.isTensorARM()) {
+        intermediate.setUseStorageBuffer();
+
+        if (!publicType.typeParameters || publicType.typeParameters->arraySizes->getNumDims() != 1) {
+            error(loc, "expected two type parameters", identifier.c_str(), "");
+        }
+        if (publicType.typeParameters) {
+            if (publicType.typeParameters->basicType != EbtBool &&
+                publicType.typeParameters->basicType != EbtInt8 &&
+                publicType.typeParameters->basicType != EbtInt16 &&
+                publicType.typeParameters->basicType != EbtInt &&
+                publicType.typeParameters->basicType != EbtInt64 &&
+                publicType.typeParameters->basicType != EbtUint8 &&
+                publicType.typeParameters->basicType != EbtUint16 &&
+                publicType.typeParameters->basicType != EbtUint &&
+                publicType.typeParameters->basicType != EbtUint64 &&
+                publicType.typeParameters->basicType != EbtFloat16 &&
+                publicType.typeParameters->basicType != EbtFloat &&
+                publicType.typeParameters->basicType != EbtDouble) {
+                error(loc, "expected bool, integer or floating point type parameter", identifier.c_str(), "");
+            }
+
+        }
     } else {
     } else {
         if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() != 0) {
         if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() != 0) {
             error(loc, "unexpected type parameters", identifier.c_str(), "");
             error(loc, "unexpected type parameters", identifier.c_str(), "");

+ 1 - 1
glslang/MachineIndependent/ParseHelper.h

@@ -407,7 +407,7 @@ public:
     void setDefaultPrecision(const TSourceLoc&, TPublicType&, TPrecisionQualifier);
     void setDefaultPrecision(const TSourceLoc&, TPublicType&, TPrecisionQualifier);
     int computeSamplerTypeIndex(TSampler&);
     int computeSamplerTypeIndex(TSampler&);
     TPrecisionQualifier getDefaultPrecision(TPublicType&);
     TPrecisionQualifier getDefaultPrecision(TPublicType&);
-    void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool isCoopMatOrVec);
+    void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool hasTypeParameter);
     void parameterTypeCheck(const TSourceLoc&, TStorageQualifier qualifier, const TType& type);
     void parameterTypeCheck(const TSourceLoc&, TStorageQualifier qualifier, const TType& type);
     bool containsFieldWithBasicType(const TType& type ,TBasicType basicType);
     bool containsFieldWithBasicType(const TType& type ,TBasicType basicType);
     TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&);
     TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&);

+ 8 - 0
glslang/MachineIndependent/Scan.cpp

@@ -769,6 +769,8 @@ const std::unordered_map<const char*, int, str_hash, str_eq> KeywordMap {
     {"hitObjectNV",HITOBJECTNV},
     {"hitObjectNV",HITOBJECTNV},
     {"hitObjectAttributeNV",HITOBJECTATTRNV},
     {"hitObjectAttributeNV",HITOBJECTATTRNV},
 
 
+    {"tensorARM",TENSORARM},
+
     {"__function",FUNCTION},
     {"__function",FUNCTION},
     {"tensorLayoutNV",TENSORLAYOUTNV},
     {"tensorLayoutNV",TENSORLAYOUTNV},
     {"tensorViewNV",TENSORVIEWNV},
     {"tensorViewNV",TENSORVIEWNV},
@@ -1856,6 +1858,12 @@ int TScanContext::tokenizeIdentifier()
             parseContext.extensionTurnedOn(E_GL_NV_integer_cooperative_matrix))
             parseContext.extensionTurnedOn(E_GL_NV_integer_cooperative_matrix))
             return keyword;
             return keyword;
         return identifierOrType();
         return identifierOrType();
+    case TENSORARM:
+        afterType = true;
+        if (parseContext.symbolTable.atBuiltInLevel() ||
+            parseContext.extensionTurnedOn(E_GL_ARM_tensors))
+            return keyword;
+        return identifierOrType();
 
 
     case COOPMAT:
     case COOPMAT:
         afterType = true;
         afterType = true;

+ 3 - 1
glslang/MachineIndependent/SymbolTable.cpp

@@ -55,7 +55,9 @@ namespace glslang {
 //
 //
 void TType::buildMangledName(TString& mangledName) const
 void TType::buildMangledName(TString& mangledName) const
 {
 {
-    if (isMatrix())
+    if (isTensorARM())
+        mangledName += 'T';
+    else if (isMatrix())
         mangledName += 'm';
         mangledName += 'm';
     else if (isVector())
     else if (isVector())
         mangledName += 'v';
         mangledName += 'v';

+ 9 - 0
glslang/MachineIndependent/Versions.cpp

@@ -319,6 +319,7 @@ void TParseVersions::initializeExtensionBehavior()
 
 
     // ARM
     // ARM
     extensionBehavior[E_GL_ARM_shader_core_builtins]                 = EBhDisable;
     extensionBehavior[E_GL_ARM_shader_core_builtins]                 = EBhDisable;
+    extensionBehavior[E_GL_ARM_tensors]                              = EBhDisable;
 
 
     // QCOM
     // QCOM
     extensionBehavior[E_GL_QCOM_image_processing]                    = EBhDisable;
     extensionBehavior[E_GL_QCOM_image_processing]                    = EBhDisable;
@@ -1487,6 +1488,14 @@ void TParseVersions::intattachmentCheck(const TSourceLoc& loc, const char* op, b
     }
     }
 }
 }
 
 
+void TParseVersions::tensorCheckARM(const TSourceLoc& loc, const char* op, bool builtIn)
+{
+    if (!builtIn) {
+        const char* const extensions[] = {E_GL_ARM_tensors};
+        requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
+    }
+}
+
 // Call for any operation removed because SPIR-V is in use.
 // Call for any operation removed because SPIR-V is in use.
 void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
 void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
 {
 {

+ 1 - 0
glslang/MachineIndependent/Versions.h

@@ -293,6 +293,7 @@ const char* const E_GL_NV_gpu_shader5                           = "GL_NV_gpu_sha
 
 
 // ARM
 // ARM
 const char* const E_GL_ARM_shader_core_builtins                 = "GL_ARM_shader_core_builtins";
 const char* const E_GL_ARM_shader_core_builtins                 = "GL_ARM_shader_core_builtins";
+const char* const E_GL_ARM_tensors                              = "GL_ARM_tensors";
 
 
 // Arrays of extensions for the above viewportEXTs duplications
 // Arrays of extensions for the above viewportEXTs duplications
 
 

+ 15 - 8
glslang/MachineIndependent/glslang.y

@@ -184,6 +184,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
 %token <lex> COOPVECNV
 %token <lex> COOPVECNV
 %token <lex> HITOBJECTNV HITOBJECTATTRNV
 %token <lex> HITOBJECTNV HITOBJECTATTRNV
 %token <lex> TENSORLAYOUTNV TENSORVIEWNV
 %token <lex> TENSORLAYOUTNV TENSORVIEWNV
+%token <lex> TENSORARM
 
 
 // combined image/sampler
 // combined image/sampler
 %token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
 %token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
@@ -1118,7 +1119,7 @@ parameter_declaration
         $$ = $2;
         $$ = $2;
         if ($1.qualifier.precision != EpqNone)
         if ($1.qualifier.precision != EpqNone)
             $$.param.type->getQualifier().precision = $1.qualifier.precision;
             $$.param.type->getQualifier().precision = $1.qualifier.precision;
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMatOrVec());
+        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter());
 
 
         parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
         parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
         parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
         parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@@ -1130,7 +1131,7 @@ parameter_declaration
 
 
         parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
         parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
         parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
         parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMatOrVec());
+        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter());
     }
     }
     //
     //
     // Without name
     // Without name
@@ -1139,7 +1140,7 @@ parameter_declaration
         $$ = $2;
         $$ = $2;
         if ($1.qualifier.precision != EpqNone)
         if ($1.qualifier.precision != EpqNone)
             $$.param.type->getQualifier().precision = $1.qualifier.precision;
             $$.param.type->getQualifier().precision = $1.qualifier.precision;
-        parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMatOrVec());
+        parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter());
 
 
         parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
         parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
         parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
         parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@@ -1150,7 +1151,7 @@ parameter_declaration
 
 
         parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
         parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
         parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
         parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMatOrVec());
+        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->hasTypeParameter());
     }
     }
     ;
     ;
 
 
@@ -1225,7 +1226,7 @@ fully_specified_type
             parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
             parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
             parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
             parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
         }
         }
-        parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.isCoopmatOrvec());
+        parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.hasTypeParameter());
     }
     }
     | type_qualifier type_specifier  {
     | type_qualifier type_specifier  {
         parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
         parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
@@ -1242,7 +1243,7 @@ fully_specified_type
         parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
         parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
         $2.shaderQualifiers.merge($1.shaderQualifiers);
         $2.shaderQualifiers.merge($1.shaderQualifiers);
         parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
         parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
-        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmatOrvec());
+        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.hasTypeParameter());
 
 
         $$ = $2;
         $$ = $2;
 
 
@@ -3642,6 +3643,12 @@ type_specifier_nonarray
         $$.basicType = EbtCoopvecNV;
         $$.basicType = EbtCoopvecNV;
         $$.coopvecNV = true;
         $$.coopvecNV = true;
     }
     }
+    | TENSORARM {
+        parseContext.tensorCheckARM($1.loc, "tensorARM", parseContext.symbolTable.atBuiltInLevel());
+        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+        $$.tensorRankARM = 1; // placeholder value
+        $$.basicType = EbtTensorARM;
+    }
     | spirv_type_specifier {
     | spirv_type_specifier {
         parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
         parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
         $$ = $1;
         $$ = $1;
@@ -3743,7 +3750,7 @@ struct_declaration
         $$ = $2;
         $$ = $2;
 
 
         parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
         parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
-        parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.isCoopmatOrvec());
+        parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.hasTypeParameter());
 
 
         for (unsigned int i = 0; i < $$->size(); ++i) {
         for (unsigned int i = 0; i < $$->size(); ++i) {
             TType type($1);
             TType type($1);
@@ -3767,7 +3774,7 @@ struct_declaration
         parseContext.memberQualifierCheck($1);
         parseContext.memberQualifierCheck($1);
         parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
         parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
         parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
         parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
-        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmatOrvec());
+        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.hasTypeParameter());
 
 
         for (unsigned int i = 0; i < $$->size(); ++i) {
         for (unsigned int i = 0; i < $$->size(); ++i) {
             TType type($2);
             TType type($2);

File diff suppressed because it is too large
+ 512 - 510
glslang/MachineIndependent/glslang_tab.cpp


+ 300 - 299
glslang/MachineIndependent/glslang_tab.cpp.h

@@ -235,304 +235,305 @@ extern int yydebug;
     HITOBJECTATTRNV = 436,         /* HITOBJECTATTRNV  */
     HITOBJECTATTRNV = 436,         /* HITOBJECTATTRNV  */
     TENSORLAYOUTNV = 437,          /* TENSORLAYOUTNV  */
     TENSORLAYOUTNV = 437,          /* TENSORLAYOUTNV  */
     TENSORVIEWNV = 438,            /* TENSORVIEWNV  */
     TENSORVIEWNV = 438,            /* TENSORVIEWNV  */
-    SAMPLERCUBEARRAY = 439,        /* SAMPLERCUBEARRAY  */
-    SAMPLERCUBEARRAYSHADOW = 440,  /* SAMPLERCUBEARRAYSHADOW  */
-    ISAMPLERCUBEARRAY = 441,       /* ISAMPLERCUBEARRAY  */
-    USAMPLERCUBEARRAY = 442,       /* USAMPLERCUBEARRAY  */
-    SAMPLER1D = 443,               /* SAMPLER1D  */
-    SAMPLER1DARRAY = 444,          /* SAMPLER1DARRAY  */
-    SAMPLER1DARRAYSHADOW = 445,    /* SAMPLER1DARRAYSHADOW  */
-    ISAMPLER1D = 446,              /* ISAMPLER1D  */
-    SAMPLER1DSHADOW = 447,         /* SAMPLER1DSHADOW  */
-    SAMPLER2DRECT = 448,           /* SAMPLER2DRECT  */
-    SAMPLER2DRECTSHADOW = 449,     /* SAMPLER2DRECTSHADOW  */
-    ISAMPLER2DRECT = 450,          /* ISAMPLER2DRECT  */
-    USAMPLER2DRECT = 451,          /* USAMPLER2DRECT  */
-    SAMPLERBUFFER = 452,           /* SAMPLERBUFFER  */
-    ISAMPLERBUFFER = 453,          /* ISAMPLERBUFFER  */
-    USAMPLERBUFFER = 454,          /* USAMPLERBUFFER  */
-    SAMPLER2DMS = 455,             /* SAMPLER2DMS  */
-    ISAMPLER2DMS = 456,            /* ISAMPLER2DMS  */
-    USAMPLER2DMS = 457,            /* USAMPLER2DMS  */
-    SAMPLER2DMSARRAY = 458,        /* SAMPLER2DMSARRAY  */
-    ISAMPLER2DMSARRAY = 459,       /* ISAMPLER2DMSARRAY  */
-    USAMPLER2DMSARRAY = 460,       /* USAMPLER2DMSARRAY  */
-    SAMPLEREXTERNALOES = 461,      /* SAMPLEREXTERNALOES  */
-    SAMPLEREXTERNAL2DY2YEXT = 462, /* SAMPLEREXTERNAL2DY2YEXT  */
-    ISAMPLER1DARRAY = 463,         /* ISAMPLER1DARRAY  */
-    USAMPLER1D = 464,              /* USAMPLER1D  */
-    USAMPLER1DARRAY = 465,         /* USAMPLER1DARRAY  */
-    F16SAMPLER1D = 466,            /* F16SAMPLER1D  */
-    F16SAMPLER2D = 467,            /* F16SAMPLER2D  */
-    F16SAMPLER3D = 468,            /* F16SAMPLER3D  */
-    F16SAMPLER2DRECT = 469,        /* F16SAMPLER2DRECT  */
-    F16SAMPLERCUBE = 470,          /* F16SAMPLERCUBE  */
-    F16SAMPLER1DARRAY = 471,       /* F16SAMPLER1DARRAY  */
-    F16SAMPLER2DARRAY = 472,       /* F16SAMPLER2DARRAY  */
-    F16SAMPLERCUBEARRAY = 473,     /* F16SAMPLERCUBEARRAY  */
-    F16SAMPLERBUFFER = 474,        /* F16SAMPLERBUFFER  */
-    F16SAMPLER2DMS = 475,          /* F16SAMPLER2DMS  */
-    F16SAMPLER2DMSARRAY = 476,     /* F16SAMPLER2DMSARRAY  */
-    F16SAMPLER1DSHADOW = 477,      /* F16SAMPLER1DSHADOW  */
-    F16SAMPLER2DSHADOW = 478,      /* F16SAMPLER2DSHADOW  */
-    F16SAMPLER1DARRAYSHADOW = 479, /* F16SAMPLER1DARRAYSHADOW  */
-    F16SAMPLER2DARRAYSHADOW = 480, /* F16SAMPLER2DARRAYSHADOW  */
-    F16SAMPLER2DRECTSHADOW = 481,  /* F16SAMPLER2DRECTSHADOW  */
-    F16SAMPLERCUBESHADOW = 482,    /* F16SAMPLERCUBESHADOW  */
-    F16SAMPLERCUBEARRAYSHADOW = 483, /* F16SAMPLERCUBEARRAYSHADOW  */
-    IMAGE1D = 484,                 /* IMAGE1D  */
-    IIMAGE1D = 485,                /* IIMAGE1D  */
-    UIMAGE1D = 486,                /* UIMAGE1D  */
-    IMAGE2D = 487,                 /* IMAGE2D  */
-    IIMAGE2D = 488,                /* IIMAGE2D  */
-    UIMAGE2D = 489,                /* UIMAGE2D  */
-    IMAGE3D = 490,                 /* IMAGE3D  */
-    IIMAGE3D = 491,                /* IIMAGE3D  */
-    UIMAGE3D = 492,                /* UIMAGE3D  */
-    IMAGE2DRECT = 493,             /* IMAGE2DRECT  */
-    IIMAGE2DRECT = 494,            /* IIMAGE2DRECT  */
-    UIMAGE2DRECT = 495,            /* UIMAGE2DRECT  */
-    IMAGECUBE = 496,               /* IMAGECUBE  */
-    IIMAGECUBE = 497,              /* IIMAGECUBE  */
-    UIMAGECUBE = 498,              /* UIMAGECUBE  */
-    IMAGEBUFFER = 499,             /* IMAGEBUFFER  */
-    IIMAGEBUFFER = 500,            /* IIMAGEBUFFER  */
-    UIMAGEBUFFER = 501,            /* UIMAGEBUFFER  */
-    IMAGE1DARRAY = 502,            /* IMAGE1DARRAY  */
-    IIMAGE1DARRAY = 503,           /* IIMAGE1DARRAY  */
-    UIMAGE1DARRAY = 504,           /* UIMAGE1DARRAY  */
-    IMAGE2DARRAY = 505,            /* IMAGE2DARRAY  */
-    IIMAGE2DARRAY = 506,           /* IIMAGE2DARRAY  */
-    UIMAGE2DARRAY = 507,           /* UIMAGE2DARRAY  */
-    IMAGECUBEARRAY = 508,          /* IMAGECUBEARRAY  */
-    IIMAGECUBEARRAY = 509,         /* IIMAGECUBEARRAY  */
-    UIMAGECUBEARRAY = 510,         /* UIMAGECUBEARRAY  */
-    IMAGE2DMS = 511,               /* IMAGE2DMS  */
-    IIMAGE2DMS = 512,              /* IIMAGE2DMS  */
-    UIMAGE2DMS = 513,              /* UIMAGE2DMS  */
-    IMAGE2DMSARRAY = 514,          /* IMAGE2DMSARRAY  */
-    IIMAGE2DMSARRAY = 515,         /* IIMAGE2DMSARRAY  */
-    UIMAGE2DMSARRAY = 516,         /* UIMAGE2DMSARRAY  */
-    F16IMAGE1D = 517,              /* F16IMAGE1D  */
-    F16IMAGE2D = 518,              /* F16IMAGE2D  */
-    F16IMAGE3D = 519,              /* F16IMAGE3D  */
-    F16IMAGE2DRECT = 520,          /* F16IMAGE2DRECT  */
-    F16IMAGECUBE = 521,            /* F16IMAGECUBE  */
-    F16IMAGE1DARRAY = 522,         /* F16IMAGE1DARRAY  */
-    F16IMAGE2DARRAY = 523,         /* F16IMAGE2DARRAY  */
-    F16IMAGECUBEARRAY = 524,       /* F16IMAGECUBEARRAY  */
-    F16IMAGEBUFFER = 525,          /* F16IMAGEBUFFER  */
-    F16IMAGE2DMS = 526,            /* F16IMAGE2DMS  */
-    F16IMAGE2DMSARRAY = 527,       /* F16IMAGE2DMSARRAY  */
-    I64IMAGE1D = 528,              /* I64IMAGE1D  */
-    U64IMAGE1D = 529,              /* U64IMAGE1D  */
-    I64IMAGE2D = 530,              /* I64IMAGE2D  */
-    U64IMAGE2D = 531,              /* U64IMAGE2D  */
-    I64IMAGE3D = 532,              /* I64IMAGE3D  */
-    U64IMAGE3D = 533,              /* U64IMAGE3D  */
-    I64IMAGE2DRECT = 534,          /* I64IMAGE2DRECT  */
-    U64IMAGE2DRECT = 535,          /* U64IMAGE2DRECT  */
-    I64IMAGECUBE = 536,            /* I64IMAGECUBE  */
-    U64IMAGECUBE = 537,            /* U64IMAGECUBE  */
-    I64IMAGEBUFFER = 538,          /* I64IMAGEBUFFER  */
-    U64IMAGEBUFFER = 539,          /* U64IMAGEBUFFER  */
-    I64IMAGE1DARRAY = 540,         /* I64IMAGE1DARRAY  */
-    U64IMAGE1DARRAY = 541,         /* U64IMAGE1DARRAY  */
-    I64IMAGE2DARRAY = 542,         /* I64IMAGE2DARRAY  */
-    U64IMAGE2DARRAY = 543,         /* U64IMAGE2DARRAY  */
-    I64IMAGECUBEARRAY = 544,       /* I64IMAGECUBEARRAY  */
-    U64IMAGECUBEARRAY = 545,       /* U64IMAGECUBEARRAY  */
-    I64IMAGE2DMS = 546,            /* I64IMAGE2DMS  */
-    U64IMAGE2DMS = 547,            /* U64IMAGE2DMS  */
-    I64IMAGE2DMSARRAY = 548,       /* I64IMAGE2DMSARRAY  */
-    U64IMAGE2DMSARRAY = 549,       /* U64IMAGE2DMSARRAY  */
-    TEXTURECUBEARRAY = 550,        /* TEXTURECUBEARRAY  */
-    ITEXTURECUBEARRAY = 551,       /* ITEXTURECUBEARRAY  */
-    UTEXTURECUBEARRAY = 552,       /* UTEXTURECUBEARRAY  */
-    TEXTURE1D = 553,               /* TEXTURE1D  */
-    ITEXTURE1D = 554,              /* ITEXTURE1D  */
-    UTEXTURE1D = 555,              /* UTEXTURE1D  */
-    TEXTURE1DARRAY = 556,          /* TEXTURE1DARRAY  */
-    ITEXTURE1DARRAY = 557,         /* ITEXTURE1DARRAY  */
-    UTEXTURE1DARRAY = 558,         /* UTEXTURE1DARRAY  */
-    TEXTURE2DRECT = 559,           /* TEXTURE2DRECT  */
-    ITEXTURE2DRECT = 560,          /* ITEXTURE2DRECT  */
-    UTEXTURE2DRECT = 561,          /* UTEXTURE2DRECT  */
-    TEXTUREBUFFER = 562,           /* TEXTUREBUFFER  */
-    ITEXTUREBUFFER = 563,          /* ITEXTUREBUFFER  */
-    UTEXTUREBUFFER = 564,          /* UTEXTUREBUFFER  */
-    TEXTURE2DMS = 565,             /* TEXTURE2DMS  */
-    ITEXTURE2DMS = 566,            /* ITEXTURE2DMS  */
-    UTEXTURE2DMS = 567,            /* UTEXTURE2DMS  */
-    TEXTURE2DMSARRAY = 568,        /* TEXTURE2DMSARRAY  */
-    ITEXTURE2DMSARRAY = 569,       /* ITEXTURE2DMSARRAY  */
-    UTEXTURE2DMSARRAY = 570,       /* UTEXTURE2DMSARRAY  */
-    F16TEXTURE1D = 571,            /* F16TEXTURE1D  */
-    F16TEXTURE2D = 572,            /* F16TEXTURE2D  */
-    F16TEXTURE3D = 573,            /* F16TEXTURE3D  */
-    F16TEXTURE2DRECT = 574,        /* F16TEXTURE2DRECT  */
-    F16TEXTURECUBE = 575,          /* F16TEXTURECUBE  */
-    F16TEXTURE1DARRAY = 576,       /* F16TEXTURE1DARRAY  */
-    F16TEXTURE2DARRAY = 577,       /* F16TEXTURE2DARRAY  */
-    F16TEXTURECUBEARRAY = 578,     /* F16TEXTURECUBEARRAY  */
-    F16TEXTUREBUFFER = 579,        /* F16TEXTUREBUFFER  */
-    F16TEXTURE2DMS = 580,          /* F16TEXTURE2DMS  */
-    F16TEXTURE2DMSARRAY = 581,     /* F16TEXTURE2DMSARRAY  */
-    SUBPASSINPUT = 582,            /* SUBPASSINPUT  */
-    SUBPASSINPUTMS = 583,          /* SUBPASSINPUTMS  */
-    ISUBPASSINPUT = 584,           /* ISUBPASSINPUT  */
-    ISUBPASSINPUTMS = 585,         /* ISUBPASSINPUTMS  */
-    USUBPASSINPUT = 586,           /* USUBPASSINPUT  */
-    USUBPASSINPUTMS = 587,         /* USUBPASSINPUTMS  */
-    F16SUBPASSINPUT = 588,         /* F16SUBPASSINPUT  */
-    F16SUBPASSINPUTMS = 589,       /* F16SUBPASSINPUTMS  */
-    SPIRV_INSTRUCTION = 590,       /* SPIRV_INSTRUCTION  */
-    SPIRV_EXECUTION_MODE = 591,    /* SPIRV_EXECUTION_MODE  */
-    SPIRV_EXECUTION_MODE_ID = 592, /* SPIRV_EXECUTION_MODE_ID  */
-    SPIRV_DECORATE = 593,          /* SPIRV_DECORATE  */
-    SPIRV_DECORATE_ID = 594,       /* SPIRV_DECORATE_ID  */
-    SPIRV_DECORATE_STRING = 595,   /* SPIRV_DECORATE_STRING  */
-    SPIRV_TYPE = 596,              /* SPIRV_TYPE  */
-    SPIRV_STORAGE_CLASS = 597,     /* SPIRV_STORAGE_CLASS  */
-    SPIRV_BY_REFERENCE = 598,      /* SPIRV_BY_REFERENCE  */
-    SPIRV_LITERAL = 599,           /* SPIRV_LITERAL  */
-    ATTACHMENTEXT = 600,           /* ATTACHMENTEXT  */
-    IATTACHMENTEXT = 601,          /* IATTACHMENTEXT  */
-    UATTACHMENTEXT = 602,          /* UATTACHMENTEXT  */
-    LEFT_OP = 603,                 /* LEFT_OP  */
-    RIGHT_OP = 604,                /* RIGHT_OP  */
-    INC_OP = 605,                  /* INC_OP  */
-    DEC_OP = 606,                  /* DEC_OP  */
-    LE_OP = 607,                   /* LE_OP  */
-    GE_OP = 608,                   /* GE_OP  */
-    EQ_OP = 609,                   /* EQ_OP  */
-    NE_OP = 610,                   /* NE_OP  */
-    AND_OP = 611,                  /* AND_OP  */
-    OR_OP = 612,                   /* OR_OP  */
-    XOR_OP = 613,                  /* XOR_OP  */
-    MUL_ASSIGN = 614,              /* MUL_ASSIGN  */
-    DIV_ASSIGN = 615,              /* DIV_ASSIGN  */
-    ADD_ASSIGN = 616,              /* ADD_ASSIGN  */
-    MOD_ASSIGN = 617,              /* MOD_ASSIGN  */
-    LEFT_ASSIGN = 618,             /* LEFT_ASSIGN  */
-    RIGHT_ASSIGN = 619,            /* RIGHT_ASSIGN  */
-    AND_ASSIGN = 620,              /* AND_ASSIGN  */
-    XOR_ASSIGN = 621,              /* XOR_ASSIGN  */
-    OR_ASSIGN = 622,               /* OR_ASSIGN  */
-    SUB_ASSIGN = 623,              /* SUB_ASSIGN  */
-    STRING_LITERAL = 624,          /* STRING_LITERAL  */
-    LEFT_PAREN = 625,              /* LEFT_PAREN  */
-    RIGHT_PAREN = 626,             /* RIGHT_PAREN  */
-    LEFT_BRACKET = 627,            /* LEFT_BRACKET  */
-    RIGHT_BRACKET = 628,           /* RIGHT_BRACKET  */
-    LEFT_BRACE = 629,              /* LEFT_BRACE  */
-    RIGHT_BRACE = 630,             /* RIGHT_BRACE  */
-    DOT = 631,                     /* DOT  */
-    COMMA = 632,                   /* COMMA  */
-    COLON = 633,                   /* COLON  */
-    EQUAL = 634,                   /* EQUAL  */
-    SEMICOLON = 635,               /* SEMICOLON  */
-    BANG = 636,                    /* BANG  */
-    DASH = 637,                    /* DASH  */
-    TILDE = 638,                   /* TILDE  */
-    PLUS = 639,                    /* PLUS  */
-    STAR = 640,                    /* STAR  */
-    SLASH = 641,                   /* SLASH  */
-    PERCENT = 642,                 /* PERCENT  */
-    LEFT_ANGLE = 643,              /* LEFT_ANGLE  */
-    RIGHT_ANGLE = 644,             /* RIGHT_ANGLE  */
-    VERTICAL_BAR = 645,            /* VERTICAL_BAR  */
-    CARET = 646,                   /* CARET  */
-    AMPERSAND = 647,               /* AMPERSAND  */
-    QUESTION = 648,                /* QUESTION  */
-    INVARIANT = 649,               /* INVARIANT  */
-    HIGH_PRECISION = 650,          /* HIGH_PRECISION  */
-    MEDIUM_PRECISION = 651,        /* MEDIUM_PRECISION  */
-    LOW_PRECISION = 652,           /* LOW_PRECISION  */
-    PRECISION = 653,               /* PRECISION  */
-    PACKED = 654,                  /* PACKED  */
-    RESOURCE = 655,                /* RESOURCE  */
-    SUPERP = 656,                  /* SUPERP  */
-    FLOATCONSTANT = 657,           /* FLOATCONSTANT  */
-    INTCONSTANT = 658,             /* INTCONSTANT  */
-    UINTCONSTANT = 659,            /* UINTCONSTANT  */
-    BOOLCONSTANT = 660,            /* BOOLCONSTANT  */
-    IDENTIFIER = 661,              /* IDENTIFIER  */
-    TYPE_NAME = 662,               /* TYPE_NAME  */
-    CENTROID = 663,                /* CENTROID  */
-    IN = 664,                      /* IN  */
-    OUT = 665,                     /* OUT  */
-    INOUT = 666,                   /* INOUT  */
-    STRUCT = 667,                  /* STRUCT  */
-    VOID = 668,                    /* VOID  */
-    WHILE = 669,                   /* WHILE  */
-    BREAK = 670,                   /* BREAK  */
-    CONTINUE = 671,                /* CONTINUE  */
-    DO = 672,                      /* DO  */
-    ELSE = 673,                    /* ELSE  */
-    FOR = 674,                     /* FOR  */
-    IF = 675,                      /* IF  */
-    DISCARD = 676,                 /* DISCARD  */
-    RETURN = 677,                  /* RETURN  */
-    SWITCH = 678,                  /* SWITCH  */
-    CASE = 679,                    /* CASE  */
-    DEFAULT = 680,                 /* DEFAULT  */
-    TERMINATE_INVOCATION = 681,    /* TERMINATE_INVOCATION  */
-    TERMINATE_RAY = 682,           /* TERMINATE_RAY  */
-    IGNORE_INTERSECTION = 683,     /* IGNORE_INTERSECTION  */
-    UNIFORM = 684,                 /* UNIFORM  */
-    SHARED = 685,                  /* SHARED  */
-    BUFFER = 686,                  /* BUFFER  */
-    TILEIMAGEEXT = 687,            /* TILEIMAGEEXT  */
-    FLAT = 688,                    /* FLAT  */
-    SMOOTH = 689,                  /* SMOOTH  */
-    LAYOUT = 690,                  /* LAYOUT  */
-    DOUBLECONSTANT = 691,          /* DOUBLECONSTANT  */
-    INT16CONSTANT = 692,           /* INT16CONSTANT  */
-    UINT16CONSTANT = 693,          /* UINT16CONSTANT  */
-    FLOAT16CONSTANT = 694,         /* FLOAT16CONSTANT  */
-    INT32CONSTANT = 695,           /* INT32CONSTANT  */
-    UINT32CONSTANT = 696,          /* UINT32CONSTANT  */
-    INT64CONSTANT = 697,           /* INT64CONSTANT  */
-    UINT64CONSTANT = 698,          /* UINT64CONSTANT  */
-    SUBROUTINE = 699,              /* SUBROUTINE  */
-    DEMOTE = 700,                  /* DEMOTE  */
-    FUNCTION = 701,                /* FUNCTION  */
-    PAYLOADNV = 702,               /* PAYLOADNV  */
-    PAYLOADINNV = 703,             /* PAYLOADINNV  */
-    HITATTRNV = 704,               /* HITATTRNV  */
-    CALLDATANV = 705,              /* CALLDATANV  */
-    CALLDATAINNV = 706,            /* CALLDATAINNV  */
-    PAYLOADEXT = 707,              /* PAYLOADEXT  */
-    PAYLOADINEXT = 708,            /* PAYLOADINEXT  */
-    HITATTREXT = 709,              /* HITATTREXT  */
-    CALLDATAEXT = 710,             /* CALLDATAEXT  */
-    CALLDATAINEXT = 711,           /* CALLDATAINEXT  */
-    PATCH = 712,                   /* PATCH  */
-    SAMPLE = 713,                  /* SAMPLE  */
-    NONUNIFORM = 714,              /* NONUNIFORM  */
-    COHERENT = 715,                /* COHERENT  */
-    VOLATILE = 716,                /* VOLATILE  */
-    RESTRICT = 717,                /* RESTRICT  */
-    READONLY = 718,                /* READONLY  */
-    WRITEONLY = 719,               /* WRITEONLY  */
-    NONTEMPORAL = 720,             /* NONTEMPORAL  */
-    DEVICECOHERENT = 721,          /* DEVICECOHERENT  */
-    QUEUEFAMILYCOHERENT = 722,     /* QUEUEFAMILYCOHERENT  */
-    WORKGROUPCOHERENT = 723,       /* WORKGROUPCOHERENT  */
-    SUBGROUPCOHERENT = 724,        /* SUBGROUPCOHERENT  */
-    NONPRIVATE = 725,              /* NONPRIVATE  */
-    SHADERCALLCOHERENT = 726,      /* SHADERCALLCOHERENT  */
-    NOPERSPECTIVE = 727,           /* NOPERSPECTIVE  */
-    EXPLICITINTERPAMD = 728,       /* EXPLICITINTERPAMD  */
-    PERVERTEXEXT = 729,            /* PERVERTEXEXT  */
-    PERVERTEXNV = 730,             /* PERVERTEXNV  */
-    PERPRIMITIVENV = 731,          /* PERPRIMITIVENV  */
-    PERVIEWNV = 732,               /* PERVIEWNV  */
-    PERTASKNV = 733,               /* PERTASKNV  */
-    PERPRIMITIVEEXT = 734,         /* PERPRIMITIVEEXT  */
-    TASKPAYLOADWORKGROUPEXT = 735, /* TASKPAYLOADWORKGROUPEXT  */
-    PRECISE = 736                  /* PRECISE  */
+    TENSORARM = 439,               /* TENSORARM  */
+    SAMPLERCUBEARRAY = 440,        /* SAMPLERCUBEARRAY  */
+    SAMPLERCUBEARRAYSHADOW = 441,  /* SAMPLERCUBEARRAYSHADOW  */
+    ISAMPLERCUBEARRAY = 442,       /* ISAMPLERCUBEARRAY  */
+    USAMPLERCUBEARRAY = 443,       /* USAMPLERCUBEARRAY  */
+    SAMPLER1D = 444,               /* SAMPLER1D  */
+    SAMPLER1DARRAY = 445,          /* SAMPLER1DARRAY  */
+    SAMPLER1DARRAYSHADOW = 446,    /* SAMPLER1DARRAYSHADOW  */
+    ISAMPLER1D = 447,              /* ISAMPLER1D  */
+    SAMPLER1DSHADOW = 448,         /* SAMPLER1DSHADOW  */
+    SAMPLER2DRECT = 449,           /* SAMPLER2DRECT  */
+    SAMPLER2DRECTSHADOW = 450,     /* SAMPLER2DRECTSHADOW  */
+    ISAMPLER2DRECT = 451,          /* ISAMPLER2DRECT  */
+    USAMPLER2DRECT = 452,          /* USAMPLER2DRECT  */
+    SAMPLERBUFFER = 453,           /* SAMPLERBUFFER  */
+    ISAMPLERBUFFER = 454,          /* ISAMPLERBUFFER  */
+    USAMPLERBUFFER = 455,          /* USAMPLERBUFFER  */
+    SAMPLER2DMS = 456,             /* SAMPLER2DMS  */
+    ISAMPLER2DMS = 457,            /* ISAMPLER2DMS  */
+    USAMPLER2DMS = 458,            /* USAMPLER2DMS  */
+    SAMPLER2DMSARRAY = 459,        /* SAMPLER2DMSARRAY  */
+    ISAMPLER2DMSARRAY = 460,       /* ISAMPLER2DMSARRAY  */
+    USAMPLER2DMSARRAY = 461,       /* USAMPLER2DMSARRAY  */
+    SAMPLEREXTERNALOES = 462,      /* SAMPLEREXTERNALOES  */
+    SAMPLEREXTERNAL2DY2YEXT = 463, /* SAMPLEREXTERNAL2DY2YEXT  */
+    ISAMPLER1DARRAY = 464,         /* ISAMPLER1DARRAY  */
+    USAMPLER1D = 465,              /* USAMPLER1D  */
+    USAMPLER1DARRAY = 466,         /* USAMPLER1DARRAY  */
+    F16SAMPLER1D = 467,            /* F16SAMPLER1D  */
+    F16SAMPLER2D = 468,            /* F16SAMPLER2D  */
+    F16SAMPLER3D = 469,            /* F16SAMPLER3D  */
+    F16SAMPLER2DRECT = 470,        /* F16SAMPLER2DRECT  */
+    F16SAMPLERCUBE = 471,          /* F16SAMPLERCUBE  */
+    F16SAMPLER1DARRAY = 472,       /* F16SAMPLER1DARRAY  */
+    F16SAMPLER2DARRAY = 473,       /* F16SAMPLER2DARRAY  */
+    F16SAMPLERCUBEARRAY = 474,     /* F16SAMPLERCUBEARRAY  */
+    F16SAMPLERBUFFER = 475,        /* F16SAMPLERBUFFER  */
+    F16SAMPLER2DMS = 476,          /* F16SAMPLER2DMS  */
+    F16SAMPLER2DMSARRAY = 477,     /* F16SAMPLER2DMSARRAY  */
+    F16SAMPLER1DSHADOW = 478,      /* F16SAMPLER1DSHADOW  */
+    F16SAMPLER2DSHADOW = 479,      /* F16SAMPLER2DSHADOW  */
+    F16SAMPLER1DARRAYSHADOW = 480, /* F16SAMPLER1DARRAYSHADOW  */
+    F16SAMPLER2DARRAYSHADOW = 481, /* F16SAMPLER2DARRAYSHADOW  */
+    F16SAMPLER2DRECTSHADOW = 482,  /* F16SAMPLER2DRECTSHADOW  */
+    F16SAMPLERCUBESHADOW = 483,    /* F16SAMPLERCUBESHADOW  */
+    F16SAMPLERCUBEARRAYSHADOW = 484, /* F16SAMPLERCUBEARRAYSHADOW  */
+    IMAGE1D = 485,                 /* IMAGE1D  */
+    IIMAGE1D = 486,                /* IIMAGE1D  */
+    UIMAGE1D = 487,                /* UIMAGE1D  */
+    IMAGE2D = 488,                 /* IMAGE2D  */
+    IIMAGE2D = 489,                /* IIMAGE2D  */
+    UIMAGE2D = 490,                /* UIMAGE2D  */
+    IMAGE3D = 491,                 /* IMAGE3D  */
+    IIMAGE3D = 492,                /* IIMAGE3D  */
+    UIMAGE3D = 493,                /* UIMAGE3D  */
+    IMAGE2DRECT = 494,             /* IMAGE2DRECT  */
+    IIMAGE2DRECT = 495,            /* IIMAGE2DRECT  */
+    UIMAGE2DRECT = 496,            /* UIMAGE2DRECT  */
+    IMAGECUBE = 497,               /* IMAGECUBE  */
+    IIMAGECUBE = 498,              /* IIMAGECUBE  */
+    UIMAGECUBE = 499,              /* UIMAGECUBE  */
+    IMAGEBUFFER = 500,             /* IMAGEBUFFER  */
+    IIMAGEBUFFER = 501,            /* IIMAGEBUFFER  */
+    UIMAGEBUFFER = 502,            /* UIMAGEBUFFER  */
+    IMAGE1DARRAY = 503,            /* IMAGE1DARRAY  */
+    IIMAGE1DARRAY = 504,           /* IIMAGE1DARRAY  */
+    UIMAGE1DARRAY = 505,           /* UIMAGE1DARRAY  */
+    IMAGE2DARRAY = 506,            /* IMAGE2DARRAY  */
+    IIMAGE2DARRAY = 507,           /* IIMAGE2DARRAY  */
+    UIMAGE2DARRAY = 508,           /* UIMAGE2DARRAY  */
+    IMAGECUBEARRAY = 509,          /* IMAGECUBEARRAY  */
+    IIMAGECUBEARRAY = 510,         /* IIMAGECUBEARRAY  */
+    UIMAGECUBEARRAY = 511,         /* UIMAGECUBEARRAY  */
+    IMAGE2DMS = 512,               /* IMAGE2DMS  */
+    IIMAGE2DMS = 513,              /* IIMAGE2DMS  */
+    UIMAGE2DMS = 514,              /* UIMAGE2DMS  */
+    IMAGE2DMSARRAY = 515,          /* IMAGE2DMSARRAY  */
+    IIMAGE2DMSARRAY = 516,         /* IIMAGE2DMSARRAY  */
+    UIMAGE2DMSARRAY = 517,         /* UIMAGE2DMSARRAY  */
+    F16IMAGE1D = 518,              /* F16IMAGE1D  */
+    F16IMAGE2D = 519,              /* F16IMAGE2D  */
+    F16IMAGE3D = 520,              /* F16IMAGE3D  */
+    F16IMAGE2DRECT = 521,          /* F16IMAGE2DRECT  */
+    F16IMAGECUBE = 522,            /* F16IMAGECUBE  */
+    F16IMAGE1DARRAY = 523,         /* F16IMAGE1DARRAY  */
+    F16IMAGE2DARRAY = 524,         /* F16IMAGE2DARRAY  */
+    F16IMAGECUBEARRAY = 525,       /* F16IMAGECUBEARRAY  */
+    F16IMAGEBUFFER = 526,          /* F16IMAGEBUFFER  */
+    F16IMAGE2DMS = 527,            /* F16IMAGE2DMS  */
+    F16IMAGE2DMSARRAY = 528,       /* F16IMAGE2DMSARRAY  */
+    I64IMAGE1D = 529,              /* I64IMAGE1D  */
+    U64IMAGE1D = 530,              /* U64IMAGE1D  */
+    I64IMAGE2D = 531,              /* I64IMAGE2D  */
+    U64IMAGE2D = 532,              /* U64IMAGE2D  */
+    I64IMAGE3D = 533,              /* I64IMAGE3D  */
+    U64IMAGE3D = 534,              /* U64IMAGE3D  */
+    I64IMAGE2DRECT = 535,          /* I64IMAGE2DRECT  */
+    U64IMAGE2DRECT = 536,          /* U64IMAGE2DRECT  */
+    I64IMAGECUBE = 537,            /* I64IMAGECUBE  */
+    U64IMAGECUBE = 538,            /* U64IMAGECUBE  */
+    I64IMAGEBUFFER = 539,          /* I64IMAGEBUFFER  */
+    U64IMAGEBUFFER = 540,          /* U64IMAGEBUFFER  */
+    I64IMAGE1DARRAY = 541,         /* I64IMAGE1DARRAY  */
+    U64IMAGE1DARRAY = 542,         /* U64IMAGE1DARRAY  */
+    I64IMAGE2DARRAY = 543,         /* I64IMAGE2DARRAY  */
+    U64IMAGE2DARRAY = 544,         /* U64IMAGE2DARRAY  */
+    I64IMAGECUBEARRAY = 545,       /* I64IMAGECUBEARRAY  */
+    U64IMAGECUBEARRAY = 546,       /* U64IMAGECUBEARRAY  */
+    I64IMAGE2DMS = 547,            /* I64IMAGE2DMS  */
+    U64IMAGE2DMS = 548,            /* U64IMAGE2DMS  */
+    I64IMAGE2DMSARRAY = 549,       /* I64IMAGE2DMSARRAY  */
+    U64IMAGE2DMSARRAY = 550,       /* U64IMAGE2DMSARRAY  */
+    TEXTURECUBEARRAY = 551,        /* TEXTURECUBEARRAY  */
+    ITEXTURECUBEARRAY = 552,       /* ITEXTURECUBEARRAY  */
+    UTEXTURECUBEARRAY = 553,       /* UTEXTURECUBEARRAY  */
+    TEXTURE1D = 554,               /* TEXTURE1D  */
+    ITEXTURE1D = 555,              /* ITEXTURE1D  */
+    UTEXTURE1D = 556,              /* UTEXTURE1D  */
+    TEXTURE1DARRAY = 557,          /* TEXTURE1DARRAY  */
+    ITEXTURE1DARRAY = 558,         /* ITEXTURE1DARRAY  */
+    UTEXTURE1DARRAY = 559,         /* UTEXTURE1DARRAY  */
+    TEXTURE2DRECT = 560,           /* TEXTURE2DRECT  */
+    ITEXTURE2DRECT = 561,          /* ITEXTURE2DRECT  */
+    UTEXTURE2DRECT = 562,          /* UTEXTURE2DRECT  */
+    TEXTUREBUFFER = 563,           /* TEXTUREBUFFER  */
+    ITEXTUREBUFFER = 564,          /* ITEXTUREBUFFER  */
+    UTEXTUREBUFFER = 565,          /* UTEXTUREBUFFER  */
+    TEXTURE2DMS = 566,             /* TEXTURE2DMS  */
+    ITEXTURE2DMS = 567,            /* ITEXTURE2DMS  */
+    UTEXTURE2DMS = 568,            /* UTEXTURE2DMS  */
+    TEXTURE2DMSARRAY = 569,        /* TEXTURE2DMSARRAY  */
+    ITEXTURE2DMSARRAY = 570,       /* ITEXTURE2DMSARRAY  */
+    UTEXTURE2DMSARRAY = 571,       /* UTEXTURE2DMSARRAY  */
+    F16TEXTURE1D = 572,            /* F16TEXTURE1D  */
+    F16TEXTURE2D = 573,            /* F16TEXTURE2D  */
+    F16TEXTURE3D = 574,            /* F16TEXTURE3D  */
+    F16TEXTURE2DRECT = 575,        /* F16TEXTURE2DRECT  */
+    F16TEXTURECUBE = 576,          /* F16TEXTURECUBE  */
+    F16TEXTURE1DARRAY = 577,       /* F16TEXTURE1DARRAY  */
+    F16TEXTURE2DARRAY = 578,       /* F16TEXTURE2DARRAY  */
+    F16TEXTURECUBEARRAY = 579,     /* F16TEXTURECUBEARRAY  */
+    F16TEXTUREBUFFER = 580,        /* F16TEXTUREBUFFER  */
+    F16TEXTURE2DMS = 581,          /* F16TEXTURE2DMS  */
+    F16TEXTURE2DMSARRAY = 582,     /* F16TEXTURE2DMSARRAY  */
+    SUBPASSINPUT = 583,            /* SUBPASSINPUT  */
+    SUBPASSINPUTMS = 584,          /* SUBPASSINPUTMS  */
+    ISUBPASSINPUT = 585,           /* ISUBPASSINPUT  */
+    ISUBPASSINPUTMS = 586,         /* ISUBPASSINPUTMS  */
+    USUBPASSINPUT = 587,           /* USUBPASSINPUT  */
+    USUBPASSINPUTMS = 588,         /* USUBPASSINPUTMS  */
+    F16SUBPASSINPUT = 589,         /* F16SUBPASSINPUT  */
+    F16SUBPASSINPUTMS = 590,       /* F16SUBPASSINPUTMS  */
+    SPIRV_INSTRUCTION = 591,       /* SPIRV_INSTRUCTION  */
+    SPIRV_EXECUTION_MODE = 592,    /* SPIRV_EXECUTION_MODE  */
+    SPIRV_EXECUTION_MODE_ID = 593, /* SPIRV_EXECUTION_MODE_ID  */
+    SPIRV_DECORATE = 594,          /* SPIRV_DECORATE  */
+    SPIRV_DECORATE_ID = 595,       /* SPIRV_DECORATE_ID  */
+    SPIRV_DECORATE_STRING = 596,   /* SPIRV_DECORATE_STRING  */
+    SPIRV_TYPE = 597,              /* SPIRV_TYPE  */
+    SPIRV_STORAGE_CLASS = 598,     /* SPIRV_STORAGE_CLASS  */
+    SPIRV_BY_REFERENCE = 599,      /* SPIRV_BY_REFERENCE  */
+    SPIRV_LITERAL = 600,           /* SPIRV_LITERAL  */
+    ATTACHMENTEXT = 601,           /* ATTACHMENTEXT  */
+    IATTACHMENTEXT = 602,          /* IATTACHMENTEXT  */
+    UATTACHMENTEXT = 603,          /* UATTACHMENTEXT  */
+    LEFT_OP = 604,                 /* LEFT_OP  */
+    RIGHT_OP = 605,                /* RIGHT_OP  */
+    INC_OP = 606,                  /* INC_OP  */
+    DEC_OP = 607,                  /* DEC_OP  */
+    LE_OP = 608,                   /* LE_OP  */
+    GE_OP = 609,                   /* GE_OP  */
+    EQ_OP = 610,                   /* EQ_OP  */
+    NE_OP = 611,                   /* NE_OP  */
+    AND_OP = 612,                  /* AND_OP  */
+    OR_OP = 613,                   /* OR_OP  */
+    XOR_OP = 614,                  /* XOR_OP  */
+    MUL_ASSIGN = 615,              /* MUL_ASSIGN  */
+    DIV_ASSIGN = 616,              /* DIV_ASSIGN  */
+    ADD_ASSIGN = 617,              /* ADD_ASSIGN  */
+    MOD_ASSIGN = 618,              /* MOD_ASSIGN  */
+    LEFT_ASSIGN = 619,             /* LEFT_ASSIGN  */
+    RIGHT_ASSIGN = 620,            /* RIGHT_ASSIGN  */
+    AND_ASSIGN = 621,              /* AND_ASSIGN  */
+    XOR_ASSIGN = 622,              /* XOR_ASSIGN  */
+    OR_ASSIGN = 623,               /* OR_ASSIGN  */
+    SUB_ASSIGN = 624,              /* SUB_ASSIGN  */
+    STRING_LITERAL = 625,          /* STRING_LITERAL  */
+    LEFT_PAREN = 626,              /* LEFT_PAREN  */
+    RIGHT_PAREN = 627,             /* RIGHT_PAREN  */
+    LEFT_BRACKET = 628,            /* LEFT_BRACKET  */
+    RIGHT_BRACKET = 629,           /* RIGHT_BRACKET  */
+    LEFT_BRACE = 630,              /* LEFT_BRACE  */
+    RIGHT_BRACE = 631,             /* RIGHT_BRACE  */
+    DOT = 632,                     /* DOT  */
+    COMMA = 633,                   /* COMMA  */
+    COLON = 634,                   /* COLON  */
+    EQUAL = 635,                   /* EQUAL  */
+    SEMICOLON = 636,               /* SEMICOLON  */
+    BANG = 637,                    /* BANG  */
+    DASH = 638,                    /* DASH  */
+    TILDE = 639,                   /* TILDE  */
+    PLUS = 640,                    /* PLUS  */
+    STAR = 641,                    /* STAR  */
+    SLASH = 642,                   /* SLASH  */
+    PERCENT = 643,                 /* PERCENT  */
+    LEFT_ANGLE = 644,              /* LEFT_ANGLE  */
+    RIGHT_ANGLE = 645,             /* RIGHT_ANGLE  */
+    VERTICAL_BAR = 646,            /* VERTICAL_BAR  */
+    CARET = 647,                   /* CARET  */
+    AMPERSAND = 648,               /* AMPERSAND  */
+    QUESTION = 649,                /* QUESTION  */
+    INVARIANT = 650,               /* INVARIANT  */
+    HIGH_PRECISION = 651,          /* HIGH_PRECISION  */
+    MEDIUM_PRECISION = 652,        /* MEDIUM_PRECISION  */
+    LOW_PRECISION = 653,           /* LOW_PRECISION  */
+    PRECISION = 654,               /* PRECISION  */
+    PACKED = 655,                  /* PACKED  */
+    RESOURCE = 656,                /* RESOURCE  */
+    SUPERP = 657,                  /* SUPERP  */
+    FLOATCONSTANT = 658,           /* FLOATCONSTANT  */
+    INTCONSTANT = 659,             /* INTCONSTANT  */
+    UINTCONSTANT = 660,            /* UINTCONSTANT  */
+    BOOLCONSTANT = 661,            /* BOOLCONSTANT  */
+    IDENTIFIER = 662,              /* IDENTIFIER  */
+    TYPE_NAME = 663,               /* TYPE_NAME  */
+    CENTROID = 664,                /* CENTROID  */
+    IN = 665,                      /* IN  */
+    OUT = 666,                     /* OUT  */
+    INOUT = 667,                   /* INOUT  */
+    STRUCT = 668,                  /* STRUCT  */
+    VOID = 669,                    /* VOID  */
+    WHILE = 670,                   /* WHILE  */
+    BREAK = 671,                   /* BREAK  */
+    CONTINUE = 672,                /* CONTINUE  */
+    DO = 673,                      /* DO  */
+    ELSE = 674,                    /* ELSE  */
+    FOR = 675,                     /* FOR  */
+    IF = 676,                      /* IF  */
+    DISCARD = 677,                 /* DISCARD  */
+    RETURN = 678,                  /* RETURN  */
+    SWITCH = 679,                  /* SWITCH  */
+    CASE = 680,                    /* CASE  */
+    DEFAULT = 681,                 /* DEFAULT  */
+    TERMINATE_INVOCATION = 682,    /* TERMINATE_INVOCATION  */
+    TERMINATE_RAY = 683,           /* TERMINATE_RAY  */
+    IGNORE_INTERSECTION = 684,     /* IGNORE_INTERSECTION  */
+    UNIFORM = 685,                 /* UNIFORM  */
+    SHARED = 686,                  /* SHARED  */
+    BUFFER = 687,                  /* BUFFER  */
+    TILEIMAGEEXT = 688,            /* TILEIMAGEEXT  */
+    FLAT = 689,                    /* FLAT  */
+    SMOOTH = 690,                  /* SMOOTH  */
+    LAYOUT = 691,                  /* LAYOUT  */
+    DOUBLECONSTANT = 692,          /* DOUBLECONSTANT  */
+    INT16CONSTANT = 693,           /* INT16CONSTANT  */
+    UINT16CONSTANT = 694,          /* UINT16CONSTANT  */
+    FLOAT16CONSTANT = 695,         /* FLOAT16CONSTANT  */
+    INT32CONSTANT = 696,           /* INT32CONSTANT  */
+    UINT32CONSTANT = 697,          /* UINT32CONSTANT  */
+    INT64CONSTANT = 698,           /* INT64CONSTANT  */
+    UINT64CONSTANT = 699,          /* UINT64CONSTANT  */
+    SUBROUTINE = 700,              /* SUBROUTINE  */
+    DEMOTE = 701,                  /* DEMOTE  */
+    FUNCTION = 702,                /* FUNCTION  */
+    PAYLOADNV = 703,               /* PAYLOADNV  */
+    PAYLOADINNV = 704,             /* PAYLOADINNV  */
+    HITATTRNV = 705,               /* HITATTRNV  */
+    CALLDATANV = 706,              /* CALLDATANV  */
+    CALLDATAINNV = 707,            /* CALLDATAINNV  */
+    PAYLOADEXT = 708,              /* PAYLOADEXT  */
+    PAYLOADINEXT = 709,            /* PAYLOADINEXT  */
+    HITATTREXT = 710,              /* HITATTREXT  */
+    CALLDATAEXT = 711,             /* CALLDATAEXT  */
+    CALLDATAINEXT = 712,           /* CALLDATAINEXT  */
+    PATCH = 713,                   /* PATCH  */
+    SAMPLE = 714,                  /* SAMPLE  */
+    NONUNIFORM = 715,              /* NONUNIFORM  */
+    COHERENT = 716,                /* COHERENT  */
+    VOLATILE = 717,                /* VOLATILE  */
+    RESTRICT = 718,                /* RESTRICT  */
+    READONLY = 719,                /* READONLY  */
+    WRITEONLY = 720,               /* WRITEONLY  */
+    NONTEMPORAL = 721,             /* NONTEMPORAL  */
+    DEVICECOHERENT = 722,          /* DEVICECOHERENT  */
+    QUEUEFAMILYCOHERENT = 723,     /* QUEUEFAMILYCOHERENT  */
+    WORKGROUPCOHERENT = 724,       /* WORKGROUPCOHERENT  */
+    SUBGROUPCOHERENT = 725,        /* SUBGROUPCOHERENT  */
+    NONPRIVATE = 726,              /* NONPRIVATE  */
+    SHADERCALLCOHERENT = 727,      /* SHADERCALLCOHERENT  */
+    NOPERSPECTIVE = 728,           /* NOPERSPECTIVE  */
+    EXPLICITINTERPAMD = 729,       /* EXPLICITINTERPAMD  */
+    PERVERTEXEXT = 730,            /* PERVERTEXEXT  */
+    PERVERTEXNV = 731,             /* PERVERTEXNV  */
+    PERPRIMITIVENV = 732,          /* PERPRIMITIVENV  */
+    PERVIEWNV = 733,               /* PERVIEWNV  */
+    PERTASKNV = 734,               /* PERTASKNV  */
+    PERPRIMITIVEEXT = 735,         /* PERPRIMITIVEEXT  */
+    TASKPAYLOADWORKGROUPEXT = 736, /* TASKPAYLOADWORKGROUPEXT  */
+    PRECISE = 737                  /* PRECISE  */
   };
   };
   typedef enum yytokentype yytoken_kind_t;
   typedef enum yytokentype yytoken_kind_t;
 #endif
 #endif
@@ -580,7 +581,7 @@ union YYSTYPE
         glslang::TTypeParameters* typeParameters;
         glslang::TTypeParameters* typeParameters;
     } interm;
     } interm;
 
 
-#line 584 "MachineIndependent/glslang_tab.cpp.h"
+#line 585 "MachineIndependent/glslang_tab.cpp.h"
 
 
 };
 };
 typedef union YYSTYPE YYSTYPE;
 typedef union YYSTYPE YYSTYPE;

+ 4 - 0
glslang/MachineIndependent/intermOut.cpp

@@ -983,6 +983,10 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
     case EOpCooperativeVectorOuterProductAccumulateNV: out.debug << "Cooperative vector outer product accumulate NV"; break;
     case EOpCooperativeVectorOuterProductAccumulateNV: out.debug << "Cooperative vector outer product accumulate NV"; break;
     case EOpCooperativeVectorReduceSumAccumulateNV: out.debug << "Cooperative vector reduce sum accumulate NV"; break;
     case EOpCooperativeVectorReduceSumAccumulateNV: out.debug << "Cooperative vector reduce sum accumulate NV"; break;
 
 
+    case EOpTensorReadARM:   out.debug << "Read from tensor";  break;
+    case EOpTensorWriteARM:  out.debug << "Write to tensor";  break;
+    case EOpTensorSizeARM:   out.debug << "Get tensor size";  break;
+
     case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
     case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
     case EOpDebugPrintf:  out.debug << "Debug printf";  break;
     case EOpDebugPrintf:  out.debug << "Debug printf";  break;
 
 

+ 1 - 0
glslang/MachineIndependent/parseVersions.h

@@ -127,6 +127,7 @@ public:
     virtual void tensorLayoutViewCheck(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void tensorLayoutViewCheck(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void coopvecCheck(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void coopvecCheck(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void intattachmentCheck(const TSourceLoc&, const char *op, bool builtIn = false);
     virtual void intattachmentCheck(const TSourceLoc&, const char *op, bool builtIn = false);
+    virtual void tensorCheckARM(const TSourceLoc&, const char *op, bool builtIn = false);
     bool relaxedErrors()    const { return (messages & EShMsgRelaxedErrors) != 0; }
     bool relaxedErrors()    const { return (messages & EShMsgRelaxedErrors) != 0; }
     bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
     bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
     bool isForwardCompatible() const { return forwardCompatible; }
     bool isForwardCompatible() const { return forwardCompatible; }

+ 14 - 0
gtests/Spv.FromFile.cpp

@@ -557,6 +557,20 @@ INSTANTIATE_TEST_SUITE_P(
         "spv.textureoffset_non_const.vert",
         "spv.textureoffset_non_const.vert",
         "spv.sparsetextureoffset_non_const.vert",
         "spv.sparsetextureoffset_non_const.vert",
         "spv.sparsetextureoffset_non_const_fail.vert",
         "spv.sparsetextureoffset_non_const_fail.vert",
+        "spv.tensorARM.access_qualifiers.comp",
+        "spv.tensorARM.all_accesses.comp",
+        "spv.tensorARM.array.comp",
+        "spv.tensorARM.declare.comp",
+        "spv.tensorARM.frag",
+        "spv.tensorARM.invalid_access.comp",
+        "spv.tensorARM.invalid_declare.comp",
+        "spv.tensorARM.invalid_operands.comp",
+        "spv.tensorARM.invalid_params.comp",
+        "spv.tensorARM.invalid_size.comp",
+        "spv.tensorARM.invalid_tensor_type.comp",
+        "spv.tensorARM.params.comp",
+        "spv.tensorARM.read.comp",
+        "spv.tensorARM.size.comp",
     })),
     })),
     FileNameAsCustomTestSuffix
     FileNameAsCustomTestSuffix
 );
 );

Some files were not shown because too many files changed in this diff