From 20788a4c5fd3cd22b5b1a00c8f53767f115fa400 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Tue, 17 Sep 2024 09:31:29 -0700 Subject: [PATCH] add support for SPV_INTEL_global_variable_host_access (#5786) --- source/binary.cpp | 1 + test/binary_to_text_test.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/source/binary.cpp b/source/binary.cpp index 19098aa13..772e98c0a 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -673,6 +673,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset, case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: case SPV_OPERAND_TYPE_FPENCODING: case SPV_OPERAND_TYPE_OPTIONAL_FPENCODING: + case SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER: case SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL: case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL: case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS: { diff --git a/test/binary_to_text_test.cpp b/test/binary_to_text_test.cpp index 4630a985f..ecf4d1e09 100644 --- a/test/binary_to_text_test.cpp +++ b/test/binary_to_text_test.cpp @@ -418,6 +418,16 @@ INSTANTIATE_TEST_SUITE_P( "OpDecorate %1 CacheControlStoreINTEL 3 StreamingINTEL\n", }))); +INSTANTIATE_TEST_SUITE_P( + HostAccessINTEL, RoundTripInstructionsTest, + Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0), + ::testing::ValuesIn(std::vector{ + "OpDecorate %1 HostAccessINTEL NoneINTEL \"none\"\n", + "OpDecorate %1 HostAccessINTEL ReadINTEL \"read\"\n", + "OpDecorate %1 HostAccessINTEL WriteINTEL \"write\"\n", + "OpDecorate %1 HostAccessINTEL ReadWriteINTEL \"readwrite\"\n", + }))); + using MaskSorting = TextToBinaryTest; TEST_F(MaskSorting, MasksAreSortedFromLSBToMSB) {