diff --git a/build_android.py b/build_android.py index 2bd7f5c8..e1b8c1e9 100755 --- a/build_android.py +++ b/build_android.py @@ -108,7 +108,9 @@ def install_android_cmake(): print "input: " if get_input(): print("installing android-cmake") - subprocess.call(['git', 'clone', 'https://github.com/taka-no-me/android-cmake']) + #subprocess.call(['git', 'clone', 'https://github.com/taka-no-me/android-cmake']) + # Use a newer fork of android-cmake which has been updated to support Clang. GCC is deprecated in newer NDKs and C11 atomics conformance doesn't build with NDK > 10. + subprocess.call(['git', 'clone', 'https://github.com/daewoong-jang/android-cmake']) args.android_cmake = os.path.join(args.src_dir,"android-cmake") else: exit() diff --git a/readme-spir-v-binaries.txt b/readme-spir-v-binaries.txt index 258a0dc7..ee09cd50 100644 --- a/readme-spir-v-binaries.txt +++ b/readme-spir-v-binaries.txt @@ -1,7 +1,6 @@ -To run the 2.2 conformance tests test suite for the C++ features you need -SPIR-V binaries. +To run the conformance tests you need SPIR-V binaries. -If you are using a conformance package then the binaries are included in the +If you are using a conformance package then the binaries are included in the package. If you are using conformance tests from gitlab repositories then the binaries need to be picked up from Khronos SVN URL mentioned below: @@ -39,4 +38,4 @@ Branch: opencl22 5. OpenCL ICD (with 2.2 support) OpenCL ICD Repository: https://gitlab.khronos.org/opencl/icd -Branch: dev_cl22 \ No newline at end of file +Branch: dev_cl22 diff --git a/test_common/harness/kernelHelpers.h b/test_common/harness/kernelHelpers.h index 5f4729c4..4c85d242 100644 --- a/test_common/harness/kernelHelpers.h +++ b/test_common/harness/kernelHelpers.h @@ -163,6 +163,13 @@ cl_device_fp_config get_default_rounding_mode( cl_device_id device ); return 0; \ } +#define PASSIVE_REQUIRE_FP16_SUPPORT(device) \ + if (!is_extension_available(device, "cl_khr_fp16")) \ + { \ + log_info("\n\tNote: device does not support fp16. Skipping test...\n"); \ + return 0; \ + } + /* Prints out the standard device header for all tests given the device to print for */ extern int printDeviceHeader( cl_device_id device ); diff --git a/test_conformance/CMakeLists.txt b/test_conformance/CMakeLists.txt index c4cd015a..5d382cfc 100644 --- a/test_conformance/CMakeLists.txt +++ b/test_conformance/CMakeLists.txt @@ -51,6 +51,7 @@ add_subdirectory( workgroups ) add_subdirectory( pipes ) add_subdirectory( device_timer ) add_subdirectory( clcpp ) +add_subdirectory( spirv_new ) add_subdirectory( spir ) set(CSV_FILES @@ -90,4 +91,4 @@ foreach(FILE ${PY_FILES}) endforeach() foreach(FILE test_conformance/${PY_FILES}) -endforeach() \ No newline at end of file +endforeach() diff --git a/test_conformance/build_script_binary.py b/test_conformance/build_script_binary.py new file mode 100644 index 00000000..276cfb92 --- /dev/null +++ b/test_conformance/build_script_binary.py @@ -0,0 +1,7 @@ +# Script parameters: +# 1 - input file +# 2 - output file +# 3 - architecture: 32 or 64 +# 4 - one of the strings: binary, source, spir_v +# 5 - OpenCL version: 12, 20 +# 6 - build options diff --git a/test_conformance/build_script_spirv.py b/test_conformance/build_script_spirv.py new file mode 100644 index 00000000..86193b33 --- /dev/null +++ b/test_conformance/build_script_spirv.py @@ -0,0 +1,43 @@ +# Script parameters: +# 1 - input file +# 2 - output file +# 3 - architecture: 32 or 64 +# 4 - one of the strings: binary, source, spir_v +# 5 - OpenCL version: 12, 20 +# 6 - build options + +import os +import sys + +if len(sys.argv)<5: + print 'Usage: "build_script_spirv.py [build_options]"' + exit(1) + +input_file = sys.argv[1] +output_file = sys.argv[2] +arch = sys.argv[3] +output_type = sys.argv[4] +ocl_version = sys.argv[5] +build_options = '' + +if len(sys.argv) == 5: + build_options = sys.argv[6] + +if arch == '32': + arch_string = '' + spir_arch = '__i386__' +else: + arch_string = '64' + spir_arch = '__x86_64__' + +if ocl_version == '20': + oclc_version = '200' + spir_version = '2.0' +else: + oclc_version = '120' + spir_version = '1.2' + +command = '%LLVMPATH%\\bin\\clang.exe -cc1 -include headers\\opencl_SPIR-' + spir_version + '.h -cl-std=CL' + spir_version +' -D__OPENCL_C_VERSION__=' + oclc_version + ' -fno-validate-pch -D__OPENCL_VERSION__=' + oclc_version + ' -x cl -cl-kernel-arg-info -O0 -emit-llvm-bc -triple spir' + arch_string + '-unknown-unknown -D' + spir_arch + ' -Dcl_khr_3d_image_writes -Dcl_khr_byte_addressable_store -Dcl_khr_d3d10_sharing -Dcl_khr_d3d11_sharing -Dcl_khr_depth_images -Dcl_khr_dx9_media_sharing -Dcl_khr_fp64 -Dcl_khr_global_int32_base_atomics -Dcl_khr_global_int32_extended_atomics -Dcl_khr_gl_depth_images -Dcl_khr_gl_event -Dcl_khr_gl_msaa_sharing -Dcl_khr_gl_sharing -Dcl_khr_icd -Dcl_khr_image2d_from_buffer -Dcl_khr_local_int32_base_atomics -Dcl_khr_local_int32_extended_atomics -Dcl_khr_mipmap_image -Dcl_khr_mipmap_image_writes -Dcl_khr_fp16 ' + build_options + ' -Dcl_khr_spir ' + input_file + ' -o intermediate.spir' +os.system(command) +command = '%LLVMPATH%\\bin\\llvm-spirv.exe intermediate.spir -o ' + output_file +os.system(command) \ No newline at end of file diff --git a/test_conformance/generate_spirv_offline.py b/test_conformance/generate_spirv_offline.py new file mode 100644 index 00000000..ea80c768 --- /dev/null +++ b/test_conformance/generate_spirv_offline.py @@ -0,0 +1,53 @@ +import sys +import os +import platform +import re +import string +import shutil +import traceback + +if len(sys.argv)<2: + print 'Usage: "generate_spirv_offline.py <32|64>"' + exit(1) + +input_dir = sys.argv[1] +arch = sys.argv[2] + +def generate_spirv(): + print "generating spirv" + ocl_version = '12'; + build_options = '' + + if os.path.exists(input_dir): + for root, dirs, files in os.walk(input_dir): + for file in files: + if file.endswith('.cl'): + options_file_name = file[:-2] + "options" + ocl_version = '12' + if os.path.exists(os.path.join(root, options_file_name)): + optFile = open (os.path.join(root, options_file_name), 'rU') + for line in optFile: + if re.search("-cl-std=CL2.0", line): + ocl_version = '20' + build_options = re.sub("-cl-std=CL2.0", "", line) + print build_options + input_string = os.path.join(root, file) + output_string = os.path.join(root, file[:-2]) + + command_line = ".\\build_script_spirv.py " + input_string + " " + output_string + "spv" + arch + " " + arch + " spir_v " + ocl_version + " \"" + build_options + " \"" + print command_line + os.system(command_line) + return 0 + +def main(): + try: + generate_spirv() + except Exception: + traceback.print_exc(file=sys.stdout) + sys.exit(0) + +if __name__ == "__main__": + main() + + + diff --git a/test_conformance/opencl_conformance_tests_21_full_spirv.csv b/test_conformance/opencl_conformance_tests_21_full_spirv.csv index cf4921f9..9e42957c 100644 --- a/test_conformance/opencl_conformance_tests_21_full_spirv.csv +++ b/test_conformance/opencl_conformance_tests_21_full_spirv.csv @@ -111,6 +111,7 @@ Workgroups,workgroups/test_workgroups -offlineCompiler spir_v cache . # OpenCL 2.1 tests ##################################### Device timer,device_timer/test_device_timer +SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin ######################################### # Extensions diff --git a/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv b/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv index 2415d745..db46e2ad 100644 --- a/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv +++ b/test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv @@ -106,4 +106,4 @@ SPIR,spir/test_spir Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps -Subgroups,subgroups/test_subgroups \ No newline at end of file +Subgroups,subgroups/test_subgroups diff --git a/test_conformance/opencl_conformance_tests_full.csv b/test_conformance/opencl_conformance_tests_full.csv index 380870e0..e2034020 100644 --- a/test_conformance/opencl_conformance_tests_full.csv +++ b/test_conformance/opencl_conformance_tests_full.csv @@ -107,6 +107,12 @@ Pipes,pipes/test_pipes SVM,SVM/test_SVM Workgroups,workgroups/test_workgroups +##################################### +# OpenCL 2.1 tests +##################################### +Device timer,device_timer/test_device_timer +SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin + ######################################### # Extensions ######################################### @@ -114,4 +120,4 @@ SPIR,spir/test_spir Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps -Subgroups,subgroups/test_subgroups \ No newline at end of file +Subgroups,subgroups/test_subgroups diff --git a/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv b/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv index b52f20c0..a899a656 100644 --- a/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv +++ b/test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv @@ -1,5 +1,5 @@ # -# OpenCL Conformance Test Suite (full version) +# OpenCL Conformance Test Suite (no math and no conversion) # # ######################################### @@ -33,6 +33,8 @@ Allocations (single maximum),allocations/test_allocations single 5 all Allocations (total maximum),allocations/test_allocations multiple 5 all VecAlign, vec_align/test_vecalign VecStep, vec_step/test_vecstep +Printf,printf/test_printf +Device Partitioning,device_partition/test_device_partition # ######################################### # Buffers and images @@ -88,5 +90,36 @@ OpenCL-GL Sharing,gl/test_gl Select,select/test_select Contractions,contractions/contractions Integer Ops,integer_ops/test_integer_ops -Half Ops,half/Test_half +Half Ops,half/test_half +# ######################################### +# Compatibility with Previous Versions +# ######################################### +Basic 1.2,compatibility/test_conformance/basic/test_basic +API 1.2,compatibility/test_conformance/api/test_api + +##################################### +# OpenCL 2.0 tests +##################################### +C11 Atomics,c11_atomics/test_c11_atomics +Execution Model,device_execution/test_device_execution +Generic Address Space,generic_address_space/test_generic_address_space +Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group +Pipes,pipes/test_pipes +SVM,SVM/test_SVM +Workgroups,workgroups/test_workgroups + +##################################### +# OpenCL 2.1 tests +##################################### +Device timer,device_timer/test_device_timer +SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin + +######################################### +# Extensions +######################################### +SPIR,spir/test_spir +Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST +Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps +Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps +Subgroups,subgroups/test_subgroups diff --git a/test_conformance/spirv_new/CMakeLists.txt b/test_conformance/spirv_new/CMakeLists.txt new file mode 100644 index 00000000..48e0706b --- /dev/null +++ b/test_conformance/spirv_new/CMakeLists.txt @@ -0,0 +1,38 @@ +###################################################################################################### +#Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. +# +#This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +#This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +#third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +#broadcast or otherwise exploited in any manner without the express prior written permission +#of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +#disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +#in whole or in part other than under the terms of the Khronos Adopters Agreement +#or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +###################################################################################################### + +set(MODULE_NAME SPIRV_NEW) +set(CMAKE_CXX_STANDARD 11) + +file(GLOB SPIRV_NEW_SOURCES "*.cpp") + +set(TEST_HARNESS_SOURCES + ../../test_common/harness/crc32.c + ../../test_common/harness/errorHelpers.c + ../../test_common/harness/threadTesting.c + ../../test_common/harness/testHarness.c + ../../test_common/harness/kernelHelpers.c + ../../test_common/harness/typeWrappers.cpp + ../../test_common/harness/mt19937.c + ../../test_common/harness/conversions.c + ../../test_common/harness/msvc9.c + ../../test_common/harness/rounding_mode.c + ../../test_common/harness/os_helpers.cpp + ../../test_common/harness/parseParameters.cpp + ../../test_conformance/math_brute_force/reference_math.c + ../../test_conformance/math_brute_force/Utility.c + ) + +set(${MODULE_NAME}_SOURCES ${SPIRV_NEW_SOURCES} ${TEST_HARNESS_SOURCES}) + +include(../CMakeCommon.txt) diff --git a/test_conformance/spirv_new/README.txt b/test_conformance/spirv_new/README.txt new file mode 100644 index 00000000..71beaade --- /dev/null +++ b/test_conformance/spirv_new/README.txt @@ -0,0 +1,13 @@ +test_conformance/spirv_new README +================================== + +The text versions of the spirv files are present in `conformance-tests/test_conformance/spriv_new/spirv_txt`. +These text files have been used to generate the binaries in `spirv_bin` using the assembler from `spirv-tools`. + +The absolute path to `spirv_bin` needs to be passed after `-ILPath` token for the test to find the SPIRV binaries. + +An example invocation looks like the following: + +``` +./test_conformance/spirv_new/test_conformance_spirv_new -ILPath /home/user/workspace/conformance-tests/test_conformance/spirv_new/spirv_bin/ [other options] +``` diff --git a/test_conformance/spirv_new/main.cpp b/test_conformance/spirv_new/main.cpp new file mode 100644 index 00000000..0f801092 --- /dev/null +++ b/test_conformance/spirv_new/main.cpp @@ -0,0 +1,217 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include +#include +#include "procs.h" +#if !defined(_WIN32) +#include +#endif + +#include +#include +#include +#include + +#if defined(_WIN32) +const std::string slash = "\\"; +#else +const std::string slash = "/"; +#endif + +const std::string spvExt = ".spv"; +std::string gAddrWidth = ""; +std::string spvBinariesPath = "spirv_bin"; +std::string spvBinariesPathArg = "--spirv-binaries-path"; + +std::vector readBinary(const char *file_name) +{ + using namespace std; + + ifstream file(file_name, ios::in | ios::binary | ios::ate); + + std::vector tmpBuffer(0); + + if (file.is_open()) { + size_t size = file.tellg(); + tmpBuffer.resize(size); + file.seekg(0, ios::beg); + file.read(&tmpBuffer[0], size); + file.close(); + } else { + log_error("File %s not found\n", file_name); + } + + std::vector result(tmpBuffer.begin(), tmpBuffer.end()); + + return result; +} + + +std::vector readSPIRV(const char *file_name) +{ + std::string full_name_str = spvBinariesPath + slash + file_name + spvExt + gAddrWidth; + return readBinary(full_name_str.c_str()); +} + +test_definition *spirvTestsRegistry::getTestDefinitions() +{ + return &testDefinitions[0]; +} + +size_t spirvTestsRegistry::getNumTests() +{ + return testDefinitions.size(); +} + +void spirvTestsRegistry::addTestClass(baseTestClass *test, const char *testName) +{ + + testClasses.push_back(test); + test_definition testDef; + testDef.func = test->getFunction(); + testDef.name = testName; + testDef.min_version = Version(2, 1); + testDefinitions.push_back(testDef); +} + +spirvTestsRegistry& spirvTestsRegistry::getInstance() +{ + static spirvTestsRegistry instance; + return instance; +} + +static int offline_get_program_with_il(clProgramWrapper &prog, + const cl_device_id deviceID, + const cl_context context, + const char *prog_name) +{ + cl_int err = 0; + std::string outputTypeStr = "binary"; + std::string defaultScript = std::string("..") + slash + std::string("spv_to_binary.py"); + std::string outputFilename = spvBinariesPath + slash + std::string(prog_name); + std::string sourceFilename = outputFilename + spvExt; + + std::string scriptArgs = + sourceFilename + " " + + outputFilename + " " + + gAddrWidth + " " + + outputTypeStr + " " + + "-cl-std=CL2.0"; + + std::string scriptToRunString = defaultScript + scriptArgs; + + // execute script + log_info("Executing command: %s\n", scriptToRunString.c_str()); + fflush(stdout); + int returnCode = system(scriptToRunString.c_str()); + if (returnCode != 0) { + log_error("Command finished with error: 0x%x\n", returnCode); + return CL_COMPILE_PROGRAM_FAILURE; + } + + // read output file + std::vector buffer_vec = readBinary(outputFilename.c_str()); + size_t file_bytes = buffer_vec.size(); + if (file_bytes == 0) { + log_error("OfflinerCompiler: Failed to open binary file: %s", outputFilename.c_str()); + return -1; + } + + const unsigned char *buffer = &buffer_vec[0]; + cl_int status = 0; + prog = clCreateProgramWithBinary(context, 1, &deviceID, &file_bytes, &buffer, &status, &err); + SPIRV_CHECK_ERROR((err || status), "Failed to create program with clCreateProgramWithBinary"); + return err; +} + +int get_program_with_il(clProgramWrapper &prog, + const cl_device_id deviceID, + const cl_context context, + const char *prog_name) +{ + cl_int err = 0; + if (gCompilationMode == kBinary) { + return offline_get_program_with_il(prog, deviceID, context, prog_name); + } + + std::vector buffer_vec = readSPIRV(prog_name); + + int file_bytes = buffer_vec.size(); + if (file_bytes == 0) { + log_error("File %s not found\n", prog_name); + return -1; + } + + unsigned char *buffer = &buffer_vec[0]; + prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL"); + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + return err; +} + +test_status checkAddressWidth(cl_device_id id) +{ + cl_uint address_bits; + cl_uint err = clGetDeviceInfo(id, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), &address_bits, NULL); + if(err != CL_SUCCESS){ + log_error("clGetDeviceInfo failed to get address bits!"); + return TEST_FAIL; + } + + gAddrWidth = address_bits == 32 ? "32" : "64"; + return TEST_PASS; +} + +void printUsage() { + log_info("Reading SPIR-V files from default '%s' path.\n", spvBinariesPath.c_str()); + log_info("In case you want to set other directory use '%s' argument.\n", spvBinariesPathArg.c_str()); +} + +int main(int argc, const char *argv[]) +{ + gReSeed = 1; + bool modifiedSpvBinariesPath = false; + for (int i = 0; i < argc; ++i) { + int argsRemoveNum = 0; + if (argv[i] == spvBinariesPathArg) { + if (i + 1 == argc) { + log_error("Missing value for '%s' argument.\n", spvBinariesPathArg.c_str()); + return TEST_FAIL; + } else { + spvBinariesPath = std::string(argv[i + 1]); + argsRemoveNum += 2; + modifiedSpvBinariesPath = true; + } + } + + if (argsRemoveNum > 0) { + for (int j = i; j < (argc - argsRemoveNum); ++j) + argv[j] = argv[j + argsRemoveNum]; + + argc -= argsRemoveNum; + --i; + } + } + if (modifiedSpvBinariesPath == false) { + printUsage(); + } + + return runTestHarnessWithCheck(argc, argv, + spirvTestsRegistry::getInstance().getNumTests(), + spirvTestsRegistry::getInstance().getTestDefinitions(), + false, false, 0, checkAddressWidth); +} diff --git a/test_conformance/spirv_new/procs.h b/test_conformance/spirv_new/procs.h new file mode 100644 index 00000000..1abe49e6 --- /dev/null +++ b/test_conformance/spirv_new/procs.h @@ -0,0 +1,98 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#pragma once + +#include "../../test_common/harness/errorHelpers.h" +#include "../../test_common/harness/kernelHelpers.h" +#include "../../test_common/harness/typeWrappers.h" +#include "../../test_common/harness/conversions.h" +#include "../../test_common/harness/mt19937.h" +#include "../../test_common/harness/compat.h" +#include "../../test_common/harness/testHarness.h" +#include "../../test_common/harness/parseParameters.h" + +#include + +#define SPIRV_CHECK_ERROR(err, fmt, ...) do { \ + if (err == CL_SUCCESS) break; \ + log_error("%s(%d): Error %d\n" fmt "\n", \ + __FILE__, __LINE__, err, ##__VA_ARGS__); \ + return -1; \ + } while(0) + + +class baseTestClass +{ +public: + baseTestClass() {} + virtual basefn getFunction() = 0; +}; + +class spirvTestsRegistry { +private: + std::vector testClasses; + std::vector testDefinitions; + +public: + + static spirvTestsRegistry& getInstance(); + + test_definition *getTestDefinitions(); + + size_t getNumTests(); + + void addTestClass(baseTestClass *test, const char *testName); + spirvTestsRegistry() {} +}; + +template +T* createAndRegister(const char *name) +{ + T *testClass = new T(); + spirvTestsRegistry::getInstance().addTestClass((baseTestClass *)testClass, name); + return testClass; +} + +#define TEST_SPIRV_FUNC(name) \ + extern int test_##name(cl_device_id deviceID, \ + cl_context context, \ + cl_command_queue queue, \ + int num_elements); \ + class test_##name##_class : public baseTestClass \ + { \ + private: \ + basefn fn; \ + \ + public: \ + test_##name##_class() : fn(test_##name) \ + { \ + } \ + basefn getFunction() \ + { \ + return fn; \ + } \ + }; \ + test_##name##_class *var_##name = \ + createAndRegister(#name); \ + int test_##name(cl_device_id deviceID, \ + cl_context context, \ + cl_command_queue queue, \ + int num_elements) + +std::vector readSPIRV(const char *file_name); + +int get_program_with_il(clProgramWrapper &prog, + const cl_device_id deviceID, + const cl_context context, + const char *prog_name); diff --git a/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32 b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32 new file mode 100644 index 00000000..22a286cc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64 b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64 new file mode 100644 index 00000000..d590b8b3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32 b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32 new file mode 100644 index 00000000..7680b2b9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64 b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64 new file mode 100644 index 00000000..a049df83 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional.spv32 b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv32 new file mode 100644 index 00000000..5b16aca3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional.spv64 b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv64 new file mode 100644 index 00000000..806b1bb4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv32 b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv32 new file mode 100644 index 00000000..739d60dc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv64 b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv64 new file mode 100644 index 00000000..2ca9127c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_conditional_weighted.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_simple.spv32 b/test_conformance/spirv_new/spirv_bin/branch_simple.spv32 new file mode 100644 index 00000000..4747a244 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/branch_simple.spv64 b/test_conformance/spirv_new/spirv_bin/branch_simple.spv64 new file mode 100644 index 00000000..a5795b5c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/branch_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv32 b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv32 new file mode 100644 index 00000000..ac668439 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv64 b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv64 new file mode 100644 index 00000000..279a2177 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_int4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv32 b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv32 new file mode 100644 index 00000000..3ad1aaa2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv64 b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv64 new file mode 100644 index 00000000..22a21cd5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/composite_construct_struct.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32 new file mode 100644 index 00000000..7f0a8fed Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64 new file mode 100644 index 00000000..0a9b667b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv32 new file mode 100644 index 00000000..bb6b2bcb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv64 new file mode 100644 index 00000000..4cb895c6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_double_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32 new file mode 100644 index 00000000..4e8f9f64 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64 new file mode 100644 index 00000000..302ac272 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32 new file mode 100644 index 00000000..a97471b4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64 new file mode 100644 index 00000000..2891abf6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32 new file mode 100644 index 00000000..84c80197 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64 new file mode 100644 index 00000000..a05102a3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32 new file mode 100644 index 00000000..77985519 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64 new file mode 100644 index 00000000..ea5580ed Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32 new file mode 100644 index 00000000..49141cee Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64 new file mode 100644 index 00000000..e4aeb68d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32 new file mode 100644 index 00000000..829cfc48 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64 new file mode 100644 index 00000000..ce03e974 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32 new file mode 100644 index 00000000..b99b03f5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64 new file mode 100644 index 00000000..b52f09aa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32 new file mode 100644 index 00000000..b121db4a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64 new file mode 100644 index 00000000..3f230303 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv32 new file mode 100644 index 00000000..2a01869b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv64 new file mode 100644 index 00000000..39a461cf Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv32 new file mode 100644 index 00000000..e5fcb4ec Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv64 new file mode 100644 index 00000000..b77f5477 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_int_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv32 new file mode 100644 index 00000000..fd43ccd7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv64 new file mode 100644 index 00000000..98ee0891 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_struct_struct_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32 new file mode 100644 index 00000000..7e4ad767 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64 new file mode 100644 index 00000000..1f2306de Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32 new file mode 100644 index 00000000..1b63fafe Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64 new file mode 100644 index 00000000..8bf38d0e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32 new file mode 100644 index 00000000..fe7463d7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64 new file mode 100644 index 00000000..eb8ea019 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32 new file mode 100644 index 00000000..29a76a1f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64 new file mode 100644 index 00000000..c26d62df Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv32 b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv32 new file mode 100644 index 00000000..0fbde369 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv64 b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv64 new file mode 100644 index 00000000..1f35a8df Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/constant_ushort_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32 new file mode 100644 index 00000000..23334e01 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64 new file mode 100644 index 00000000..34c16d9f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32 new file mode 100644 index 00000000..a04ee052 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64 new file mode 100644 index 00000000..7fa5ca4d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32 new file mode 100644 index 00000000..8f5f6067 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64 new file mode 100644 index 00000000..37757844 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32 new file mode 100644 index 00000000..84eba798 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64 new file mode 100644 index 00000000..3943a52f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32 new file mode 100644 index 00000000..853acbe3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64 new file mode 100644 index 00000000..485fb3cd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32 new file mode 100644 index 00000000..720f3e79 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64 new file mode 100644 index 00000000..1a4e94e7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32 new file mode 100644 index 00000000..7b194074 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64 new file mode 100644 index 00000000..61af430d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32 new file mode 100644 index 00000000..daf32092 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64 new file mode 100644 index 00000000..19e49d9a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32 new file mode 100644 index 00000000..cd6b9fe0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64 new file mode 100644 index 00000000..a7060480 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv32 new file mode 100644 index 00000000..4555a397 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv64 new file mode 100644 index 00000000..0e9de18d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv32 new file mode 100644 index 00000000..7e7fc8a8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv64 new file mode 100644 index 00000000..832efe74 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_int_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv32 new file mode 100644 index 00000000..ac029613 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv64 new file mode 100644 index 00000000..c027f9c0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_struct_struct_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32 new file mode 100644 index 00000000..5416c5d0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64 new file mode 100644 index 00000000..ab6c8276 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32 new file mode 100644 index 00000000..4031b089 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64 new file mode 100644 index 00000000..ca834567 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32 new file mode 100644 index 00000000..8dc0519d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64 new file mode 100644 index 00000000..11796a24 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32 b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32 new file mode 100644 index 00000000..3c1045b9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64 b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64 new file mode 100644 index 00000000..08db8547 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32 new file mode 100644 index 00000000..dc6ead2e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64 new file mode 100644 index 00000000..6a13de3a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32 new file mode 100644 index 00000000..21ba5600 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv64 new file mode 100644 index 00000000..d2b55080 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_alignment.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv32 new file mode 100644 index 00000000..2e49c6fb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv64 new file mode 100644 index 00000000..9227ffd7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_coherent.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv32 new file mode 100644 index 00000000..63f1fa08 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv64 new file mode 100644 index 00000000..b9fa920f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv32 new file mode 100644 index 00000000..0b6d84cf Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv64 new file mode 100644 index 00000000..67700c1f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_constant_fail.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv32 new file mode 100644 index 00000000..13364847 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv64 new file mode 100644 index 00000000..9fa9b9a2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_cpacked.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv32 new file mode 100644 index 00000000..fae2ef6b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv64 new file mode 100644 index 00000000..adbca68b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonreadable.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv32 new file mode 100644 index 00000000..1b6ea152 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv64 new file mode 100644 index 00000000..a9ff218c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_nonwritable.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv32 new file mode 100644 index 00000000..202d6810 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv64 new file mode 100644 index 00000000..a5389e4f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_restrict.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv32 new file mode 100644 index 00000000..65747902 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv64 new file mode 100644 index 00000000..9beb6d21 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv32 new file mode 100644 index 00000000..85ae5fa9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv64 new file mode 100644 index 00000000..86094bf5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rte_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv32 new file mode 100644 index 00000000..b4d9a429 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv64 new file mode 100644 index 00000000..2520d57d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv32 new file mode 100644 index 00000000..ebd57929 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv64 new file mode 100644 index 00000000..ff5e2b52 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtn_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv32 new file mode 100644 index 00000000..3c8a9f69 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv64 new file mode 100644 index 00000000..c4832c79 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv32 new file mode 100644 index 00000000..eb5bbf2a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv64 new file mode 100644 index 00000000..f836c096 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtp_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv32 new file mode 100644 index 00000000..cf6a0f73 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv64 new file mode 100644 index 00000000..39c9bee0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_double_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv32 new file mode 100644 index 00000000..a1cbf95a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv64 new file mode 100644 index 00000000..5c440276 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_rounding_rtz_float_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv32 new file mode 100644 index 00000000..66ea8450 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv64 new file mode 100644 index 00000000..ec87755f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_char.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv32 new file mode 100644 index 00000000..ccb5396e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv64 new file mode 100644 index 00000000..6cb8ffc3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv32 new file mode 100644 index 00000000..4786da6d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv64 new file mode 100644 index 00000000..6b76d270 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_short.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv32 new file mode 100644 index 00000000..589334c9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv64 new file mode 100644 index 00000000..31b10825 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uchar.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv32 new file mode 100644 index 00000000..ebc4b81c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv64 new file mode 100644 index 00000000..0b66792f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv32 new file mode 100644 index 00000000..405f98dc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv64 new file mode 100644 index 00000000..57b18789 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_saturated_conversion_ushort.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv32 b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv32 new file mode 100644 index 00000000..00ea3786 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv64 b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv64 new file mode 100644 index 00000000..0eaefba4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/decorate_volatile.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv32 new file mode 100644 index 00000000..0c127d85 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv64 new file mode 100644 index 00000000..a2c4ea16 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv32 new file mode 100644 index 00000000..0cb6df83 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv64 new file mode 100644 index 00000000..756c1f56 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv32 new file mode 100644 index 00000000..0244f5fb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv64 new file mode 100644 index 00000000..bbed3eb4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv32 new file mode 100644 index 00000000..1614552d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv64 new file mode 100644 index 00000000..bcf14c84 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv32 new file mode 100644 index 00000000..5bd6eb57 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv64 new file mode 100644 index 00000000..cb30da01 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv32 new file mode 100644 index 00000000..10edf68f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv64 new file mode 100644 index 00000000..6aea920b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv32 new file mode 100644 index 00000000..d164e1ba Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv64 new file mode 100644 index 00000000..3ab24822 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv32 new file mode 100644 index 00000000..fd6c17cd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv64 new file mode 100644 index 00000000..ded47aea Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv32 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv32 new file mode 100644 index 00000000..e74c84ba Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv64 b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv64 new file mode 100644 index 00000000..4ed0e5d5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_double.spv32 new file mode 100644 index 00000000..84fad15a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_double.spv64 new file mode 100644 index 00000000..f453a28c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv32 new file mode 100644 index 00000000..724c71d7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv64 new file mode 100644 index 00000000..8bb4fe13 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_float.spv32 new file mode 100644 index 00000000..238aeee7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_float.spv64 new file mode 100644 index 00000000..de288552 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv32 new file mode 100644 index 00000000..880f2d92 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv64 new file mode 100644 index 00000000..652b8f43 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_half.spv32 b/test_conformance/spirv_new/spirv_bin/fadd_half.spv32 new file mode 100644 index 00000000..e0294324 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fadd_half.spv64 b/test_conformance/spirv_new/spirv_bin/fadd_half.spv64 new file mode 100644 index 00000000..ce54ba58 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fadd_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv32 new file mode 100644 index 00000000..4249cea2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv64 new file mode 100644 index 00000000..47f39e82 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv32 new file mode 100644 index 00000000..88ef457a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv64 new file mode 100644 index 00000000..6d753164 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv32 new file mode 100644 index 00000000..3278deae Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv64 new file mode 100644 index 00000000..687048cb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv32 new file mode 100644 index 00000000..24b267e7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv64 new file mode 100644 index 00000000..5cd84ed1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_half.spv32 b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv32 new file mode 100644 index 00000000..638c44a3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fdiv_half.spv64 b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv64 new file mode 100644 index 00000000..c7a1bffb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fdiv_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_double.spv32 new file mode 100644 index 00000000..80ebe51a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_double.spv64 new file mode 100644 index 00000000..a9dc49f3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv32 new file mode 100644 index 00000000..f598faf6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv64 new file mode 100644 index 00000000..eadd41ef Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_float.spv32 new file mode 100644 index 00000000..354087f7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_float.spv64 new file mode 100644 index 00000000..20a0c703 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv32 new file mode 100644 index 00000000..d6a853c1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv64 new file mode 100644 index 00000000..1616a106 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_half.spv32 b/test_conformance/spirv_new/spirv_bin/fmod_half.spv32 new file mode 100644 index 00000000..5fac82e3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmod_half.spv64 b/test_conformance/spirv_new/spirv_bin/fmod_half.spv64 new file mode 100644 index 00000000..3a411a34 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmod_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_double.spv32 new file mode 100644 index 00000000..8018033f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_double.spv64 new file mode 100644 index 00000000..e7e98079 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv32 new file mode 100644 index 00000000..4057b946 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv64 new file mode 100644 index 00000000..b3082700 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_float.spv32 new file mode 100644 index 00000000..96d2a18e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_float.spv64 new file mode 100644 index 00000000..a160a8e8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv32 new file mode 100644 index 00000000..5856ef1a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv64 new file mode 100644 index 00000000..b3c22bd4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_half.spv32 b/test_conformance/spirv_new/spirv_bin/fmul_half.spv32 new file mode 100644 index 00000000..f9eff003 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fmul_half.spv64 b/test_conformance/spirv_new/spirv_bin/fmul_half.spv64 new file mode 100644 index 00000000..467674e4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fmul_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double.spv32 b/test_conformance/spirv_new/spirv_bin/frem_double.spv32 new file mode 100644 index 00000000..887e7ec8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double.spv64 b/test_conformance/spirv_new/spirv_bin/frem_double.spv64 new file mode 100644 index 00000000..b11c4e56 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double2.spv32 b/test_conformance/spirv_new/spirv_bin/frem_double2.spv32 new file mode 100644 index 00000000..15a7192d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_double2.spv64 b/test_conformance/spirv_new/spirv_bin/frem_double2.spv64 new file mode 100644 index 00000000..13ffb491 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float.spv32 b/test_conformance/spirv_new/spirv_bin/frem_float.spv32 new file mode 100644 index 00000000..7f8e5d55 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float.spv64 b/test_conformance/spirv_new/spirv_bin/frem_float.spv64 new file mode 100644 index 00000000..214541c7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float4.spv32 b/test_conformance/spirv_new/spirv_bin/frem_float4.spv32 new file mode 100644 index 00000000..e2f66103 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_float4.spv64 b/test_conformance/spirv_new/spirv_bin/frem_float4.spv64 new file mode 100644 index 00000000..4ae62aa8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_half.spv32 b/test_conformance/spirv_new/spirv_bin/frem_half.spv32 new file mode 100644 index 00000000..58da29f1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/frem_half.spv64 b/test_conformance/spirv_new/spirv_bin/frem_half.spv64 new file mode 100644 index 00000000..36327524 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/frem_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_double.spv32 new file mode 100644 index 00000000..8643553a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_double.spv64 new file mode 100644 index 00000000..63bef826 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double2.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv32 new file mode 100644 index 00000000..11dbd588 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_double2.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv64 new file mode 100644 index 00000000..22c89d8f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_double2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_float.spv32 new file mode 100644 index 00000000..aadc29d2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_float.spv64 new file mode 100644 index 00000000..e8bbec1d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float4.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv32 new file mode 100644 index 00000000..cb97b5c3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_float4.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv64 new file mode 100644 index 00000000..4b2b8d2a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_half.spv32 b/test_conformance/spirv_new/spirv_bin/fsub_half.spv32 new file mode 100644 index 00000000..4f7e4e90 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_half.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/fsub_half.spv64 b/test_conformance/spirv_new/spirv_bin/fsub_half.spv64 new file mode 100644 index 00000000..f5ccc297 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/fsub_half.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/label_simple.spv32 b/test_conformance/spirv_new/spirv_bin/label_simple.spv32 new file mode 100644 index 00000000..2cd91baa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/label_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/label_simple.spv64 b/test_conformance/spirv_new/spirv_bin/label_simple.spv64 new file mode 100644 index 00000000..66b4bfc3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/label_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv32 b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv32 new file mode 100644 index 00000000..05fb5be2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv64 b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv64 new file mode 100644 index 00000000..34c873d5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/lifetime_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_export.spv32 b/test_conformance/spirv_new/spirv_bin/linkage_export.spv32 new file mode 100644 index 00000000..280021b6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_export.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_export.spv64 b/test_conformance/spirv_new/spirv_bin/linkage_export.spv64 new file mode 100644 index 00000000..fefdc26c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_export.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_import.spv32 b/test_conformance/spirv_new/spirv_bin/linkage_import.spv32 new file mode 100644 index 00000000..e8ae0f31 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_import.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/linkage_import.spv64 b/test_conformance/spirv_new/spirv_bin/linkage_import.spv64 new file mode 100644 index 00000000..9aa48765 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/linkage_import.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv32 new file mode 100644 index 00000000..6e5a1f1f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv64 new file mode 100644 index 00000000..602b5318 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_dont_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv32 new file mode 100644 index 00000000..52e1a52c Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv64 new file mode 100644 index 00000000..14483d80 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv32 new file mode 100644 index 00000000..81d8e277 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv64 new file mode 100644 index 00000000..4e4bc2bd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_conditional_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv32 new file mode 100644 index 00000000..799140d6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv64 new file mode 100644 index 00000000..d482be77 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_dont_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv32 new file mode 100644 index 00000000..b486dd7b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv64 new file mode 100644 index 00000000..cfa96d7f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv32 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv32 new file mode 100644 index 00000000..82459b20 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv64 b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv64 new file mode 100644 index 00000000..b3bff498 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/loop_merge_branch_unroll.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_const.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_const.spv32 new file mode 100644 index 00000000..c371d5df Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_const.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_const.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_const.spv64 new file mode 100644 index 00000000..07df8ab7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_const.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_inline.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv32 new file mode 100644 index 00000000..3def2ee3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_inline.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv64 new file mode 100644 index 00000000..872e4efe Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_inline.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv32 new file mode 100644 index 00000000..3ac4c241 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv64 new file mode 100644 index 00000000..c9fbf134 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_noinline.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_none.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_none.spv32 new file mode 100644 index 00000000..027522f6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_none.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_none.spv64 new file mode 100644 index 00000000..5411a368 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv32 new file mode 100644 index 00000000..64a261e5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv64 new file mode 100644 index 00000000..d03a1b7b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv32 b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv32 new file mode 100644 index 00000000..acdec9d6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv64 b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv64 new file mode 100644 index 00000000..34e495b3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_function_pure_ptr.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_double.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv32 new file mode 100644 index 00000000..005d38c4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_double.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv64 new file mode 100644 index 00000000..71e7241f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv32 new file mode 100644 index 00000000..7a89c8dc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv64 new file mode 100644 index 00000000..c76a39e9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv32 new file mode 100644 index 00000000..f1a88fa8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv64 new file mode 100644 index 00000000..3d306ea4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_float4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv32 new file mode 100644 index 00000000..f7feecdc Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv64 new file mode 100644 index 00000000..7ad8a109 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv32 new file mode 100644 index 00000000..285f8988 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv64 new file mode 100644 index 00000000..1fc4696b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_int4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_long.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv32 new file mode 100644 index 00000000..b4f7fe69 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_long.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv64 new file mode 100644 index 00000000..c5474441 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_short.spv32 b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv32 new file mode 100644 index 00000000..ddc874b0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_neg_short.spv64 b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv64 new file mode 100644 index 00000000..3e29164e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_neg_short.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_int.spv32 new file mode 100644 index 00000000..892fe554 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_int.spv64 new file mode 100644 index 00000000..3c6f6d87 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int4.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv32 new file mode 100644 index 00000000..0af94521 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_int4.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv64 new file mode 100644 index 00000000..a40c025e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_int4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_long.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_long.spv32 new file mode 100644 index 00000000..b00d205b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_long.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_long.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_long.spv64 new file mode 100644 index 00000000..671a10bb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_long.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_short.spv32 b/test_conformance/spirv_new/spirv_bin/op_not_short.spv32 new file mode 100644 index 00000000..fa1a88dd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_short.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/op_not_short.spv64 b/test_conformance/spirv_new/spirv_bin/op_not_short.spv64 new file mode 100644 index 00000000..648f92fb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/op_not_short.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/opaque.spv32 b/test_conformance/spirv_new/spirv_bin/opaque.spv32 new file mode 100644 index 00000000..3400d988 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/opaque.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/opaque.spv64 b/test_conformance/spirv_new/spirv_bin/opaque.spv64 new file mode 100644 index 00000000..8383e93b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/opaque.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_2.spv32 b/test_conformance/spirv_new/spirv_bin/phi_2.spv32 new file mode 100644 index 00000000..85558579 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_2.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_2.spv64 b/test_conformance/spirv_new/spirv_bin/phi_2.spv64 new file mode 100644 index 00000000..4ef16fb6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_2.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_3.spv32 b/test_conformance/spirv_new/spirv_bin/phi_3.spv32 new file mode 100644 index 00000000..c9c6f65a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_3.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_3.spv64 b/test_conformance/spirv_new/spirv_bin/phi_3.spv64 new file mode 100644 index 00000000..383b3646 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_3.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_4.spv32 b/test_conformance/spirv_new/spirv_bin/phi_4.spv32 new file mode 100644 index 00000000..7221e5ec Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_4.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/phi_4.spv64 b/test_conformance/spirv_new/spirv_bin/phi_4.spv64 new file mode 100644 index 00000000..f5fc7637 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/phi_4.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv32 new file mode 100644 index 00000000..a82c609e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv64 new file mode 100644 index 00000000..ee6686d6 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_dont_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv32 new file mode 100644 index 00000000..4e53ee51 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv64 new file mode 100644 index 00000000..06bc45fa Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_none.spv32 b/test_conformance/spirv_new/spirv_bin/select_if_none.spv32 new file mode 100644 index 00000000..59162481 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_if_none.spv64 b/test_conformance/spirv_new/spirv_bin/select_if_none.spv64 new file mode 100644 index 00000000..32f4248e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_if_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv32 new file mode 100644 index 00000000..80092e59 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv64 new file mode 100644 index 00000000..b0c9f7ff Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_dont_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv32 b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv32 new file mode 100644 index 00000000..dad04416 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv64 b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv64 new file mode 100644 index 00000000..3bc755d8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_flatten.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_none.spv32 b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv32 new file mode 100644 index 00000000..c26e4a4f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/select_switch_none.spv64 b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv64 new file mode 100644 index 00000000..43eea32a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/select_switch_none.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv32 new file mode 100644 index 00000000..aaa7d8d4 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv64 new file mode 100644 index 00000000..73318ea7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv32 new file mode 100644 index 00000000..f5274718 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv64 new file mode 100644 index 00000000..8260c99f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_double_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv32 new file mode 100644 index 00000000..1387d14e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv64 new file mode 100644 index 00000000..5b3c33d3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_false_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv32 new file mode 100644 index 00000000..fe1365ab Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv64 new file mode 100644 index 00000000..d3a78f16 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv32 new file mode 100644 index 00000000..947fdc95 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv64 new file mode 100644 index 00000000..ef6473f0 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_half_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv32 new file mode 100644 index 00000000..7c7f2a2e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv64 new file mode 100644 index 00000000..38e6b23a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int3_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv32 new file mode 100644 index 00000000..9905f137 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv64 new file mode 100644 index 00000000..92c785a2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int4_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv32 new file mode 100644 index 00000000..a7fc24e8 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv64 new file mode 100644 index 00000000..ee152ea3 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_int_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv32 new file mode 100644 index 00000000..6c304c6a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv64 new file mode 100644 index 00000000..087bb131 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_long_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv32 new file mode 100644 index 00000000..c55c7ed7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv64 new file mode 100644 index 00000000..9aa240ce Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_short_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv32 new file mode 100644 index 00000000..652b8358 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv64 new file mode 100644 index 00000000..092cee07 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_char_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv32 new file mode 100644 index 00000000..f6ad4ceb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv64 new file mode 100644 index 00000000..a1ef3fc5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_int_float_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv32 new file mode 100644 index 00000000..a66ae58a Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv64 new file mode 100644 index 00000000..80304402 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_struct_struct_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv32 new file mode 100644 index 00000000..bf658802 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv64 new file mode 100644 index 00000000..41c2bef9 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_true_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv32 new file mode 100644 index 00000000..e3b3074e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv64 new file mode 100644 index 00000000..929d352e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uchar_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv32 new file mode 100644 index 00000000..cd0c23ca Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv64 new file mode 100644 index 00000000..6e58cef7 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_uint_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv32 new file mode 100644 index 00000000..4a51c3cb Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv64 new file mode 100644 index 00000000..f0c9959e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ulong_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv32 b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv32 new file mode 100644 index 00000000..6030982b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv64 b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv64 new file mode 100644 index 00000000..c348a95d Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/undef_ushort_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv32 b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv32 new file mode 100644 index 00000000..2411c130 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv64 b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv64 new file mode 100644 index 00000000..70596a0e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/unreachable_simple.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv32 new file mode 100644 index 00000000..567f79fd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv64 new file mode 100644 index 00000000..65dde381 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv32 new file mode 100644 index 00000000..ac3f8ead Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv64 new file mode 100644 index 00000000..3e127407 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_char16_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv32 new file mode 100644 index 00000000..b90d90a5 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv64 new file mode 100644 index 00000000..f7cf8a74 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv32 new file mode 100644 index 00000000..7d50d010 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv64 new file mode 100644 index 00000000..1dd7e636 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_double2_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv32 new file mode 100644 index 00000000..dab24e00 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv64 new file mode 100644 index 00000000..16d0194f Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv32 new file mode 100644 index 00000000..c613d211 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv64 new file mode 100644 index 00000000..0d84bd6e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_float4_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv32 new file mode 100644 index 00000000..e1a38be1 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv64 new file mode 100644 index 00000000..8ea6cb15 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv32 new file mode 100644 index 00000000..e2121368 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv64 new file mode 100644 index 00000000..faf0238e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_int4_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv32 b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv32 new file mode 100644 index 00000000..aa7fe80e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv64 b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv64 new file mode 100644 index 00000000..7efda1ee Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_extract.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv32 b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv32 new file mode 100644 index 00000000..e42212f2 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv64 b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv64 new file mode 100644 index 00000000..9ef31d8b Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_long2_insert.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv32 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv32 new file mode 100644 index 00000000..8e672ddd Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv64 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv64 new file mode 100644 index 00000000..21e4dc40 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_double.spv64 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv32 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv32 new file mode 100644 index 00000000..2c4d9c3e Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv32 differ diff --git a/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv64 b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv64 new file mode 100644 index 00000000..94dff077 Binary files /dev/null and b/test_conformance/spirv_new/spirv_bin/vector_times_scalar_float.spv64 differ diff --git a/test_conformance/spirv_new/spirv_txt/atomic_dec_global.spvasm32 b/test_conformance/spirv_new/spirv_txt/atomic_dec_global.spvasm32 new file mode 100644 index 00000000..cc6f048e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/atomic_dec_global.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "atomic_dec_global" + OpName %global_id "__spirv_GlobalInvocationId" + OpName %val_ptr "val" + OpName %ctr_ptr "counter" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %val_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%scope_dev = OpConstant %int_t 1 +%sem_cwg = OpConstant %int_t 512 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%val_ptr = OpFunctionParameter %int_ptr_t +%ctr_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%res = OpAtomicIDecrement %int_t %ctr_ptr %scope_dev %sem_cwg +%val_loc = OpInBoundsPtrAccessChain %int_ptr_t %val_ptr %idx + OpStore %val_loc %res Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/atomic_dec_global.spvasm64 b/test_conformance/spirv_new/spirv_txt/atomic_dec_global.spvasm64 new file mode 100644 index 00000000..4df145f5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/atomic_dec_global.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "atomic_dec_global" + OpName %global_id "__spirv_GlobalInvocationId" + OpName %val_ptr "val" + OpName %ctr_ptr "counter" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %val_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%scope_dev = OpConstant %int_t 1 +%sem_cwg = OpConstant %int_t 512 +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%val_ptr = OpFunctionParameter %int_ptr_t +%ctr_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%res = OpAtomicIDecrement %int_t %ctr_ptr %scope_dev %sem_cwg +%val_loc = OpInBoundsPtrAccessChain %int_ptr_t %val_ptr %idx + OpStore %val_loc %res Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/atomic_inc_global.spvasm32 b/test_conformance/spirv_new/spirv_txt/atomic_inc_global.spvasm32 new file mode 100644 index 00000000..c6c8b30c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/atomic_inc_global.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "atomic_inc_global" + OpName %global_id "__spirv_GlobalInvocationId" + OpName %val_ptr "val" + OpName %ctr_ptr "counter" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %val_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%scope_dev = OpConstant %int_t 1 +%sem_cwg = OpConstant %int_t 512 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%val_ptr = OpFunctionParameter %int_ptr_t +%ctr_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%res = OpAtomicIIncrement %int_t %ctr_ptr %scope_dev %sem_cwg +%val_loc = OpInBoundsPtrAccessChain %int_ptr_t %val_ptr %idx + OpStore %val_loc %res Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/atomic_inc_global.spvasm64 b/test_conformance/spirv_new/spirv_txt/atomic_inc_global.spvasm64 new file mode 100644 index 00000000..ec0a35d1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/atomic_inc_global.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "atomic_inc_global" + OpName %global_id "__spirv_GlobalInvocationId" + OpName %val_ptr "val" + OpName %ctr_ptr "counter" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %val_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%scope_dev = OpConstant %int_t 1 +%sem_cwg = OpConstant %int_t 512 +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%val_ptr = OpFunctionParameter %int_ptr_t +%ctr_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%res = OpAtomicIIncrement %int_t %ctr_ptr %scope_dev %sem_cwg +%val_loc = OpInBoundsPtrAccessChain %int_ptr_t %val_ptr %idx + OpStore %val_loc %res Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/branch_conditional.spvasm32 b/test_conformance/spirv_new/spirv_txt/branch_conditional.spvasm32 new file mode 100644 index 00000000..40a0404d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/branch_conditional.spvasm32 @@ -0,0 +1,53 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "branch_conditional" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/branch_conditional.spvasm64 b/test_conformance/spirv_new/spirv_txt/branch_conditional.spvasm64 new file mode 100644 index 00000000..e318e14c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/branch_conditional.spvasm64 @@ -0,0 +1,58 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "branch_conditional" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/branch_conditional_weighted.spvasm32 b/test_conformance/spirv_new/spirv_txt/branch_conditional_weighted.spvasm32 new file mode 100644 index 00000000..779d5ef9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/branch_conditional_weighted.spvasm32 @@ -0,0 +1,53 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "branch_conditional_weighted" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare %block1 %block2 4 6 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/branch_conditional_weighted.spvasm64 b/test_conformance/spirv_new/spirv_txt/branch_conditional_weighted.spvasm64 new file mode 100644 index 00000000..6ae492f9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/branch_conditional_weighted.spvasm64 @@ -0,0 +1,58 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "branch_conditional_weighted" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare %block1 %block2 4 6 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/branch_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/branch_simple.spvasm32 new file mode 100644 index 00000000..8d2308e3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/branch_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "branch_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%outptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current_in = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%current_out = OpInBoundsPtrAccessChain %int_ptr_t %outptr %idx +%val = OpLoad %int_t %current_in + OpBranch %final_block +%final_block = OpLabel + OpStore %current_out %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/branch_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/branch_simple.spvasm64 new file mode 100644 index 00000000..9d4f5884 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/branch_simple.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "branch_simple" + OpName %inptr "in" + OpName %outptr "out" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%outptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current_in = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%current_out = OpInBoundsPtrAccessChain %int_ptr_t %outptr %idx + OpBranch %final_block +%final_block = OpLabel +%val = OpLoad %int_t %current_in + OpStore %current_out %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/composite_construct_int4.spvasm32 b/test_conformance/spirv_new/spirv_txt/composite_construct_int4.spvasm32 new file mode 100644 index 00000000..a4de927f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/composite_construct_int4.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "composite_construct_int4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%val3 = OpConstant %int_t 119 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%vec = OpCompositeConstruct %int4_t %val0 %val1 %val2 %val3 +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx + OpStore %current %vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/composite_construct_int4.spvasm64 b/test_conformance/spirv_new/spirv_txt/composite_construct_int4.spvasm64 new file mode 100644 index 00000000..69806cbe --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/composite_construct_int4.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "composite_construct_int4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%shift_val = OpConstant %idx_t 32 +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%val3 = OpConstant %int_t 119 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%vec = OpCompositeConstruct %int4_t %val0 %val1 %val2 %val3 +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx + OpStore %current %vec + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/composite_construct_struct.spvasm32 b/test_conformance/spirv_new/spirv_txt/composite_construct_struct.spvasm32 new file mode 100644 index 00000000..270c2e7e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/composite_construct_struct.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "composite_construct_struct" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%int_vec_0 = OpConstant %int_t 2100480000 +%int_vec_1 = OpConstant %int_t 2100480000 +%int2_val = OpConstantComposite %int2_t %int_vec_0 %int_vec_1 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct_val = OpCompositeConstruct %struct_t %int_val %char_val +%struct2_val = OpCompositeConstruct %struct2_t %int2_val %struct_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct2_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/composite_construct_struct.spvasm64 b/test_conformance/spirv_new/spirv_txt/composite_construct_struct.spvasm64 new file mode 100644 index 00000000..67c99bc0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/composite_construct_struct.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "composite_construct_struct" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%int_vec_0 = OpConstant %int_t 2100480000 +%int_vec_1 = OpConstant %int_t 2100480000 +%int2_val = OpConstantComposite %int2_t %int_vec_0 %int_vec_1 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct_val = OpCompositeConstruct %struct_t %int_val %char_val +%struct2_val = OpCompositeConstruct %struct2_t %int2_val %struct_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct2_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_char_simple.spvasm32 new file mode 100644 index 00000000..9ce758a2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_char_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%func_t = OpTypeFunction %void_t %char_ptr_t +%val = OpConstant %char_t 20 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %char_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %char_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_char_simple.spvasm64 new file mode 100644 index 00000000..8c5cea76 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_char_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%func_t = OpTypeFunction %void_t %char_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %char_t 20 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %char_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %char_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_double_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_double_simple.spvasm32 new file mode 100644 index 00000000..15af1dae --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_double_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_double_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%val = OpConstant %double_t 3.141592653589793 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_double_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_double_simple.spvasm64 new file mode 100644 index 00000000..52a95c20 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_double_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_double_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %double_t 3.141592653589793 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_false_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_false_simple.spvasm32 new file mode 100644 index 00000000..67ea6f1c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_false_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_false_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%bool_val = OpConstantFalse %bool_t +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_false_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_false_simple.spvasm64 new file mode 100644 index 00000000..99f203bf --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_false_simple.spvasm64 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_false_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%bool_val = OpConstantFalse %bool_t +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_float_simple.spvasm32 new file mode 100644 index 00000000..54aa082b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_float_simple.spvasm32 @@ -0,0 +1,28 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%val = OpConstant %float_t 3.1415927 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_float_simple.spvasm64 new file mode 100644 index 00000000..f52a86a8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_float_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %float_t 3.1415927 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_half_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_half_simple.spvasm32 new file mode 100644 index 00000000..c8cdb9f4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_half_simple.spvasm32 @@ -0,0 +1,31 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_half_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%half_t = OpTypeFloat 16 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%half_val = OpConstant %half_t 3.25 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%val = OpFConvert %float_t %half_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_half_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_half_simple.spvasm64 new file mode 100644 index 00000000..ab33b6a1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_half_simple.spvasm64 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_half_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%half_t = OpTypeFloat 16 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%half_val = OpConstant %half_t 3.25 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%val = OpFConvert %float_t %half_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_int3_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_int3_simple.spvasm32 new file mode 100644 index 00000000..752a52e4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_int3_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_int3_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int3_t = OpTypeVector %int_t 3 +%int3_ptr_t = OpTypePointer CrossWorkgroup %int3_t +%func_t = OpTypeFunction %void_t %int3_ptr_t +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%vec = OpConstantComposite %int3_t %val0 %val1 %val2 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int3_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int3_ptr_t %inptr %idx + OpStore %current %vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_int3_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_int3_simple.spvasm64 new file mode 100644 index 00000000..def2ae5f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_int3_simple.spvasm64 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_int3_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int3_t = OpTypeVector %int_t 3 +%int3_ptr_t = OpTypePointer CrossWorkgroup %int3_t +%func_t = OpTypeFunction %void_t %int3_ptr_t +%shift_val = OpConstant %idx_t 32 +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%vec = OpConstantComposite %int3_t %val0 %val1 %val2 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int3_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int3_ptr_t %inptr %idx + OpStore %current %vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_int4_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_int4_simple.spvasm32 new file mode 100644 index 00000000..04523f8a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_int4_simple.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_int4_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%val3 = OpConstant %int_t 119 +%vec = OpConstantComposite %int4_t %val0 %val1 %val2 %val3 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx + OpStore %current %vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_int4_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_int4_simple.spvasm64 new file mode 100644 index 00000000..d3c741f3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_int4_simple.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_int4_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%shift_val = OpConstant %idx_t 32 +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%val3 = OpConstant %int_t 119 +%vec = OpConstantComposite %int4_t %val0 %val1 %val2 %val3 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx + OpStore %current %vec + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_int_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_int_simple.spvasm32 new file mode 100644 index 00000000..2f7e7d7a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_int_simple.spvasm32 @@ -0,0 +1,28 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_int_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%val = OpConstant %int_t 123 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_int_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_int_simple.spvasm64 new file mode 100644 index 00000000..f2e8a6fb --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_int_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_int_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %int_t 123 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_long_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_long_simple.spvasm32 new file mode 100644 index 00000000..46659e7c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_long_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_long_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%val = OpConstant %long_t 34359738368 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_long_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_long_simple.spvasm64 new file mode 100644 index 00000000..626554a9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_long_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_long_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %long_t 34359738368 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_short_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_short_simple.spvasm32 new file mode 100644 index 00000000..8416d112 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_short_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_short_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%val = OpConstant %short_t 32000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_short_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_short_simple.spvasm64 new file mode 100644 index 00000000..73a5cfea --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_short_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_short_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %short_t 32000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_struct_int_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_struct_int_char_simple.spvasm32 new file mode 100644 index 00000000..130f2567 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_struct_int_char_simple.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_struct_int_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_struct_int_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_struct_int_char_simple.spvasm64 new file mode 100644 index 00000000..d67f91d3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_struct_int_char_simple.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_struct_int_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_struct_int_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_struct_int_float_simple.spvasm32 new file mode 100644 index 00000000..dd53cef7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_struct_int_float_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_struct_int_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%float_t = OpTypeFloat 32 +%struct_t = OpTypeStruct %int_t %float_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 1024 +%float_val = OpConstant %float_t 3.1415 +%struct_val = OpConstantComposite %struct_t %int_val %float_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_struct_int_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_struct_int_float_simple.spvasm64 new file mode 100644 index 00000000..14a0ea3d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_struct_int_float_simple.spvasm64 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_struct_int_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%float_t = OpTypeFloat 32 +%struct_t = OpTypeStruct %int_t %float_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 1024 +%float_val = OpConstant %float_t 3.1415 +%struct_val = OpConstantComposite %struct_t %int_val %float_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_struct_struct_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_struct_struct_simple.spvasm32 new file mode 100644 index 00000000..b61db8ee --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_struct_struct_simple.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_struct_struct_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%int_vec_0 = OpConstant %int_t 2100480000 +%int_vec_1 = OpConstant %int_t 2100480000 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%int2_val = OpConstantComposite %int2_t %int_vec_0 %int_vec_1 +%struct2_val = OpConstantComposite %struct2_t %int2_val %struct_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct2_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_struct_struct_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_struct_struct_simple.spvasm64 new file mode 100644 index 00000000..7159c704 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_struct_struct_simple.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_struct_struct_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%int_vec_0 = OpConstant %int_t 2100480000 +%int_vec_1 = OpConstant %int_t 2100480000 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%int2_val = OpConstantComposite %int2_t %int_vec_0 %int_vec_1 +%struct2_val = OpConstantComposite %struct2_t %int2_val %struct_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct2_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_true_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_true_simple.spvasm32 new file mode 100644 index 00000000..a8f6d0eb --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_true_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_true_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%bool_val = OpConstantTrue %bool_t +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_true_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_true_simple.spvasm64 new file mode 100644 index 00000000..8854e004 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_true_simple.spvasm64 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_true_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%bool_val = OpConstantTrue %bool_t +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_uchar_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_uchar_simple.spvasm32 new file mode 100644 index 00000000..fd8e0d8b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_uchar_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_uchar_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uchar_t = OpTypeInt 8 0 +%uchar_ptr_t = OpTypePointer CrossWorkgroup %uchar_t +%func_t = OpTypeFunction %void_t %uchar_ptr_t +%val = OpConstant %uchar_t 19 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uchar_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %uchar_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_uchar_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_uchar_simple.spvasm64 new file mode 100644 index 00000000..acb6b3bf --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_uchar_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_uchar_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uchar_t = OpTypeInt 8 0 +%uchar_ptr_t = OpTypePointer CrossWorkgroup %uchar_t +%func_t = OpTypeFunction %void_t %uchar_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %uchar_t 19 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uchar_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %uchar_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_uint_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_uint_simple.spvasm32 new file mode 100644 index 00000000..563e5389 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_uint_simple.spvasm32 @@ -0,0 +1,28 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_uint_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uint_t = OpTypeInt 32 0 +%uint_ptr_t = OpTypePointer CrossWorkgroup %uint_t +%func_t = OpTypeFunction %void_t %uint_ptr_t +%val = OpConstant %uint_t 54321 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uint_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %uint_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_uint_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_uint_simple.spvasm64 new file mode 100644 index 00000000..e383513e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_uint_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_uint_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uint_t = OpTypeInt 32 0 +%uint_ptr_t = OpTypePointer CrossWorkgroup %uint_t +%func_t = OpTypeFunction %void_t %uint_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %uint_t 54321 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uint_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %uint_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_ulong_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_ulong_simple.spvasm32 new file mode 100644 index 00000000..09e8e3fe --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_ulong_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_ulong_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ulong_t = OpTypeInt 64 0 +%ulong_ptr_t = OpTypePointer CrossWorkgroup %ulong_t +%func_t = OpTypeFunction %void_t %ulong_ptr_t +%val = OpConstant %ulong_t 9223372036854775810 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ulong_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %ulong_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_ulong_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_ulong_simple.spvasm64 new file mode 100644 index 00000000..87621844 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_ulong_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_ulong_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ulong_t = OpTypeInt 64 0 +%ulong_ptr_t = OpTypePointer CrossWorkgroup %ulong_t +%func_t = OpTypeFunction %void_t %ulong_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %ulong_t 9223372036854775810 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ulong_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %ulong_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_ushort_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/constant_ushort_simple.spvasm32 new file mode 100644 index 00000000..198a96da --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_ushort_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "constant_ushort_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ushort_t = OpTypeInt 16 0 +%ushort_ptr_t = OpTypePointer CrossWorkgroup %ushort_t +%func_t = OpTypeFunction %void_t %ushort_ptr_t +%val = OpConstant %ushort_t 65000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ushort_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %ushort_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/constant_ushort_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/constant_ushort_simple.spvasm64 new file mode 100644 index 00000000..a5c770b3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/constant_ushort_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "constant_ushort_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ushort_t = OpTypeInt 16 0 +%ushort_ptr_t = OpTypePointer CrossWorkgroup %ushort_t +%func_t = OpTypeFunction %void_t %ushort_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %ushort_t 65000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ushort_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %ushort_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_char_simple.spvasm32 new file mode 100644 index 00000000..ea1bb922 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_char_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%func_t = OpTypeFunction %void_t %char_ptr_t +%val = OpConstant %char_t 20 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %char_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %char_ptr_t %inptr %idx +%out_val = OpCopyObject %char_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_char_simple.spvasm64 new file mode 100644 index 00000000..396898ff --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_char_simple.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%func_t = OpTypeFunction %void_t %char_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %char_t 20 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %char_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %char_ptr_t %inptr %idx +%out_val = OpCopyObject %char_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_double_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_double_simple.spvasm32 new file mode 100644 index 00000000..53d615e1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_double_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_double_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%val = OpConstant %double_t 3.141592653589793 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx +%out_val = OpCopyObject %double_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_double_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_double_simple.spvasm64 new file mode 100644 index 00000000..5ad9a360 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_double_simple.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_double_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %double_t 3.141592653589793 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx +%out_val = OpCopyObject %double_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_float_simple.spvasm32 new file mode 100644 index 00000000..ae8ac96f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_float_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%val = OpConstant %float_t 3.1415927 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%out_val = OpCopyObject %float_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_float_simple.spvasm64 new file mode 100644 index 00000000..773e16ed --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_float_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %float_t 3.1415927 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%out_val = OpCopyObject %float_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_half_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_half_simple.spvasm32 new file mode 100644 index 00000000..07caf390 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_half_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_half_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%half_t = OpTypeFloat 16 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%half_val = OpConstant %half_t 3.25 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%half_copy = OpCopyObject %half_t %half_val +%val = OpFConvert %float_t %half_copy +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_half_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_half_simple.spvasm64 new file mode 100644 index 00000000..165d71e6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_half_simple.spvasm64 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_half_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%half_t = OpTypeFloat 16 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%half_val = OpConstant %half_t 3.25 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%half_copy = OpCopyObject %half_t %half_val +%val = OpFConvert %float_t %half_copy +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_int3_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_int3_simple.spvasm32 new file mode 100644 index 00000000..1cd2eca8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_int3_simple.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_int3_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int3_t = OpTypeVector %int_t 3 +%int3_ptr_t = OpTypePointer CrossWorkgroup %int3_t +%func_t = OpTypeFunction %void_t %int3_ptr_t +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%vec = OpConstantComposite %int3_t %val0 %val1 %val2 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int3_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int3_ptr_t %inptr %idx +%out_vec = OpCopyObject %int3_t %vec + OpStore %current %out_vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_int3_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_int3_simple.spvasm64 new file mode 100644 index 00000000..b2ec5289 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_int3_simple.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_int3_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int3_t = OpTypeVector %int_t 3 +%int3_ptr_t = OpTypePointer CrossWorkgroup %int3_t +%func_t = OpTypeFunction %void_t %int3_ptr_t +%shift_val = OpConstant %idx_t 32 +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%vec = OpConstantComposite %int3_t %val0 %val1 %val2 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int3_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int3_ptr_t %inptr %idx +%out_vec = OpCopyObject %int3_t %vec + OpStore %current %out_vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_int4_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_int4_simple.spvasm32 new file mode 100644 index 00000000..f434988d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_int4_simple.spvasm32 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_int4_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%val3 = OpConstant %int_t 119 +%vec = OpConstantComposite %int4_t %val0 %val1 %val2 %val3 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx +%out_vec = OpCopyObject %int4_t %vec + OpStore %current %out_vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_int4_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_int4_simple.spvasm64 new file mode 100644 index 00000000..62e1668b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_int4_simple.spvasm64 @@ -0,0 +1,38 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_int4_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%shift_val = OpConstant %idx_t 32 +%val0 = OpConstant %int_t 123 +%val1 = OpConstant %int_t 122 +%val2 = OpConstant %int_t 121 +%val3 = OpConstant %int_t 119 +%vec = OpConstantComposite %int4_t %val0 %val1 %val2 %val3 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx +%out_vec = OpCopyObject %int4_t %vec + OpStore %current %out_vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_int_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_int_simple.spvasm32 new file mode 100644 index 00000000..204409fd --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_int_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_int_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%val = OpConstant %int_t 123 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%out_val = OpCopyObject %int_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_int_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_int_simple.spvasm64 new file mode 100644 index 00000000..0af0641e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_int_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_int_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %int_t 123 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%out_val = OpCopyObject %int_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_long_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_long_simple.spvasm32 new file mode 100644 index 00000000..3e317c77 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_long_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_long_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%val = OpConstant %long_t 34359738368 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx +%out_val = OpCopyObject %long_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_long_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_long_simple.spvasm64 new file mode 100644 index 00000000..5e4a899c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_long_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_long_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %long_t 34359738368 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx +%out_val = OpCopyObject %long_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_short_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_short_simple.spvasm32 new file mode 100644 index 00000000..c4c00063 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_short_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_short_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%val = OpConstant %short_t 32000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx +%out_val = OpCopyObject %short_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_short_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_short_simple.spvasm64 new file mode 100644 index 00000000..6704cdd5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_short_simple.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_short_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %short_t 32000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx +%out_val = OpCopyObject %short_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_struct_int_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_struct_int_char_simple.spvasm32 new file mode 100644 index 00000000..836ce149 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_struct_int_char_simple.spvasm32 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_struct_int_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx +%out_val = OpCopyObject %struct_t %struct_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_struct_int_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_struct_int_char_simple.spvasm64 new file mode 100644 index 00000000..38d10920 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_struct_int_char_simple.spvasm64 @@ -0,0 +1,38 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_struct_int_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx +%out_val = OpCopyObject %struct_t %struct_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_struct_int_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_struct_int_float_simple.spvasm32 new file mode 100644 index 00000000..1fe7188e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_struct_int_float_simple.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_struct_int_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%float_t = OpTypeFloat 32 +%struct_t = OpTypeStruct %int_t %float_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 1024 +%float_val = OpConstant %float_t 3.1415 +%struct_val = OpConstantComposite %struct_t %int_val %float_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx +%out_val = OpCopyObject %struct_t %struct_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_struct_int_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_struct_int_float_simple.spvasm64 new file mode 100644 index 00000000..4293a921 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_struct_int_float_simple.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_struct_int_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%float_t = OpTypeFloat 32 +%struct_t = OpTypeStruct %int_t %float_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 1024 +%float_val = OpConstant %float_t 3.1415 +%struct_val = OpConstantComposite %struct_t %int_val %float_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx +%out_val = OpCopyObject %struct_t %struct_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_struct_struct_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_struct_struct_simple.spvasm32 new file mode 100644 index 00000000..cc1959d3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_struct_struct_simple.spvasm32 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Int8 + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_struct_struct_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%int_vec_0 = OpConstant %int_t 2100480000 +%int_vec_1 = OpConstant %int_t 2100480000 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%int2_val = OpConstantComposite %int2_t %int_vec_0 %int_vec_1 +%struct2_val = OpConstantComposite %struct2_t %int2_val %struct_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx +%out_val = OpCopyObject %struct2_t %struct2_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_struct_struct_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_struct_struct_simple.spvasm64 new file mode 100644 index 00000000..2445bae0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_struct_struct_simple.spvasm64 @@ -0,0 +1,44 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_struct_struct_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 128 +%int_vec_0 = OpConstant %int_t 2100480000 +%int_vec_1 = OpConstant %int_t 2100480000 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%int2_val = OpConstantComposite %int2_t %int_vec_0 %int_vec_1 +%struct2_val = OpConstantComposite %struct2_t %int2_val %struct_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx +%out_val = OpCopyObject %struct2_t %struct2_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_uchar_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_uchar_simple.spvasm32 new file mode 100644 index 00000000..df648d9e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_uchar_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_uchar_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uchar_t = OpTypeInt 8 0 +%uchar_ptr_t = OpTypePointer CrossWorkgroup %uchar_t +%func_t = OpTypeFunction %void_t %uchar_ptr_t +%val = OpConstant %uchar_t 19 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uchar_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %uchar_ptr_t %inptr %idx +%out_val = OpCopyObject %uchar_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_uchar_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_uchar_simple.spvasm64 new file mode 100644 index 00000000..88bec6b6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_uchar_simple.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_uchar_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uchar_t = OpTypeInt 8 0 +%uchar_ptr_t = OpTypePointer CrossWorkgroup %uchar_t +%func_t = OpTypeFunction %void_t %uchar_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %uchar_t 19 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uchar_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %uchar_ptr_t %inptr %idx +%out_val = OpCopyObject %uchar_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_uint_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_uint_simple.spvasm32 new file mode 100644 index 00000000..7e96279a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_uint_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_uint_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uint_t = OpTypeInt 32 0 +%uint_ptr_t = OpTypePointer CrossWorkgroup %uint_t +%func_t = OpTypeFunction %void_t %uint_ptr_t +%val = OpConstant %uint_t 54321 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uint_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %uint_ptr_t %inptr %idx +%out_val = OpCopyObject %uint_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_uint_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_uint_simple.spvasm64 new file mode 100644 index 00000000..61b70281 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_uint_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_uint_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uint_t = OpTypeInt 32 0 +%uint_ptr_t = OpTypePointer CrossWorkgroup %uint_t +%func_t = OpTypeFunction %void_t %uint_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %uint_t 54321 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uint_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %uint_ptr_t %inptr %idx +%out_val = OpCopyObject %uint_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_ulong_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_ulong_simple.spvasm32 new file mode 100644 index 00000000..8135e14b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_ulong_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_ulong_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ulong_t = OpTypeInt 64 0 +%ulong_ptr_t = OpTypePointer CrossWorkgroup %ulong_t +%func_t = OpTypeFunction %void_t %ulong_ptr_t +%val = OpConstant %ulong_t 9223372036854775810 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ulong_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %ulong_ptr_t %inptr %idx +%out_val = OpCopyObject %ulong_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_ulong_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_ulong_simple.spvasm64 new file mode 100644 index 00000000..37cdc1f4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_ulong_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_ulong_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ulong_t = OpTypeInt 64 0 +%ulong_ptr_t = OpTypePointer CrossWorkgroup %ulong_t +%func_t = OpTypeFunction %void_t %ulong_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %ulong_t 9223372036854775810 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ulong_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %ulong_ptr_t %inptr %idx +%out_val = OpCopyObject %ulong_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_ushort_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/copy_ushort_simple.spvasm32 new file mode 100644 index 00000000..091e3e4b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_ushort_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "copy_ushort_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ushort_t = OpTypeInt 16 0 +%ushort_ptr_t = OpTypePointer CrossWorkgroup %ushort_t +%func_t = OpTypeFunction %void_t %ushort_ptr_t +%val = OpConstant %ushort_t 65000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ushort_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %ushort_ptr_t %inptr %idx +%out_val = OpCopyObject %ushort_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/copy_ushort_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/copy_ushort_simple.spvasm64 new file mode 100644 index 00000000..2aa5e122 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/copy_ushort_simple.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "copy_ushort_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ushort_t = OpTypeInt 16 0 +%ushort_ptr_t = OpTypePointer CrossWorkgroup %ushort_t +%func_t = OpTypeFunction %void_t %ushort_ptr_t +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %ushort_t 65000 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ushort_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %ushort_ptr_t %inptr %idx +%out_val = OpCopyObject %ushort_t %val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_aliased.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_aliased.spvasm32 new file mode 100644 index 00000000..bd6e575a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_aliased.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_aliased" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Aliased +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_aliased.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_aliased.spvasm64 new file mode 100644 index 00000000..beb2842a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_aliased.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_aliased" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Aliased +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_alignment.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_alignment.spvasm32 new file mode 100644 index 00000000..48960abe --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_alignment.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_alignment" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Alignment 4 +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_alignment.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_alignment.spvasm64 new file mode 100644 index 00000000..980e74b6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_alignment.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_alignment" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Alignment 4 +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_coherent.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_coherent.spvasm32 new file mode 100644 index 00000000..718fb36a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_coherent.spvasm32 @@ -0,0 +1,75 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %15 "decorate_coherent" + OpName %5 "sampler" + OpName %8 "__spirv_BuiltInGlobalInvocationId" + OpName %9 "__spirv_BuiltInGlobalSize" + OpName %16 "dst" + OpName %17 "src" + OpName %18 "entry" + OpName %20 "call" + OpName %22 "call1" + OpName %24 "call2" + OpName %25 "mul" + OpName %26 "add" + OpName %29 "vecinit" + OpName %30 "vecinit6" + OpName %34 "TempSampledImage" + OpName %35 "call7.old" + OpName %38 "arrayidx" + OpDecorate %17 Coherent + OpDecorate %39 Constant +%39 = OpDecorationGroup + OpDecorate %8 BuiltIn GlobalInvocationId + OpDecorate %9 BuiltIn GlobalSize + OpDecorate %16 FuncParamAttr NoCapture + OpDecorate %5 LinkageAttributes "sampler" Export + OpDecorate %9 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %8 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %5 Alignment 4 + OpGroupDecorate %39 %5 %8 %9 + %2 = OpTypeInt 32 0 + %3 = OpConstant %2 16 + %4 = OpTypePointer UniformConstant %2 + %6 = OpTypeVector %2 3 + %7 = OpTypePointer UniformConstant %6 +%10 = OpTypeVoid +%11 = OpTypeVector %2 4 +%12 = OpTypePointer CrossWorkgroup %11 +%13 = OpTypeImage %10 2D 0 0 0 0 Unknown +%14 = OpTypeFunction %10 %12 %13 +%27 = OpTypeVector %2 2 +%31 = OpTypeSampler +%33 = OpTypeSampledImage %13 +%36 = OpTypeFloat 32 +%32 = OpConstantSampler %31 None 0 Nearest +%37 = OpConstant %36 0 + %5 = OpVariable %4 UniformConstant %3 + %8 = OpVariable %7 UniformConstant + %9 = OpVariable %7 UniformConstant +%15 = OpFunction %10 None %14 +%16 = OpFunctionParameter %12 +%17 = OpFunctionParameter %13 +%18 = OpLabel +%28 = OpUndef %27 +%19 = OpLoad %6 %8 Aligned 0 +%20 = OpCompositeExtract %2 %19 0 +%21 = OpLoad %6 %8 Aligned 0 +%22 = OpCompositeExtract %2 %21 1 +%23 = OpLoad %6 %9 Aligned 0 +%24 = OpCompositeExtract %2 %23 0 +%25 = OpIMul %2 %24 %22 +%26 = OpIAdd %2 %25 %20 +%29 = OpCompositeInsert %27 %22 %28 0 +%30 = OpCompositeInsert %27 %20 %29 1 +%34 = OpSampledImage %33 %17 %32 +%35 = OpImageSampleExplicitLod %11 %34 %30 Lod %37 +%38 = OpInBoundsPtrAccessChain %12 %16 %26 + OpStore %38 %35 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_coherent.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_coherent.spvasm64 new file mode 100644 index 00000000..60604b24 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_coherent.spvasm64 @@ -0,0 +1,88 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %16 "decorate_coherent" + OpName %5 "sampler" + OpName %9 "__spirv_BuiltInGlobalInvocationId" + OpName %10 "__spirv_BuiltInGlobalSize" + OpName %17 "dst" + OpName %18 "src" + OpName %19 "entry" + OpName %21 "call" + OpName %22 "conv" + OpName %24 "call1" + OpName %25 "conv2" + OpName %26 "conv3" + OpName %28 "call4" + OpName %29 "mul" + OpName %30 "add" + OpName %33 "vecinit" + OpName %34 "vecinit10" + OpName %38 "TempSampledImage" + OpName %39 "call11.old" + OpName %43 "sext" + OpName %44 "idxprom" + OpName %45 "arrayidx" + OpDecorate %18 Coherent + OpDecorate %46 Constant +%46 = OpDecorationGroup + OpDecorate %9 BuiltIn GlobalInvocationId + OpDecorate %10 BuiltIn GlobalSize + OpDecorate %17 FuncParamAttr NoCapture + OpDecorate %5 LinkageAttributes "sampler" Export + OpDecorate %10 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %9 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %5 Alignment 4 + OpGroupDecorate %46 %5 %9 %10 + %2 = OpTypeInt 32 0 + %6 = OpTypeInt 64 0 + %3 = OpConstant %2 16 +%42 = OpConstant %6 32 + %4 = OpTypePointer UniformConstant %2 + %7 = OpTypeVector %6 3 + %8 = OpTypePointer UniformConstant %7 +%11 = OpTypeVoid +%12 = OpTypeVector %2 4 +%13 = OpTypePointer CrossWorkgroup %12 +%14 = OpTypeImage %11 2D 0 0 0 0 Unknown +%15 = OpTypeFunction %11 %13 %14 +%31 = OpTypeVector %2 2 +%35 = OpTypeSampler +%37 = OpTypeSampledImage %14 +%40 = OpTypeFloat 32 +%36 = OpConstantSampler %35 None 0 Nearest +%41 = OpConstant %40 0 + %5 = OpVariable %4 UniformConstant %3 + %9 = OpVariable %8 UniformConstant +%10 = OpVariable %8 UniformConstant +%16 = OpFunction %11 None %15 +%17 = OpFunctionParameter %13 +%18 = OpFunctionParameter %14 +%19 = OpLabel +%32 = OpUndef %31 +%20 = OpLoad %7 %9 Aligned 0 +%21 = OpCompositeExtract %6 %20 0 +%22 = OpUConvert %2 %21 +%23 = OpLoad %7 %9 Aligned 0 +%24 = OpCompositeExtract %6 %23 1 +%25 = OpUConvert %2 %24 +%26 = OpSConvert %6 %25 +%27 = OpLoad %7 %10 Aligned 0 +%28 = OpCompositeExtract %6 %27 0 +%29 = OpIMul %6 %26 %28 +%30 = OpIAdd %6 %29 %21 +%33 = OpCompositeInsert %31 %25 %32 0 +%34 = OpCompositeInsert %31 %22 %33 1 +%38 = OpSampledImage %37 %18 %36 +%39 = OpImageSampleExplicitLod %12 %38 %34 Lod %41 +%43 = OpShiftLeftLogical %6 %30 %42 +%44 = OpShiftRightArithmetic %6 %43 %42 +%45 = OpInBoundsPtrAccessChain %13 %17 %44 + OpStore %45 %39 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_constant.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_constant.spvasm32 new file mode 100644 index 00000000..1f01838f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_constant.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_constant" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Constant +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %lhs %rhs +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_constant.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_constant.spvasm64 new file mode 100644 index 00000000..dff1925a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_constant.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_constant" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Constant +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %lhs %rhs +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_constant_fail.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_constant_fail.spvasm32 new file mode 100644 index 00000000..ab91da33 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_constant_fail.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_constant" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Constant +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_constant_fail.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_constant_fail.spvasm64 new file mode 100644 index 00000000..1c4bd986 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_constant_fail.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_constant" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Constant +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_cpacked.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_cpacked.spvasm32 new file mode 100644 index 00000000..d8aa11d3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_cpacked.spvasm32 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_cpacked" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %struct_t CPacked +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 127 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_cpacked.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_cpacked.spvasm64 new file mode 100644 index 00000000..a4600c16 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_cpacked.spvasm64 @@ -0,0 +1,38 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_cpacked" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %struct_t CPacked +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%int_val = OpConstant %int_t 2100483600 +%char_val = OpConstant %char_t 127 +%struct_val = OpConstantComposite %struct_t %int_val %char_val +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_nonreadable.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_nonreadable.spvasm32 new file mode 100644 index 00000000..8cc21d31 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_nonreadable.spvasm32 @@ -0,0 +1,61 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %12 "decorate_nonreadable" + OpSource OpenCL_C 100000 + OpName %5 "__spirv_BuiltInGlobalInvocationId" + OpName %6 "__spirv_BuiltInGlobalSize" + OpName %13 "dst" + OpName %14 "src" + OpName %15 "entry" + OpName %17 "call" + OpName %19 "call1" + OpName %21 "call2" + OpName %22 "mul" + OpName %23 "add" + OpName %26 "vecinit" + OpName %27 "vecinit3" + OpName %28 "arrayidx" + OpDecorate %13 NonReadable + OpDecorate %30 Constant +%30 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %6 BuiltIn GlobalSize + OpDecorate %14 FuncParamAttr NoCapture + OpDecorate %6 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %5 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %30 %5 %6 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %7 = OpTypeVoid + %8 = OpTypeImage %7 2D 0 0 0 0 Unknown WriteOnly + %9 = OpTypeVector %2 4 +%10 = OpTypePointer CrossWorkgroup %9 +%11 = OpTypeFunction %7 %8 %10 +%24 = OpTypeVector %2 2 + %5 = OpVariable %4 UniformConstant + %6 = OpVariable %4 UniformConstant +%12 = OpFunction %7 None %11 +%13 = OpFunctionParameter %8 +%14 = OpFunctionParameter %10 +%15 = OpLabel +%25 = OpUndef %24 +%16 = OpLoad %3 %5 Aligned 0 +%17 = OpCompositeExtract %2 %16 0 +%18 = OpLoad %3 %5 Aligned 0 +%19 = OpCompositeExtract %2 %18 1 +%20 = OpLoad %3 %6 Aligned 0 +%21 = OpCompositeExtract %2 %20 0 +%22 = OpIMul %2 %21 %19 +%23 = OpIAdd %2 %22 %17 +%26 = OpCompositeInsert %24 %19 %25 0 +%27 = OpCompositeInsert %24 %17 %26 1 +%28 = OpInBoundsPtrAccessChain %10 %14 %23 +%29 = OpLoad %9 %28 Aligned 16 + OpImageWrite %13 %27 %29 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_nonreadable.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_nonreadable.spvasm64 new file mode 100644 index 00000000..71b2a26b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_nonreadable.spvasm64 @@ -0,0 +1,74 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %13 "decorate_nonreadable" + OpSource OpenCL_C 100000 + OpName %5 "__spirv_BuiltInGlobalInvocationId" + OpName %6 "__spirv_BuiltInGlobalSize" + OpName %14 "dst" + OpName %15 "src" + OpName %16 "entry" + OpName %18 "call" + OpName %19 "conv" + OpName %21 "call1" + OpName %22 "conv2" + OpName %23 "conv3" + OpName %25 "call4" + OpName %26 "mul" + OpName %27 "add" + OpName %30 "vecinit" + OpName %31 "vecinit7" + OpName %33 "sext" + OpName %34 "idxprom" + OpName %35 "arrayidx" + OpDecorate %14 NonReadable + OpDecorate %37 Constant +%37 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %6 BuiltIn GlobalSize + OpDecorate %15 FuncParamAttr NoCapture + OpDecorate %6 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %5 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %37 %5 %6 + %2 = OpTypeInt 64 0 + %9 = OpTypeInt 32 0 +%32 = OpConstant %2 32 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %7 = OpTypeVoid + %8 = OpTypeImage %7 2D 0 0 0 0 Unknown WriteOnly +%10 = OpTypeVector %9 4 +%11 = OpTypePointer CrossWorkgroup %10 +%12 = OpTypeFunction %7 %8 %11 +%28 = OpTypeVector %9 2 + %5 = OpVariable %4 UniformConstant + %6 = OpVariable %4 UniformConstant +%13 = OpFunction %7 None %12 +%14 = OpFunctionParameter %8 +%15 = OpFunctionParameter %11 +%16 = OpLabel +%29 = OpUndef %28 +%17 = OpLoad %3 %5 Aligned 0 +%18 = OpCompositeExtract %2 %17 0 +%19 = OpUConvert %9 %18 +%20 = OpLoad %3 %5 Aligned 0 +%21 = OpCompositeExtract %2 %20 1 +%22 = OpUConvert %9 %21 +%23 = OpSConvert %2 %22 +%24 = OpLoad %3 %6 Aligned 0 +%25 = OpCompositeExtract %2 %24 0 +%26 = OpIMul %2 %23 %25 +%27 = OpIAdd %2 %26 %18 +%30 = OpCompositeInsert %28 %22 %29 0 +%31 = OpCompositeInsert %28 %19 %30 1 +%33 = OpShiftLeftLogical %2 %27 %32 +%34 = OpShiftRightArithmetic %2 %33 %32 +%35 = OpInBoundsPtrAccessChain %11 %15 %34 +%36 = OpLoad %10 %35 Aligned 16 + OpImageWrite %14 %31 %36 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_nonwritable.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_nonwritable.spvasm32 new file mode 100644 index 00000000..b7ae2793 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_nonwritable.spvasm32 @@ -0,0 +1,75 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %15 "decorate_nonwritable" + OpName %5 "sampler" + OpName %8 "__spirv_BuiltInGlobalInvocationId" + OpName %9 "__spirv_BuiltInGlobalSize" + OpName %16 "dst" + OpName %17 "src" + OpName %18 "entry" + OpName %20 "call" + OpName %22 "call1" + OpName %24 "call2" + OpName %25 "mul" + OpName %26 "add" + OpName %29 "vecinit" + OpName %30 "vecinit6" + OpName %34 "TempSampledImage" + OpName %35 "call7.old" + OpName %38 "arrayidx" + OpDecorate %17 NonWritable + OpDecorate %39 Constant +%39 = OpDecorationGroup + OpDecorate %8 BuiltIn GlobalInvocationId + OpDecorate %9 BuiltIn GlobalSize + OpDecorate %16 FuncParamAttr NoCapture + OpDecorate %5 LinkageAttributes "sampler" Export + OpDecorate %9 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %8 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %5 Alignment 4 + OpGroupDecorate %39 %5 %8 %9 + %2 = OpTypeInt 32 0 + %3 = OpConstant %2 16 + %4 = OpTypePointer UniformConstant %2 + %6 = OpTypeVector %2 3 + %7 = OpTypePointer UniformConstant %6 +%10 = OpTypeVoid +%11 = OpTypeVector %2 4 +%12 = OpTypePointer CrossWorkgroup %11 +%13 = OpTypeImage %10 2D 0 0 0 0 Unknown ReadOnly +%14 = OpTypeFunction %10 %12 %13 +%27 = OpTypeVector %2 2 +%31 = OpTypeSampler +%33 = OpTypeSampledImage %13 +%36 = OpTypeFloat 32 +%32 = OpConstantSampler %31 None 0 Nearest +%37 = OpConstant %36 0 + %5 = OpVariable %4 UniformConstant %3 + %8 = OpVariable %7 UniformConstant + %9 = OpVariable %7 UniformConstant +%15 = OpFunction %10 None %14 +%16 = OpFunctionParameter %12 +%17 = OpFunctionParameter %13 +%18 = OpLabel +%28 = OpUndef %27 +%19 = OpLoad %6 %8 Aligned 0 +%20 = OpCompositeExtract %2 %19 0 +%21 = OpLoad %6 %8 Aligned 0 +%22 = OpCompositeExtract %2 %21 1 +%23 = OpLoad %6 %9 Aligned 0 +%24 = OpCompositeExtract %2 %23 0 +%25 = OpIMul %2 %24 %22 +%26 = OpIAdd %2 %25 %20 +%29 = OpCompositeInsert %27 %22 %28 0 +%30 = OpCompositeInsert %27 %20 %29 1 +%34 = OpSampledImage %33 %17 %32 +%35 = OpImageSampleExplicitLod %11 %34 %30 Lod %37 +%38 = OpInBoundsPtrAccessChain %12 %16 %26 + OpStore %38 %35 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_nonwritable.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_nonwritable.spvasm64 new file mode 100644 index 00000000..fca00d84 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_nonwritable.spvasm64 @@ -0,0 +1,88 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %16 "decorate_nonwritable" + OpName %5 "sampler" + OpName %9 "__spirv_BuiltInGlobalInvocationId" + OpName %10 "__spirv_BuiltInGlobalSize" + OpName %17 "dst" + OpName %18 "src" + OpName %19 "entry" + OpName %21 "call" + OpName %22 "conv" + OpName %24 "call1" + OpName %25 "conv2" + OpName %26 "conv3" + OpName %28 "call4" + OpName %29 "mul" + OpName %30 "add" + OpName %33 "vecinit" + OpName %34 "vecinit10" + OpName %38 "TempSampledImage" + OpName %39 "call11.old" + OpName %43 "sext" + OpName %44 "idxprom" + OpName %45 "arrayidx" + OpDecorate %18 NonWritable + OpDecorate %46 Constant +%46 = OpDecorationGroup + OpDecorate %9 BuiltIn GlobalInvocationId + OpDecorate %10 BuiltIn GlobalSize + OpDecorate %17 FuncParamAttr NoCapture + OpDecorate %5 LinkageAttributes "sampler" Export + OpDecorate %10 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %9 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %5 Alignment 4 + OpGroupDecorate %46 %5 %9 %10 + %2 = OpTypeInt 32 0 + %6 = OpTypeInt 64 0 + %3 = OpConstant %2 16 +%42 = OpConstant %6 32 + %4 = OpTypePointer UniformConstant %2 + %7 = OpTypeVector %6 3 + %8 = OpTypePointer UniformConstant %7 +%11 = OpTypeVoid +%12 = OpTypeVector %2 4 +%13 = OpTypePointer CrossWorkgroup %12 +%14 = OpTypeImage %11 2D 0 0 0 0 Unknown ReadOnly +%15 = OpTypeFunction %11 %13 %14 +%31 = OpTypeVector %2 2 +%35 = OpTypeSampler +%37 = OpTypeSampledImage %14 +%40 = OpTypeFloat 32 +%36 = OpConstantSampler %35 None 0 Nearest +%41 = OpConstant %40 0 + %5 = OpVariable %4 UniformConstant %3 + %9 = OpVariable %8 UniformConstant +%10 = OpVariable %8 UniformConstant +%16 = OpFunction %11 None %15 +%17 = OpFunctionParameter %13 +%18 = OpFunctionParameter %14 +%19 = OpLabel +%32 = OpUndef %31 +%20 = OpLoad %7 %9 Aligned 0 +%21 = OpCompositeExtract %6 %20 0 +%22 = OpUConvert %2 %21 +%23 = OpLoad %7 %9 Aligned 0 +%24 = OpCompositeExtract %6 %23 1 +%25 = OpUConvert %2 %24 +%26 = OpSConvert %6 %25 +%27 = OpLoad %7 %10 Aligned 0 +%28 = OpCompositeExtract %6 %27 0 +%29 = OpIMul %6 %26 %28 +%30 = OpIAdd %6 %29 %21 +%33 = OpCompositeInsert %31 %25 %32 0 +%34 = OpCompositeInsert %31 %22 %33 1 +%38 = OpSampledImage %37 %18 %36 +%39 = OpImageSampleExplicitLod %12 %38 %34 Lod %41 +%43 = OpShiftLeftLogical %6 %30 %42 +%44 = OpShiftRightArithmetic %6 %43 %42 +%45 = OpInBoundsPtrAccessChain %13 %17 %44 + OpStore %45 %39 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_restrict.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_restrict.spvasm32 new file mode 100644 index 00000000..a8f002b5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_restrict.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_restrict" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Restrict +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_restrict.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_restrict.spvasm64 new file mode 100644 index 00000000..470d8bed --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_restrict.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_restrict" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %dec_group Restrict +%dec_group = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec_group %res %lhs %rhs +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %int_ptr_t +%rhs = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %lhs %idx +%lhs_val = OpLoad %int_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %int_ptr_t %rhs %idx +%rhs_val = OpLoad %int_t %rhs_curr Aligned 4 +%res_val = OpIAdd %int_t %lhs_val %rhs_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_double_long.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_double_long.spvasm32 new file mode 100644 index 00000000..341f6d9e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_double_long.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rte_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTE +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_double_long.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_double_long.spvasm64 new file mode 100644 index 00000000..3ec0b291 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_double_long.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rte_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTE +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_float_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_float_int.spvasm32 new file mode 100644 index 00000000..d9ed3545 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_float_int.spvasm32 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rte_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTE +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_float_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_float_int.spvasm64 new file mode 100644 index 00000000..15cda593 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rte_float_int.spvasm64 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rte_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTE +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_double_long.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_double_long.spvasm32 new file mode 100644 index 00000000..f314a0fd --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_double_long.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtn_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTN +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_double_long.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_double_long.spvasm64 new file mode 100644 index 00000000..419b8afa --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_double_long.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtn_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTN +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_float_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_float_int.spvasm32 new file mode 100644 index 00000000..d5c1b854 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_float_int.spvasm32 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtn_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTN +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_float_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_float_int.spvasm64 new file mode 100644 index 00000000..a66855f0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtn_float_int.spvasm64 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtn_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTN +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_double_long.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_double_long.spvasm32 new file mode 100644 index 00000000..abadb9b6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_double_long.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtp_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTP +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_double_long.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_double_long.spvasm64 new file mode 100644 index 00000000..2e47c119 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_double_long.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtp_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTP +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_float_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_float_int.spvasm32 new file mode 100644 index 00000000..bc3458af --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_float_int.spvasm32 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtp_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTP +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_float_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_float_int.spvasm64 new file mode 100644 index 00000000..59c11604 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtp_float_int.spvasm64 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtp_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTP +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_double_long.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_double_long.spvasm32 new file mode 100644 index 00000000..7bb34ddf --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_double_long.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtz_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTZ +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_double_long.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_double_long.spvasm64 new file mode 100644 index 00000000..90fbb2d5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_double_long.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtz_double_long" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTZ +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 64 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_float_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_float_int.spvasm32 new file mode 100644 index 00000000..fe726197 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_float_int.spvasm32 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtz_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val FPRoundingMode RTZ +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%res_val = OpConvertFToS %int_t %in_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_float_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_float_int.spvasm64 new file mode 100644 index 00000000..f3dda3b8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_rounding_rtz_float_int.spvasm64 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_rounding_rtz_float_int" + OpName %out "res" + OpName %in "in" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %out_val FPRoundingMode RTZ +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out = OpFunctionParameter %int_ptr_t +%in = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_curr = OpInBoundsPtrAccessChain %float_ptr_t %in %idx +%in_val = OpLoad %float_t %in_curr Aligned 4 +%out_val = OpConvertFToS %int_t %in_val +%out_curr = OpInBoundsPtrAccessChain %int_ptr_t %out %idx + OpStore %out_curr %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_char.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_char.spvasm32 new file mode 100644 index 00000000..58ac84aa --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_char.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_char" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 8 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToS %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_char.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_char.spvasm64 new file mode 100644 index 00000000..82d7cd5d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_char.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_char" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 8 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToS %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_int.spvasm32 new file mode 100644 index 00000000..d50fcaee --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_int.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_int" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToS %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_int.spvasm64 new file mode 100644 index 00000000..737aa0ab --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_int.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_int" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToS %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_short.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_short.spvasm32 new file mode 100644 index 00000000..abff4a7b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_short.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_short" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 16 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToS %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_short.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_short.spvasm64 new file mode 100644 index 00000000..54e82f47 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_short.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_short" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 16 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToS %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uchar.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uchar.spvasm32 new file mode 100644 index 00000000..2f9b5a9e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uchar.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_uchar" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 8 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToU %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uchar.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uchar.spvasm64 new file mode 100644 index 00000000..77f6af0c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uchar.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_uchar" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 8 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToU %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uint.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uint.spvasm32 new file mode 100644 index 00000000..352d61b5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uint.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_uint" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToU %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uint.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uint.spvasm64 new file mode 100644 index 00000000..10067f8a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_uint.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_uint" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 64 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToS %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_ushort.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_ushort.spvasm32 new file mode 100644 index 00000000..bdc56e7d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_ushort.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_ushort" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 16 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToU %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_ushort.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_ushort.spvasm64 new file mode 100644 index 00000000..81f341be --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_saturated_conversion_ushort.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "decorate_saturated_conversion_ushort" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %res_val SaturatedConversion +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 16 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %int_ptr_t %float_ptr_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %int_ptr_t +%lhs = OpFunctionParameter %float_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %lhs %idx +%lhs_val = OpLoad %float_t %lhs_curr Aligned 4 +%rhs_curr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_curr Aligned 4 +%float_val = OpFMul %float_t %lhs_val %rhs_val +%res_val = OpConvertFToU %int_t %float_val +%res_curr = OpInBoundsPtrAccessChain %int_ptr_t %res %idx + OpStore %res_curr %res_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_volatile.spvasm32 b/test_conformance/spirv_new/spirv_txt/decorate_volatile.spvasm32 new file mode 100644 index 00000000..c86b54b0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_volatile.spvasm32 @@ -0,0 +1,75 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %15 "decorate_volatile" + OpName %5 "sampler" + OpName %8 "__spirv_BuiltInGlobalInvocationId" + OpName %9 "__spirv_BuiltInGlobalSize" + OpName %16 "dst" + OpName %17 "src" + OpName %18 "entry" + OpName %20 "call" + OpName %22 "call1" + OpName %24 "call2" + OpName %25 "mul" + OpName %26 "add" + OpName %29 "vecinit" + OpName %30 "vecinit6" + OpName %34 "TempSampledImage" + OpName %35 "call7.old" + OpName %38 "arrayidx" + OpDecorate %17 Volatile + OpDecorate %39 Constant +%39 = OpDecorationGroup + OpDecorate %8 BuiltIn GlobalInvocationId + OpDecorate %9 BuiltIn GlobalSize + OpDecorate %16 FuncParamAttr NoCapture + OpDecorate %5 LinkageAttributes "sampler" Export + OpDecorate %9 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %8 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %5 Alignment 4 + OpGroupDecorate %39 %5 %8 %9 + %2 = OpTypeInt 32 0 + %3 = OpConstant %2 16 + %4 = OpTypePointer UniformConstant %2 + %6 = OpTypeVector %2 3 + %7 = OpTypePointer UniformConstant %6 +%10 = OpTypeVoid +%11 = OpTypeVector %2 4 +%12 = OpTypePointer CrossWorkgroup %11 +%13 = OpTypeImage %10 2D 0 0 0 0 Unknown +%14 = OpTypeFunction %10 %12 %13 +%27 = OpTypeVector %2 2 +%31 = OpTypeSampler +%33 = OpTypeSampledImage %13 +%36 = OpTypeFloat 32 +%32 = OpConstantSampler %31 None 0 Nearest +%37 = OpConstant %36 0 + %5 = OpVariable %4 UniformConstant %3 + %8 = OpVariable %7 UniformConstant + %9 = OpVariable %7 UniformConstant +%15 = OpFunction %10 None %14 +%16 = OpFunctionParameter %12 +%17 = OpFunctionParameter %13 +%18 = OpLabel +%28 = OpUndef %27 +%19 = OpLoad %6 %8 Aligned 0 +%20 = OpCompositeExtract %2 %19 0 +%21 = OpLoad %6 %8 Aligned 0 +%22 = OpCompositeExtract %2 %21 1 +%23 = OpLoad %6 %9 Aligned 0 +%24 = OpCompositeExtract %2 %23 0 +%25 = OpIMul %2 %24 %22 +%26 = OpIAdd %2 %25 %20 +%29 = OpCompositeInsert %27 %22 %28 0 +%30 = OpCompositeInsert %27 %20 %29 1 +%34 = OpSampledImage %33 %17 %32 +%35 = OpImageSampleExplicitLod %11 %34 %30 Lod %37 +%38 = OpInBoundsPtrAccessChain %12 %16 %26 + OpStore %38 %35 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/decorate_volatile.spvasm64 b/test_conformance/spirv_new/spirv_txt/decorate_volatile.spvasm64 new file mode 100644 index 00000000..0f32fba4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/decorate_volatile.spvasm64 @@ -0,0 +1,88 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability ImageBasic + OpCapability LiteralSampler + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %16 "decorate_volatile" + OpName %5 "sampler" + OpName %9 "__spirv_BuiltInGlobalInvocationId" + OpName %10 "__spirv_BuiltInGlobalSize" + OpName %17 "dst" + OpName %18 "src" + OpName %19 "entry" + OpName %21 "call" + OpName %22 "conv" + OpName %24 "call1" + OpName %25 "conv2" + OpName %26 "conv3" + OpName %28 "call4" + OpName %29 "mul" + OpName %30 "add" + OpName %33 "vecinit" + OpName %34 "vecinit10" + OpName %38 "TempSampledImage" + OpName %39 "call11.old" + OpName %43 "sext" + OpName %44 "idxprom" + OpName %45 "arrayidx" + OpDecorate %18 Volatile + OpDecorate %46 Constant +%46 = OpDecorationGroup + OpDecorate %9 BuiltIn GlobalInvocationId + OpDecorate %10 BuiltIn GlobalSize + OpDecorate %17 FuncParamAttr NoCapture + OpDecorate %5 LinkageAttributes "sampler" Export + OpDecorate %10 LinkageAttributes "__spirv_BuiltInGlobalSize" Import + OpDecorate %9 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %5 Alignment 4 + OpGroupDecorate %46 %5 %9 %10 + %2 = OpTypeInt 32 0 + %6 = OpTypeInt 64 0 + %3 = OpConstant %2 16 +%42 = OpConstant %6 32 + %4 = OpTypePointer UniformConstant %2 + %7 = OpTypeVector %6 3 + %8 = OpTypePointer UniformConstant %7 +%11 = OpTypeVoid +%12 = OpTypeVector %2 4 +%13 = OpTypePointer CrossWorkgroup %12 +%14 = OpTypeImage %11 2D 0 0 0 0 Unknown +%15 = OpTypeFunction %11 %13 %14 +%31 = OpTypeVector %2 2 +%35 = OpTypeSampler +%37 = OpTypeSampledImage %14 +%40 = OpTypeFloat 32 +%36 = OpConstantSampler %35 None 0 Nearest +%41 = OpConstant %40 0 + %5 = OpVariable %4 UniformConstant %3 + %9 = OpVariable %8 UniformConstant +%10 = OpVariable %8 UniformConstant +%16 = OpFunction %11 None %15 +%17 = OpFunctionParameter %13 +%18 = OpFunctionParameter %14 +%19 = OpLabel +%32 = OpUndef %31 +%20 = OpLoad %7 %9 Aligned 0 +%21 = OpCompositeExtract %6 %20 0 +%22 = OpUConvert %2 %21 +%23 = OpLoad %7 %9 Aligned 0 +%24 = OpCompositeExtract %6 %23 1 +%25 = OpUConvert %2 %24 +%26 = OpSConvert %6 %25 +%27 = OpLoad %7 %10 Aligned 0 +%28 = OpCompositeExtract %6 %27 0 +%29 = OpIMul %6 %26 %28 +%30 = OpIAdd %6 %29 %21 +%33 = OpCompositeInsert %31 %25 %32 0 +%34 = OpCompositeInsert %31 %22 %33 1 +%38 = OpSampledImage %37 %18 %36 +%39 = OpImageSampleExplicitLod %12 %38 %34 Lod %41 +%43 = OpShiftLeftLogical %6 %30 %42 +%44 = OpShiftRightArithmetic %6 %43 %42 +%45 = OpInBoundsPtrAccessChain %13 %17 %44 + OpStore %45 %39 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm32 new file mode 100644 index 00000000..48f43e63 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %22 FuncParamAttr NoWrite + %22 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %20 NoSignedWrap + OpGroupDecorate %22 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIAdd %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm64 new file mode 100644 index 00000000..3b8b253a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_int.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %27 FuncParamAttr NoWrite + %27 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %24 NoSignedWrap + OpGroupDecorate %27 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIAdd %uint %20 %23 + %25 = OpSConvert %ulong %17 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25 + OpStore %26 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm32 new file mode 100644 index 00000000..15bdb61a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %22 FuncParamAttr NoWrite + %22 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %20 NoUnsignedWrap + OpGroupDecorate %22 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIAdd %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm64 new file mode 100644 index 00000000..528bd587 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fadd_uint.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %27 FuncParamAttr NoWrite + %27 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %24 NoUnsignedWrap + OpGroupDecorate %27 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIAdd %uint %20 %23 + %25 = OpSConvert %ulong %17 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25 + OpStore %26 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm32 new file mode 100644 index 00000000..f20ec4fe --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %22 FuncParamAttr NoWrite + %22 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %20 NoSignedWrap + OpGroupDecorate %22 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIMul %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm64 new file mode 100644 index 00000000..5ee04af3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_int.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %27 FuncParamAttr NoWrite + %27 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %24 NoSignedWrap + OpGroupDecorate %27 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIMul %uint %20 %23 + %25 = OpSConvert %ulong %17 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25 + OpStore %26 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm32 new file mode 100644 index 00000000..2bf9532d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %22 FuncParamAttr NoWrite + %22 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %20 NoUnsignedWrap + OpGroupDecorate %22 %lhs %rhs + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpIMul %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm64 new file mode 100644 index 00000000..a41bc23b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fmul_uint.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %27 FuncParamAttr NoWrite + %27 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %24 NoUnsignedWrap + OpGroupDecorate %27 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpIMul %uint %20 %23 + %25 = OpSConvert %ulong %17 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25 + OpStore %26 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm32 new file mode 100644 index 00000000..d8ec6666 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 22 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %21 FuncParamAttr NoWrite + OpDecorate %19 NoSignedWrap + %21 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %21 %lhs %rhs + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %19 = OpSNegate %uint %17 + %20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %20 %19 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm64 new file mode 100644 index 00000000..7fa68c15 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fnegate_int.spvasm64 @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 26 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %25 FuncParamAttr NoWrite + OpDecorate %22 NoSignedWrap + %25 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %25 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %22 = OpSNegate %uint %20 + %23 = OpSConvert %ulong %17 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %23 + OpStore %24 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm32 new file mode 100644 index 00000000..b4993029 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm32 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %24 FuncParamAttr NoWrite + %24 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %22 NoSignedWrap + OpGroupDecorate %24 %lhs %rhs + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %21 = OpBitwiseAnd %uint %19 %uint_31 + %22 = OpShiftLeftLogical %uint %17 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm64 new file mode 100644 index 00000000..eaac7975 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_int.spvasm64 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 30 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %29 FuncParamAttr NoWrite + %29 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %26 NoSignedWrap + OpGroupDecorate %29 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %25 = OpBitwiseAnd %uint %23 %uint_31 + %26 = OpShiftLeftLogical %uint %20 %25 + %27 = OpSConvert %ulong %17 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %27 + OpStore %28 %26 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm32 new file mode 100644 index 00000000..be3cbd10 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm32 @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %24 FuncParamAttr NoWrite + %24 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %22 NoUnsignedWrap + OpGroupDecorate %24 %lhs %rhs + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %21 = OpBitwiseAnd %uint %19 %uint_31 + %22 = OpShiftLeftLogical %uint %17 %21 + %23 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %23 %22 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm64 new file mode 100644 index 00000000..92c1b68a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fshiftleft_uint.spvasm64 @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 30 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %29 FuncParamAttr NoWrite + %29 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpDecorate %26 NoUnsignedWrap + OpGroupDecorate %29 %lhs %rhs + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %uint_31 = OpConstant %uint 31 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %25 = OpBitwiseAnd %uint %23 %uint_31 + %26 = OpShiftLeftLogical %uint %20 %25 + %27 = OpSConvert %ulong %17 + %28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %27 + OpStore %28 %26 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm32 new file mode 100644 index 00000000..af43596a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %22 FuncParamAttr NoWrite + %22 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %22 %lhs %rhs + OpDecorate %20 NoSignedWrap + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpISub %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm64 new file mode 100644 index 00000000..8c60c5dd --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_int.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %27 FuncParamAttr NoWrite + %27 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %27 %lhs %rhs + OpDecorate %24 NoSignedWrap + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpISub %uint %20 %23 + %25 = OpSConvert %ulong %17 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25 + OpStore %26 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm32 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm32 new file mode 100644 index 00000000..bbf232b9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm32 @@ -0,0 +1,47 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 23 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %9 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %22 FuncParamAttr NoWrite + %22 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %22 %lhs %rhs + OpDecorate %20 NoUnsignedWrap + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3uint UniformConstant + %9 = OpFunction %void None %8 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %13 = OpLabel + %14 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId + %15 = OpCompositeExtract %uint %14 0 + %16 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %15 + %17 = OpLoad %uint %16 Aligned 4 + %18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %15 + %19 = OpLoad %uint %18 Aligned 4 + %20 = OpISub %uint %17 %19 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %15 + OpStore %21 %20 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm64 b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm64 new file mode 100644 index 00000000..f4245add --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/ext_cl_khr_spirv_no_integer_wrap_decoration_fsub_uint.spvasm64 @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos LLVM/SPIR-V Translator; 14 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_cl" + OpSource OpenCL_C 200000 + OpExtension "SPV_KHR_no_integer_wrap_decoration" + OpName %__spirv_BuiltInGlobalInvocationId "__spirv_BuiltInGlobalInvocationId" + OpName %out "out" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %27 FuncParamAttr NoWrite + %27 = OpDecorationGroup + OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId + OpDecorate %__spirv_BuiltInGlobalInvocationId Constant + OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import + OpGroupDecorate %27 %lhs %rhs + OpDecorate %24 NoUnsignedWrap + %ulong = OpTypeInt 64 0 + %uint = OpTypeInt 32 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong + %void = OpTypeVoid +%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint + %9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint +%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant + %10 = OpFunction %void None %9 + %out = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint + %14 = OpLabel + %15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId + %16 = OpCompositeExtract %ulong %15 0 + %17 = OpUConvert %uint %16 + %18 = OpSConvert %ulong %17 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %18 + %20 = OpLoad %uint %19 Aligned 4 + %21 = OpSConvert %ulong %17 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21 + %23 = OpLoad %uint %22 Aligned 4 + %24 = OpISub %uint %20 %23 + %25 = OpSConvert %ulong %17 + %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %out %25 + OpStore %26 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/fadd_double.spvasm32 new file mode 100644 index 00000000..89095c1e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_double.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 8 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 8 +%21 = OpFAdd %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/fadd_double.spvasm64 new file mode 100644 index 00000000..5157bdb2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_double.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 8 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 8 +%24 = OpFAdd %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_double2.spvasm32 b/test_conformance/spirv_new/spirv_txt/fadd_double2.spvasm32 new file mode 100644 index 00000000..3ec0b375 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_double2.spvasm32 @@ -0,0 +1,42 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %72 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %72 %19 Aligned 16 +%21 = OpFAdd %72 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_double2.spvasm64 b/test_conformance/spirv_new/spirv_txt/fadd_double2.spvasm64 new file mode 100644 index 00000000..d7c811c8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_double2.spvasm64 @@ -0,0 +1,46 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %72 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %72 %22 Aligned 16 +%24 = OpFAdd %72 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/fadd_float.spvasm32 new file mode 100644 index 00000000..82d84e0b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_float.spvasm32 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 4 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 4 +%21 = OpFAdd %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/fadd_float.spvasm64 new file mode 100644 index 00000000..c13094a3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_float.spvasm64 @@ -0,0 +1,44 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 4 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 4 +%24 = OpFAdd %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_float4.spvasm32 b/test_conformance/spirv_new/spirv_txt/fadd_float4.spvasm32 new file mode 100644 index 00000000..1f831368 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_float4.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %74 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %74 %19 Aligned 16 +%21 = OpFAdd %74 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_float4.spvasm64 b/test_conformance/spirv_new/spirv_txt/fadd_float4.spvasm64 new file mode 100644 index 00000000..eb7ecd5c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_float4.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %74 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %74 %22 Aligned 16 +%24 = OpFAdd %74 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_half.spvasm32 b/test_conformance/spirv_new/spirv_txt/fadd_half.spvasm32 new file mode 100644 index 00000000..ab351a61 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_half.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 +%21 = OpFAdd %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fadd_half.spvasm64 b/test_conformance/spirv_new/spirv_txt/fadd_half.spvasm64 new file mode 100644 index 00000000..fd60259e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fadd_half.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 +%24 = OpFAdd %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/fdiv_double.spvasm32 new file mode 100644 index 00000000..bc73e689 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_double.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 8 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 8 +%21 = OpFDiv %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/fdiv_double.spvasm64 new file mode 100644 index 00000000..c3abc9c0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_double.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 8 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 8 +%24 = OpFDiv %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_double2.spvasm32 b/test_conformance/spirv_new/spirv_txt/fdiv_double2.spvasm32 new file mode 100644 index 00000000..9bad4fa5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_double2.spvasm32 @@ -0,0 +1,42 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %72 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %72 %19 Aligned 16 +%21 = OpFDiv %72 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_double2.spvasm64 b/test_conformance/spirv_new/spirv_txt/fdiv_double2.spvasm64 new file mode 100644 index 00000000..660370c0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_double2.spvasm64 @@ -0,0 +1,46 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %72 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %72 %22 Aligned 16 +%24 = OpFDiv %72 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/fdiv_float.spvasm32 new file mode 100644 index 00000000..f00aae44 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_float.spvasm32 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 4 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 4 +%21 = OpFDiv %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/fdiv_float.spvasm64 new file mode 100644 index 00000000..903eeedc --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_float.spvasm64 @@ -0,0 +1,44 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 4 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 4 +%24 = OpFDiv %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_float4.spvasm32 b/test_conformance/spirv_new/spirv_txt/fdiv_float4.spvasm32 new file mode 100644 index 00000000..7b81eab3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_float4.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %74 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %74 %19 Aligned 16 +%21 = OpFDiv %74 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_float4.spvasm64 b/test_conformance/spirv_new/spirv_txt/fdiv_float4.spvasm64 new file mode 100644 index 00000000..84156f48 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_float4.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %74 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %74 %22 Aligned 16 +%24 = OpFDiv %74 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_half.spvasm32 b/test_conformance/spirv_new/spirv_txt/fdiv_half.spvasm32 new file mode 100644 index 00000000..3c455c83 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_half.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 +%21 = OpFDiv %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fdiv_half.spvasm64 b/test_conformance/spirv_new/spirv_txt/fdiv_half.spvasm64 new file mode 100644 index 00000000..a5b77a06 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fdiv_half.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 +%24 = OpFDiv %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmod_double.spvasm32 new file mode 100644 index 00000000..fc3478cd --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_double.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 8 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 8 +%21 = OpFMod %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmod_double.spvasm64 new file mode 100644 index 00000000..ec9cf22f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_double.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 8 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 8 +%24 = OpFMod %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_double2.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmod_double2.spvasm32 new file mode 100644 index 00000000..52016890 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_double2.spvasm32 @@ -0,0 +1,42 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %72 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %72 %19 Aligned 16 +%21 = OpFMod %72 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_double2.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmod_double2.spvasm64 new file mode 100644 index 00000000..197313ee --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_double2.spvasm64 @@ -0,0 +1,46 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %72 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %72 %22 Aligned 16 +%24 = OpFMod %72 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmod_float.spvasm32 new file mode 100644 index 00000000..bdcbc288 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_float.spvasm32 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 4 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 4 +%21 = OpFMod %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmod_float.spvasm64 new file mode 100644 index 00000000..ccdb529a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_float.spvasm64 @@ -0,0 +1,44 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 4 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 4 +%24 = OpFMod %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_float4.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmod_float4.spvasm32 new file mode 100644 index 00000000..aa9a6fdf --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_float4.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %74 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %74 %19 Aligned 16 +%21 = OpFMod %74 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_float4.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmod_float4.spvasm64 new file mode 100644 index 00000000..1ec4ba08 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_float4.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %74 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %74 %22 Aligned 16 +%24 = OpFMod %74 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_half.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmod_half.spvasm32 new file mode 100644 index 00000000..86f00ca2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_half.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 +%21 = OpFMod %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmod_half.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmod_half.spvasm64 new file mode 100644 index 00000000..e7513d5a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmod_half.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 +%24 = OpFMod %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmul_double.spvasm32 new file mode 100644 index 00000000..bfd8f688 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_double.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 8 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 8 +%21 = OpFMul %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmul_double.spvasm64 new file mode 100644 index 00000000..aaed39b5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_double.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 8 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 8 +%24 = OpFMul %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_double2.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmul_double2.spvasm32 new file mode 100644 index 00000000..43606f3a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_double2.spvasm32 @@ -0,0 +1,42 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %72 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %72 %19 Aligned 16 +%21 = OpFMul %72 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_double2.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmul_double2.spvasm64 new file mode 100644 index 00000000..58314895 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_double2.spvasm64 @@ -0,0 +1,46 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %72 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %72 %22 Aligned 16 +%24 = OpFMul %72 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmul_float.spvasm32 new file mode 100644 index 00000000..4a7439aa --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_float.spvasm32 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 4 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 4 +%21 = OpFMul %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmul_float.spvasm64 new file mode 100644 index 00000000..11e72097 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_float.spvasm64 @@ -0,0 +1,44 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 4 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 4 +%24 = OpFMul %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_float4.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmul_float4.spvasm32 new file mode 100644 index 00000000..0ddcf0d9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_float4.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %74 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %74 %19 Aligned 16 +%21 = OpFMul %74 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_float4.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmul_float4.spvasm64 new file mode 100644 index 00000000..0d656e09 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_float4.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %74 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %74 %22 Aligned 16 +%24 = OpFMul %74 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_half.spvasm32 b/test_conformance/spirv_new/spirv_txt/fmul_half.spvasm32 new file mode 100644 index 00000000..0aa2d7b8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_half.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 +%21 = OpFMul %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fmul_half.spvasm64 b/test_conformance/spirv_new/spirv_txt/fmul_half.spvasm64 new file mode 100644 index 00000000..56b52b6f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fmul_half.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 +%24 = OpFMul %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/frem_double.spvasm32 new file mode 100644 index 00000000..782e1cad --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_double.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 8 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 8 +%21 = OpFRem %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/frem_double.spvasm64 new file mode 100644 index 00000000..76e03c3c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_double.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 8 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 8 +%24 = OpFRem %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_double2.spvasm32 b/test_conformance/spirv_new/spirv_txt/frem_double2.spvasm32 new file mode 100644 index 00000000..271615af --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_double2.spvasm32 @@ -0,0 +1,42 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %72 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %72 %19 Aligned 16 +%21 = OpFRem %72 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_double2.spvasm64 b/test_conformance/spirv_new/spirv_txt/frem_double2.spvasm64 new file mode 100644 index 00000000..2d09838e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_double2.spvasm64 @@ -0,0 +1,46 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %72 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %72 %22 Aligned 16 +%24 = OpFRem %72 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/frem_float.spvasm32 new file mode 100644 index 00000000..133fe786 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_float.spvasm32 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 4 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 4 +%21 = OpFRem %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/frem_float.spvasm64 new file mode 100644 index 00000000..5a5e9078 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_float.spvasm64 @@ -0,0 +1,44 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 4 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 4 +%24 = OpFRem %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_float4.spvasm32 b/test_conformance/spirv_new/spirv_txt/frem_float4.spvasm32 new file mode 100644 index 00000000..8e5032cc --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_float4.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %74 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %74 %19 Aligned 16 +%21 = OpFRem %74 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_float4.spvasm64 b/test_conformance/spirv_new/spirv_txt/frem_float4.spvasm64 new file mode 100644 index 00000000..5e8deb09 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_float4.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %74 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %74 %22 Aligned 16 +%24 = OpFRem %74 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_half.spvasm32 b/test_conformance/spirv_new/spirv_txt/frem_half.spvasm32 new file mode 100644 index 00000000..3b0a79e8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_half.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 +%21 = OpFRem %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/frem_half.spvasm64 b/test_conformance/spirv_new/spirv_txt/frem_half.spvasm64 new file mode 100644 index 00000000..774d96d1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/frem_half.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 +%24 = OpFRem %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/fsub_double.spvasm32 new file mode 100644 index 00000000..24e3d60f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_double.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 8 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 8 +%21 = OpFSub %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/fsub_double.spvasm64 new file mode 100644 index 00000000..ce2fce68 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_double.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 8 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 8 +%24 = OpFSub %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 8 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_double2.spvasm32 b/test_conformance/spirv_new/spirv_txt/fsub_double2.spvasm32 new file mode 100644 index 00000000..738f7479 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_double2.spvasm32 @@ -0,0 +1,42 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %72 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %72 %19 Aligned 16 +%21 = OpFSub %72 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_double2.spvasm64 b/test_conformance/spirv_new/spirv_txt/fsub_double2.spvasm64 new file mode 100644 index 00000000..3e010b2f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_double2.spvasm64 @@ -0,0 +1,46 @@ + OpCapability Float64 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 64 +%72 = OpTypeVector %7 2 + %8 = OpTypePointer CrossWorkgroup %72 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %72 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %72 %22 Aligned 16 +%24 = OpFSub %72 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/fsub_float.spvasm32 new file mode 100644 index 00000000..48200b66 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_float.spvasm32 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 Aligned 4 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 Aligned 4 +%21 = OpFSub %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/fsub_float.spvasm64 new file mode 100644 index 00000000..ccfc8619 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_float.spvasm64 @@ -0,0 +1,44 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 Aligned 4 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 Aligned 4 +%24 = OpFSub %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_float4.spvasm32 b/test_conformance/spirv_new/spirv_txt/fsub_float4.spvasm32 new file mode 100644 index 00000000..e3ad63e0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_float4.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %74 %17 Aligned 16 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %74 %19 Aligned 16 +%21 = OpFSub %74 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_float4.spvasm64 b/test_conformance/spirv_new/spirv_txt/fsub_float4.spvasm64 new file mode 100644 index 00000000..65615bdc --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_float4.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 32 +%74 = OpTypeVector %7 4 + %8 = OpTypePointer CrossWorkgroup %74 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %74 %20 Aligned 16 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %74 %22 Aligned 16 +%24 = OpFSub %74 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_half.spvasm32 b/test_conformance/spirv_new/spirv_txt/fsub_half.spvasm32 new file mode 100644 index 00000000..3531c662 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_half.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %23 FuncParamAttr NoCapture +%23 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %23 %11 %12 %13 + %2 = OpTypeInt 32 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%17 = OpInBoundsPtrAccessChain %8 %12 %16 +%18 = OpLoad %7 %17 +%19 = OpInBoundsPtrAccessChain %8 %13 %16 +%20 = OpLoad %7 %19 +%21 = OpFSub %7 %18 %20 +%22 = OpInBoundsPtrAccessChain %8 %11 %16 + OpStore %22 %21 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/fsub_half.spvasm64 b/test_conformance/spirv_new/spirv_txt/fsub_half.spvasm64 new file mode 100644 index 00000000..b9335f9b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/fsub_half.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + %1 = OpExtInstImport "OpenCL.std" + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %10 "fmath_spv" + OpName %11 "res" + OpName %12 "lhs" + OpName %13 "rhs" + OpName %14 "entry" + OpDecorate %26 FuncParamAttr NoCapture +%26 = OpDecorationGroup + OpDecorate %5 BuiltIn GlobalInvocationId + OpDecorate %5 Constant + OpDecorate %5 LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %26 %11 %12 %13 + %2 = OpTypeInt 64 0 + %3 = OpTypeVector %2 3 + %4 = OpTypePointer UniformConstant %3 + %6 = OpTypeVoid + %7 = OpTypeFloat 16 + %8 = OpTypePointer CrossWorkgroup %7 + %9 = OpTypeFunction %6 %8 %8 %8 +%17 = OpConstant %2 32 + %5 = OpVariable %4 UniformConstant +%10 = OpFunction %6 None %9 +%11 = OpFunctionParameter %8 +%12 = OpFunctionParameter %8 +%13 = OpFunctionParameter %8 +%14 = OpLabel +%15 = OpLoad %3 %5 Aligned 0 +%16 = OpCompositeExtract %2 %15 0 +%18 = OpShiftLeftLogical %2 %16 %17 +%19 = OpShiftRightArithmetic %2 %18 %17 +%20 = OpInBoundsPtrAccessChain %8 %12 %19 +%21 = OpLoad %7 %20 +%22 = OpInBoundsPtrAccessChain %8 %13 %19 +%23 = OpLoad %7 %22 +%24 = OpFSub %7 %21 %23 +%25 = OpInBoundsPtrAccessChain %8 %11 %19 + OpStore %25 %24 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/label_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/label_simple.spvasm32 new file mode 100644 index 00000000..cddd1dcc --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/label_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "label_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%outptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current_in = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%current_out = OpInBoundsPtrAccessChain %int_ptr_t %outptr %idx +%val = OpLoad %int_t %current_in + OpStore %current_out %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/label_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/label_simple.spvasm64 new file mode 100644 index 00000000..36724fb8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/label_simple.spvasm64 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "label_simple" + OpName %inptr "in" + OpName %outptr "out" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%outptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current_in = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%current_out = OpInBoundsPtrAccessChain %int_ptr_t %outptr %idx +%val = OpLoad %int_t %current_in + OpStore %current_out %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/lifetime_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/lifetime_simple.spvasm32 new file mode 100644 index 00000000..bdac8db4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/lifetime_simple.spvasm32 @@ -0,0 +1,46 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "lifetime_simple" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%tmp = OpVariable %tmp_ptr_t Function +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%sub_val = OpISub %int_t %lhs_val %rhs_val + OpLifetimeStart %tmp 0 + OpStore %tmp %sub_val +%out_val = OpLoad %int_t %tmp + OpLifetimeStop %tmp 0 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/lifetime_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/lifetime_simple.spvasm64 new file mode 100644 index 00000000..3a9d39aa --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/lifetime_simple.spvasm64 @@ -0,0 +1,50 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "lifetime_simple" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%tmp = OpVariable %tmp_ptr_t Function +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%sub_val = OpISub %int_t %lhs_val %rhs_val + OpLifetimeStart %tmp 0 + OpStore %tmp %sub_val +%out_val = OpLoad %int_t %tmp + OpLifetimeStop %tmp 0 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/linkage_export.spvasm32 b/test_conformance/spirv_new/spirv_txt/linkage_export.spvasm32 new file mode 100644 index 00000000..3f715805 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/linkage_export.spvasm32 @@ -0,0 +1,15 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpName %local_func "simple_fnegate_linkage" + OpDecorate %local_func LinkageAttributes "simple_fnegate_linkage" Export +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%local_func_t = OpTypeFunction %float_t %float_t +%local_func = OpFunction %float_t Const %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/linkage_export.spvasm64 b/test_conformance/spirv_new/spirv_txt/linkage_export.spvasm64 new file mode 100644 index 00000000..a76618b2 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/linkage_export.spvasm64 @@ -0,0 +1,15 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical64 OpenCL + OpName %local_func "simple_fnegate_linkage" + OpDecorate %local_func LinkageAttributes "simple_fnegate_linkage" Export +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%local_func_t = OpTypeFunction %float_t %float_t +%local_func = OpFunction %float_t Const %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/linkage_import.spvasm32 b/test_conformance/spirv_new/spirv_txt/linkage_import.spvasm32 new file mode 100644 index 00000000..f2364969 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/linkage_import.spvasm32 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "test_linkage" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %local_func LinkageAttributes "simple_fnegate_linkage" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Const %local_func_t +%local_in = OpFunctionParameter %float_t + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/linkage_import.spvasm64 b/test_conformance/spirv_new/spirv_txt/linkage_import.spvasm64 new file mode 100644 index 00000000..bc3f9403 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/linkage_import.spvasm64 @@ -0,0 +1,38 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "test_linkage" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %local_func LinkageAttributes "simple_fnegate_linkage" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Const %local_func_t +%local_in = OpFunctionParameter %float_t + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_dont_unroll.spvasm32 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_dont_unroll.spvasm32 new file mode 100644 index 00000000..141c33d7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_dont_unroll.spvasm32 @@ -0,0 +1,67 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_conditional_dont_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpLoopMerge %block_end %block_cont DontUnroll + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_dont_unroll.spvasm64 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_dont_unroll.spvasm64 new file mode 100644 index 00000000..99b01596 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_dont_unroll.spvasm64 @@ -0,0 +1,71 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_conditional_dont_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpLoopMerge %block_end %block_cont DontUnroll + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_none.spvasm32 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_none.spvasm32 new file mode 100644 index 00000000..ad91cba3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_none.spvasm32 @@ -0,0 +1,67 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_conditional_none" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpLoopMerge %block_end %block_cont None + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_none.spvasm64 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_none.spvasm64 new file mode 100644 index 00000000..867aeb21 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_none.spvasm64 @@ -0,0 +1,71 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_conditional_none" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpLoopMerge %block_end %block_cont None + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_unroll.spvasm32 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_unroll.spvasm32 new file mode 100644 index 00000000..2c4ed91c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_unroll.spvasm32 @@ -0,0 +1,67 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_conditional_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpLoopMerge %block_end %block_cont Unroll + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_unroll.spvasm64 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_unroll.spvasm64 new file mode 100644 index 00000000..da3ccd76 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_conditional_unroll.spvasm64 @@ -0,0 +1,71 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_conditional_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpLoopMerge %block_end %block_cont Unroll + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_dont_unroll.spvasm32 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_dont_unroll.spvasm32 new file mode 100644 index 00000000..0e981b3b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_dont_unroll.spvasm32 @@ -0,0 +1,69 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_dont_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel + OpLoopMerge %block_end %block_cont DontUnroll + OpBranch %block_check +%block_check = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_dont_unroll.spvasm64 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_dont_unroll.spvasm64 new file mode 100644 index 00000000..b7022fce --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_dont_unroll.spvasm64 @@ -0,0 +1,73 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_dont_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel + OpLoopMerge %block_end %block_cont DontUnroll + OpBranch %block_check +%block_check = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_none.spvasm32 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_none.spvasm32 new file mode 100644 index 00000000..89711e43 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_none.spvasm32 @@ -0,0 +1,69 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_none" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel + OpLoopMerge %block_end %block_cont None + OpBranch %block_check +%block_check = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_none.spvasm64 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_none.spvasm64 new file mode 100644 index 00000000..ce1fad65 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_none.spvasm64 @@ -0,0 +1,73 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_none" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel + OpLoopMerge %block_end %block_cont None + OpBranch %block_check +%block_check = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_unroll.spvasm32 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_unroll.spvasm32 new file mode 100644 index 00000000..b6497816 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_unroll.spvasm32 @@ -0,0 +1,69 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel + OpLoopMerge %block_end %block_cont Unroll + OpBranch %block_check +%block_check = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/loop_merge_branch_unroll.spvasm64 b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_unroll.spvasm64 new file mode 100644 index 00000000..ee8cc809 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/loop_merge_branch_unroll.spvasm64 @@ -0,0 +1,73 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "loop_merge_branch_unroll" + OpName %out_ptr "res" + OpName %in_ptr "in" + OpName %rep_val "rep" + OpName %num_val "num" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %in_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_t %int_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%in_ptr = OpFunctionParameter %int_ptr_t +%rep_val = OpFunctionParameter %int_t +%num_val = OpFunctionParameter %int_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%idx_int = OpSConvert %int_t %idx +%tmp_val_ptr = OpVariable %tmp_ptr_t Function +%tmp_idx_ptr = OpVariable %tmp_ptr_t Function + OpStore %tmp_val_ptr %int_zero Aligned 4 + OpStore %tmp_idx_ptr %int_zero Aligned 4 + OpBranch %block_loop +%block_loop = OpLabel + OpLoopMerge %block_end %block_cont Unroll + OpBranch %block_check +%block_check = OpLabel +%tmp_idx = OpLoad %int_t %tmp_idx_ptr +%compare = OpSLessThan %bool_t %tmp_idx %rep_val + OpBranchConditional %compare %block_calc %block_end +%block_calc = OpLabel +%calc_idx = OpLoad %int_t %tmp_idx_ptr +%calc_off = OpIMul %int_t %calc_idx %num_val +%in_idx = OpIAdd %int_t %idx_int %calc_off +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %in_idx +%in_val = OpLoad %int_t %in_loc +%tmp_val = OpLoad %int_t %tmp_val_ptr +%res_val = OpIAdd %int_t %tmp_val %in_val + OpStore %tmp_val_ptr %res_val Aligned 4 + OpBranch %block_cont +%block_cont = OpLabel +%tmp_idx_c = OpLoad %int_t %tmp_idx_ptr +%tmp_idx_inc = OpIAdd %int_t %tmp_idx_c %int_one + OpStore %tmp_idx_ptr %tmp_idx_inc + OpBranch %block_loop +%block_end = OpLabel +%out_val = OpLoad %int_t %tmp_val_ptr +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_const.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_function_const.spvasm32 new file mode 100644 index 00000000..32f96e8f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_const.spvasm32 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_function_const" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Const %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_const.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_function_const.spvasm64 new file mode 100644 index 00000000..a9b64c8c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_const.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_function_const" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Const %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_inline.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_function_inline.spvasm32 new file mode 100644 index 00000000..cfed803f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_inline.spvasm32 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_function_inline" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Inline %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_inline.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_function_inline.spvasm64 new file mode 100644 index 00000000..09a720fa --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_inline.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_function_inline" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Inline %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_noinline.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_function_noinline.spvasm32 new file mode 100644 index 00000000..721cc171 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_noinline.spvasm32 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_function_noinline" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t DontInline %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_noinline.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_function_noinline.spvasm64 new file mode 100644 index 00000000..e2d39821 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_noinline.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_function_noinline" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t DontInline %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_none.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_function_none.spvasm32 new file mode 100644 index 00000000..abd28543 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_none.spvasm32 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_function_none" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t None %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_none.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_function_none.spvasm64 new file mode 100644 index 00000000..0718d318 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_none.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_function_none" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t None %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_pure.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_function_pure.spvasm32 new file mode 100644 index 00000000..5a204b38 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_pure.spvasm32 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_function_pure" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Pure %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_pure.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_function_pure.spvasm64 new file mode 100644 index 00000000..ba6690fb --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_pure.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_function_pure" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Pure %local_func_t +%local_in = OpFunctionParameter %float_t +%local_label = OpLabel +%local_out = OpFNegate %float_t %local_in + OpReturnValue %local_out + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFunctionCall %float_t %local_func %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_pure_ptr.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_function_pure_ptr.spvasm32 new file mode 100644 index 00000000..99efd317 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_pure_ptr.spvasm32 @@ -0,0 +1,48 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_function_pure_ptr" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_ptr_t %idx_t +%store_func_t = OpTypeFunction %void_t %float_ptr_t %idx_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Pure %local_func_t +%local_in_ptr = OpFunctionParameter %float_ptr_t +%local_idx = OpFunctionParameter %idx_t +%local_label = OpLabel +%local_in_off = OpInBoundsPtrAccessChain %float_ptr_t %local_in_ptr %local_idx +%local_in_val = OpLoad %float_t %local_in_off +%local_out = OpFNegate %float_t %local_in_val + OpReturnValue %local_out + OpFunctionEnd +%store_func = OpFunction %void_t None %store_func_t +%store_ptr = OpFunctionParameter %float_ptr_t +%store_idx = OpFunctionParameter %idx_t +%store_val = OpFunctionParameter %float_t +%store_label = OpLabel +%store_loc = OpInBoundsPtrAccessChain %float_ptr_t %store_ptr %store_idx + OpStore %store_loc %store_val + OpReturn + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%out_val = OpFunctionCall %float_t %local_func %inptr %idx +%void_val = OpFunctionCall %void_t %store_func %inptr %idx %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_function_pure_ptr.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_function_pure_ptr.spvasm64 new file mode 100644 index 00000000..41deaa0b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_function_pure_ptr.spvasm64 @@ -0,0 +1,51 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_function_pure_ptr" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%local_func_t = OpTypeFunction %float_t %float_ptr_t %idx_t +%store_func_t = OpTypeFunction %void_t %float_ptr_t %idx_t %float_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%local_func = OpFunction %float_t Pure %local_func_t +%local_in_ptr = OpFunctionParameter %float_ptr_t +%local_idx = OpFunctionParameter %idx_t +%local_label = OpLabel +%local_in_off = OpInBoundsPtrAccessChain %float_ptr_t %local_in_ptr %local_idx +%local_in_val = OpLoad %float_t %local_in_off +%local_out = OpFNegate %float_t %local_in_val + OpReturnValue %local_out + OpFunctionEnd +%store_func = OpFunction %void_t None %store_func_t +%store_ptr = OpFunctionParameter %float_ptr_t +%store_idx = OpFunctionParameter %idx_t +%store_val = OpFunctionParameter %float_t +%store_label = OpLabel +%store_loc = OpInBoundsPtrAccessChain %float_ptr_t %store_ptr %store_idx + OpStore %store_loc %store_val + OpReturn + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%out_val = OpFunctionCall %float_t %local_func %inptr %idx +%void_val = OpFunctionCall %void_t %store_func %inptr %idx %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_neg_double.spvasm32 new file mode 100644 index 00000000..38574392 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_double.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_neg_double" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx +%in_val = OpLoad %double_t %current +%out_val = OpFNegate %double_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_neg_double.spvasm64 new file mode 100644 index 00000000..5dcf9596 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_double.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_neg_double" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx +%in_val = OpLoad %double_t %current +%out_val = OpFNegate %double_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_neg_float.spvasm32 new file mode 100644 index 00000000..76bb0845 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_float.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_neg_float" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFNegate %float_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_neg_float.spvasm64 new file mode 100644 index 00000000..79173f6c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_float.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_neg_float" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx +%in_val = OpLoad %float_t %current +%out_val = OpFNegate %float_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_float4.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_neg_float4.spvasm32 new file mode 100644 index 00000000..2ca02d15 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_float4.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_neg_float4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float4_t = OpTypeVector %float_t 4 +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float4_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float4_ptr_t %inptr %idx +%in_val = OpLoad %float4_t %current +%out_val = OpFNegate %float4_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_float4.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_neg_float4.spvasm64 new file mode 100644 index 00000000..06d3512e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_float4.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_neg_float4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float4_t = OpTypeVector %float_t 4 +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float4_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float4_ptr_t %inptr %idx +%in_val = OpLoad %float4_t %current +%out_val = OpFNegate %float4_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_neg_int.spvasm32 new file mode 100644 index 00000000..279e08f8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_int.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_neg_int" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%in_val = OpLoad %int_t %current +%out_val = OpSNegate %int_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_neg_int.spvasm64 new file mode 100644 index 00000000..541ccf64 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_int.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_neg_int" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%in_val = OpLoad %int_t %current +%out_val = OpSNegate %int_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_int4.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_neg_int4.spvasm32 new file mode 100644 index 00000000..6da4969a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_int4.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_neg_int4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx +%in_val = OpLoad %int4_t %current +%out_val = OpSNegate %int4_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_int4.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_neg_int4.spvasm64 new file mode 100644 index 00000000..bf59317d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_int4.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_neg_int4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx +%in_val = OpLoad %int4_t %current +%out_val = OpSNegate %int4_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_long.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_neg_long.spvasm32 new file mode 100644 index 00000000..744d35ee --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_long.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_neg_long" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx +%in_val = OpLoad %long_t %current +%out_val = OpSNegate %long_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_long.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_neg_long.spvasm64 new file mode 100644 index 00000000..92a7754c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_long.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_neg_long" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx +%in_val = OpLoad %long_t %current +%out_val = OpSNegate %long_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_short.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_neg_short.spvasm32 new file mode 100644 index 00000000..0cee9354 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_short.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_neg_short" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx +%in_val = OpLoad %short_t %current +%out_val = OpSNegate %short_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_neg_short.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_neg_short.spvasm64 new file mode 100644 index 00000000..da69047f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_neg_short.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_neg_short" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx +%in_val = OpLoad %short_t %current +%out_val = OpSNegate %short_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_int.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_not_int.spvasm32 new file mode 100644 index 00000000..453c78e4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_int.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_not_int" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%in_val = OpLoad %int_t %current +%out_val = OpNot %int_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_int.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_not_int.spvasm64 new file mode 100644 index 00000000..78ff0943 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_int.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_not_int" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%in_val = OpLoad %int_t %current +%out_val = OpNot %int_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_int4.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_not_int4.spvasm32 new file mode 100644 index 00000000..68c5e9c6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_int4.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_not_int4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx +%in_val = OpLoad %int4_t %current +%out_val = OpNot %int4_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_int4.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_not_int4.spvasm64 new file mode 100644 index 00000000..ce4f2276 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_int4.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_not_int4" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx +%in_val = OpLoad %int4_t %current +%out_val = OpNot %int4_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_long.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_not_long.spvasm32 new file mode 100644 index 00000000..50323d25 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_long.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_not_long" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx +%in_val = OpLoad %long_t %current +%out_val = OpNot %long_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_long.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_not_long.spvasm64 new file mode 100644 index 00000000..cf51849f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_long.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_not_long" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx +%in_val = OpLoad %long_t %current +%out_val = OpNot %long_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_short.spvasm32 b/test_conformance/spirv_new/spirv_txt/op_not_short.spvasm32 new file mode 100644 index 00000000..a3c488f3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_short.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "op_not_short" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx +%in_val = OpLoad %short_t %current +%out_val = OpNot %short_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/op_not_short.spvasm64 b/test_conformance/spirv_new/spirv_txt/op_not_short.spvasm64 new file mode 100644 index 00000000..779c9b13 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/op_not_short.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "op_not_short" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx +%in_val = OpLoad %short_t %current +%out_val = OpNot %short_t %in_val + OpStore %current %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/opaque.spvasm32 b/test_conformance/spirv_new/spirv_txt/opaque.spvasm32 new file mode 100644 index 00000000..619563ab --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/opaque.spvasm32 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "opaque" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %opaque_store LinkageAttributes "opaque_store" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%opaque_t = OpTypeOpaque "opaque_t" +%opaque_ptr_t = OpTypePointer CrossWorkgroup %opaque_t +%val = OpConstant %float_t 3.1415927 +%func_t = OpTypeFunction %void_t %opaque_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%opaque_store_t = OpTypeFunction %void_t %opaque_ptr_t %idx_t %float_t +%opaque_store = OpFunction %void_t None %opaque_store_t +%opaque_store_in = OpFunctionParameter %opaque_ptr_t +%opaque_store_idx = OpFunctionParameter %idx_t +%opaque_store_val = OpFunctionParameter %float_t + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %opaque_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%return = OpFunctionCall %void_t %opaque_store %inptr %idx %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/opaque.spvasm64 b/test_conformance/spirv_new/spirv_txt/opaque.spvasm64 new file mode 100644 index 00000000..6a7875eb --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/opaque.spvasm64 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "opaque" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %opaque_store LinkageAttributes "opaque_store" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%shift_val = OpConstant %idx_t 32 +%val = OpConstant %float_t 3.1415927 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%opaque_t = OpTypeOpaque "opaque_t" +%opaque_ptr_t = OpTypePointer CrossWorkgroup %opaque_t +%func_t = OpTypeFunction %void_t %opaque_ptr_t +%opaque_store_t = OpTypeFunction %void_t %opaque_ptr_t %idx_t %float_t +%opaque_store = OpFunction %void_t None %opaque_store_t +%opaque_store_in = OpFunctionParameter %opaque_ptr_t +%opaque_store_idx = OpFunctionParameter %idx_t +%opaque_store_val = OpFunctionParameter %float_t + OpFunctionEnd +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %opaque_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%return = OpFunctionCall %void_t %opaque_store %inptr %idx %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/phi_2.spvasm32 b/test_conformance/spirv_new/spirv_txt/phi_2.spvasm32 new file mode 100644 index 00000000..44b55262 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/phi_2.spvasm32 @@ -0,0 +1,48 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "phi_2" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpBranch %block_phi +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpBranch %block_phi +%block_phi = OpLabel +%out_val = OpPhi %int_t %out1 %block1 %out2 %block2 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/phi_2.spvasm64 b/test_conformance/spirv_new/spirv_txt/phi_2.spvasm64 new file mode 100644 index 00000000..4ad0c2c0 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/phi_2.spvasm64 @@ -0,0 +1,52 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "phi_2" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpBranch %block_phi +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpBranch %block_phi +%block_phi = OpLabel +%out_val = OpPhi %int_t %out1 %block1 %out2 %block2 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/phi_3.spvasm32 b/test_conformance/spirv_new/spirv_txt/phi_3.spvasm32 new file mode 100644 index 00000000..381dc658 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/phi_3.spvasm32 @@ -0,0 +1,55 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "phi_3" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%cmp_val = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%compare1 = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare1 %block1 %block2 +%block1 = OpLabel +%compare2 = OpSLessThan %bool_t %lhs_val %cmp_val + OpBranchConditional %compare2 %block1_1 %block1_2 +%block1_1 = OpLabel +%out1_1 = OpISub %int_t %cmp_val %lhs_val + OpBranch %block_phi +%block1_2 = OpLabel +%out1_2 = OpISub %int_t %lhs_val %cmp_val + OpBranch %block_phi +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpBranch %block_phi +%block_phi = OpLabel +%out_val = OpPhi %int_t %out1_1 %block1_1 %out1_2 %block1_2 %out2 %block2 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/phi_3.spvasm64 b/test_conformance/spirv_new/spirv_txt/phi_3.spvasm64 new file mode 100644 index 00000000..8e4a99a7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/phi_3.spvasm64 @@ -0,0 +1,59 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "phi_3" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%shift_val = OpConstant %idx_t 32 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%cmp_val = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%compare1 = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare1 %block1 %block2 +%block1 = OpLabel +%compare2 = OpSLessThan %bool_t %lhs_val %cmp_val + OpBranchConditional %compare2 %block1_1 %block1_2 +%block1_1 = OpLabel +%out1_1 = OpISub %int_t %cmp_val %lhs_val + OpBranch %block_phi +%block1_2 = OpLabel +%out1_2 = OpISub %int_t %lhs_val %cmp_val + OpBranch %block_phi +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpBranch %block_phi +%block_phi = OpLabel +%out_val = OpPhi %int_t %out1_1 %block1_1 %out1_2 %block1_2 %out2 %block2 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/phi_4.spvasm32 b/test_conformance/spirv_new/spirv_txt/phi_4.spvasm32 new file mode 100644 index 00000000..3b841f20 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/phi_4.spvasm32 @@ -0,0 +1,61 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "phi_4" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%cmp_val = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%compare1 = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare1 %block1 %block2 +%block1 = OpLabel +%compare2 = OpSLessThan %bool_t %lhs_val %cmp_val + OpBranchConditional %compare2 %block1_1 %block1_2 +%block1_1 = OpLabel +%out1_1 = OpISub %int_t %cmp_val %lhs_val + OpBranch %block_phi +%block1_2 = OpLabel +%out1_2 = OpISub %int_t %lhs_val %cmp_val + OpBranch %block_phi +%block2 = OpLabel +%compare3 = OpSLessThan %bool_t %rhs_val %cmp_val + OpBranchConditional %compare3 %block2_1 %block2_2 +%block2_1 = OpLabel +%out2_1 = OpISub %int_t %cmp_val %rhs_val + OpBranch %block_phi +%block2_2 = OpLabel +%out2_2 = OpISub %int_t %rhs_val %cmp_val + OpBranch %block_phi +%block_phi = OpLabel +%out_val = OpPhi %int_t %out1_1 %block1_1 %out1_2 %block1_2 %out2_1 %block2_1 %out2_2 %block2_2 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/phi_4.spvasm64 b/test_conformance/spirv_new/spirv_txt/phi_4.spvasm64 new file mode 100644 index 00000000..79a8c9bd --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/phi_4.spvasm64 @@ -0,0 +1,65 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "phi_4" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%cmp_val = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%compare1 = OpSLessThan %bool_t %lhs_val %rhs_val + OpBranchConditional %compare1 %block1 %block2 +%block1 = OpLabel +%compare2 = OpSLessThan %bool_t %lhs_val %cmp_val + OpBranchConditional %compare2 %block1_1 %block1_2 +%block1_1 = OpLabel +%out1_1 = OpISub %int_t %cmp_val %lhs_val + OpBranch %block_phi +%block1_2 = OpLabel +%out1_2 = OpISub %int_t %lhs_val %cmp_val + OpBranch %block_phi +%block2 = OpLabel +%compare3 = OpSLessThan %bool_t %rhs_val %cmp_val + OpBranchConditional %compare3 %block2_1 %block2_2 +%block2_1 = OpLabel +%out2_1 = OpISub %int_t %cmp_val %rhs_val + OpBranch %block_phi +%block2_2 = OpLabel +%out2_2 = OpISub %int_t %rhs_val %cmp_val + OpBranch %block_phi +%block_phi = OpLabel +%out_val = OpPhi %int_t %out1_1 %block1_1 %out1_2 %block1_2 %out2_1 %block2_1 %out2_2 %block2_2 +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_if_dont_flatten.spvasm32 b/test_conformance/spirv_new/spirv_txt/select_if_dont_flatten.spvasm32 new file mode 100644 index 00000000..e3c45a37 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_if_dont_flatten.spvasm32 @@ -0,0 +1,54 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "select_if_dont_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpSelectionMerge %final_block DontFlatten + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_if_dont_flatten.spvasm64 b/test_conformance/spirv_new/spirv_txt/select_if_dont_flatten.spvasm64 new file mode 100644 index 00000000..e8566dac --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_if_dont_flatten.spvasm64 @@ -0,0 +1,59 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "select_if_dont_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpSelectionMerge %final_block DontFlatten + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_if_flatten.spvasm32 b/test_conformance/spirv_new/spirv_txt/select_if_flatten.spvasm32 new file mode 100644 index 00000000..81cc1f73 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_if_flatten.spvasm32 @@ -0,0 +1,54 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "select_if_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpSelectionMerge %final_block Flatten + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_if_flatten.spvasm64 b/test_conformance/spirv_new/spirv_txt/select_if_flatten.spvasm64 new file mode 100644 index 00000000..2a25ad1b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_if_flatten.spvasm64 @@ -0,0 +1,59 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "select_if_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpSelectionMerge %final_block Flatten + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_if_none.spvasm32 b/test_conformance/spirv_new/spirv_txt/select_if_none.spvasm32 new file mode 100644 index 00000000..aba05ba7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_if_none.spvasm32 @@ -0,0 +1,54 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "select_if_none" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpSelectionMerge %final_block None + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_if_none.spvasm64 b/test_conformance/spirv_new/spirv_txt/select_if_none.spvasm64 new file mode 100644 index 00000000..99de731c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_if_none.spvasm64 @@ -0,0 +1,59 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "select_if_none" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%compare = OpSLessThan %bool_t %lhs_val %rhs_val + OpSelectionMerge %final_block None + OpBranchConditional %compare %block1 %block2 +%block1 = OpLabel +%out1 = OpISub %int_t %rhs_val %lhs_val + OpStore %tmp %out1 + OpBranch %final_block +%block2 = OpLabel +%out2 = OpISub %int_t %lhs_val %rhs_val + OpStore %tmp %out2 + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_switch_dont_flatten.spvasm32 b/test_conformance/spirv_new/spirv_txt/select_switch_dont_flatten.spvasm32 new file mode 100644 index 00000000..618b0789 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_switch_dont_flatten.spvasm32 @@ -0,0 +1,63 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "select_switch_dont_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_two = OpConstant %int_t 2 +%int_three = OpConstant %int_t 3 +%int_four = OpConstant %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%add_val = OpIAdd %int_t %lhs_val %rhs_val +%selector = OpUMod %int_t %add_val %int_four + OpSelectionMerge %final_block DontFlatten + OpSwitch %selector %default 1 %block1 2 %block2 3 %block3 +%block1 = OpLabel + OpStore %tmp %int_one + OpBranch %final_block +%block2 = OpLabel + OpStore %tmp %int_two + OpBranch %final_block +%block3 = OpLabel + OpStore %tmp %int_three + OpBranch %final_block +%default = OpLabel + OpStore %tmp %int_zero + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_switch_dont_flatten.spvasm64 b/test_conformance/spirv_new/spirv_txt/select_switch_dont_flatten.spvasm64 new file mode 100644 index 00000000..54f154e4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_switch_dont_flatten.spvasm64 @@ -0,0 +1,68 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "select_switch_dont_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_two = OpConstant %int_t 2 +%int_three = OpConstant %int_t 3 +%int_four = OpConstant %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%add_val = OpIAdd %int_t %lhs_val %rhs_val +%selector = OpUMod %int_t %add_val %int_four + OpSelectionMerge %final_block DontFlatten + OpSwitch %selector %default 1 %block1 2 %block2 3 %block3 +%block1 = OpLabel + OpStore %tmp %int_one + OpBranch %final_block +%block2 = OpLabel + OpStore %tmp %int_two + OpBranch %final_block +%block3 = OpLabel + OpStore %tmp %int_three + OpBranch %final_block +%default = OpLabel + OpStore %tmp %int_zero + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_switch_flatten.spvasm32 b/test_conformance/spirv_new/spirv_txt/select_switch_flatten.spvasm32 new file mode 100644 index 00000000..d90af141 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_switch_flatten.spvasm32 @@ -0,0 +1,63 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "select_switch_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_two = OpConstant %int_t 2 +%int_three = OpConstant %int_t 3 +%int_four = OpConstant %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%add_val = OpIAdd %int_t %lhs_val %rhs_val +%selector = OpUMod %int_t %add_val %int_four + OpSelectionMerge %final_block Flatten + OpSwitch %selector %default 1 %block1 2 %block2 3 %block3 +%block1 = OpLabel + OpStore %tmp %int_one + OpBranch %final_block +%block2 = OpLabel + OpStore %tmp %int_two + OpBranch %final_block +%block3 = OpLabel + OpStore %tmp %int_three + OpBranch %final_block +%default = OpLabel + OpStore %tmp %int_zero + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_switch_flatten.spvasm64 b/test_conformance/spirv_new/spirv_txt/select_switch_flatten.spvasm64 new file mode 100644 index 00000000..41d408fd --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_switch_flatten.spvasm64 @@ -0,0 +1,68 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "select_switch_flatten" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_two = OpConstant %int_t 2 +%int_three = OpConstant %int_t 3 +%int_four = OpConstant %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%add_val = OpIAdd %int_t %lhs_val %rhs_val +%selector = OpUMod %int_t %add_val %int_four + OpSelectionMerge %final_block Flatten + OpSwitch %selector %default 1 %block1 2 %block2 3 %block3 +%block1 = OpLabel + OpStore %tmp %int_one + OpBranch %final_block +%block2 = OpLabel + OpStore %tmp %int_two + OpBranch %final_block +%block3 = OpLabel + OpStore %tmp %int_three + OpBranch %final_block +%default = OpLabel + OpStore %tmp %int_zero + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_switch_none.spvasm32 b/test_conformance/spirv_new/spirv_txt/select_switch_none.spvasm32 new file mode 100644 index 00000000..324e1ef1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_switch_none.spvasm32 @@ -0,0 +1,63 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "select_switch_none" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_two = OpConstant %int_t 2 +%int_three = OpConstant %int_t 3 +%int_four = OpConstant %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function +%add_val = OpIAdd %int_t %lhs_val %rhs_val +%selector = OpUMod %int_t %add_val %int_four + OpSelectionMerge %final_block None + OpSwitch %selector %default 1 %block1 2 %block2 3 %block3 +%block1 = OpLabel + OpStore %tmp %int_one + OpBranch %final_block +%block2 = OpLabel + OpStore %tmp %int_two + OpBranch %final_block +%block3 = OpLabel + OpStore %tmp %int_three + OpBranch %final_block +%default = OpLabel + OpStore %tmp %int_zero + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/select_switch_none.spvasm64 b/test_conformance/spirv_new/spirv_txt/select_switch_none.spvasm64 new file mode 100644 index 00000000..3357672f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/select_switch_none.spvasm64 @@ -0,0 +1,68 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "select_switch_none" + OpName %out_ptr "res" + OpName %lhs_ptr "lhs" + OpName %rhs_ptr "rhs" + OpDecorate %dec FuncParamAttr NoCapture +%dec = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %dec %out_ptr %lhs_ptr %rhs_ptr +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%bool_t = OpTypeBool +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%shift_val = OpConstant %idx_t 32 +%int_zero = OpConstant %int_t 0 +%int_one = OpConstant %int_t 1 +%int_two = OpConstant %int_t 2 +%int_three = OpConstant %int_t 3 +%int_four = OpConstant %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%tmp_ptr_t = OpTypePointer Function %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%out_ptr = OpFunctionParameter %int_ptr_t +%lhs_ptr = OpFunctionParameter %int_ptr_t +%rhs_ptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %lhs_ptr %idx +%lhs_val = OpLoad %int_t %lhs_loc Aligned 4 +%rhs_loc = OpInBoundsPtrAccessChain %int_ptr_t %rhs_ptr %idx +%rhs_val = OpLoad %int_t %rhs_loc Aligned 4 +%tmp = OpVariable %tmp_ptr_t Function + OpStore %tmp %int_zero +%add_val = OpIAdd %int_t %lhs_val %rhs_val +%selector = OpUMod %int_t %add_val %int_four + OpSelectionMerge %final_block None + OpSwitch %selector %default 1 %block1 2 %block2 3 %block3 +%block1 = OpLabel + OpStore %tmp %int_one + OpBranch %final_block +%block2 = OpLabel + OpStore %tmp %int_two + OpBranch %final_block +%block3 = OpLabel + OpStore %tmp %int_three + OpBranch %final_block +%default = OpLabel + OpStore %tmp %int_zero + OpBranch %final_block +%final_block = OpLabel +%out_val = OpLoad %int_t %tmp +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx + OpStore %out_loc %out_val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_char_simple.spvasm32 new file mode 100644 index 00000000..76ba3c4e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_char_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%func_t = OpTypeFunction %void_t %char_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %char_ptr_t +%entry = OpLabel +%val = OpUndef %char_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %char_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_char_simple.spvasm64 new file mode 100644 index 00000000..b1ac7771 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_char_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%func_t = OpTypeFunction %void_t %char_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %char_ptr_t +%entry = OpLabel +%val = OpUndef %char_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %char_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_double_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_double_simple.spvasm32 new file mode 100644 index 00000000..619fead8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_double_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_double_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%val = OpUndef %double_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_double_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_double_simple.spvasm64 new file mode 100644 index 00000000..aaa15963 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_double_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_double_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%func_t = OpTypeFunction %void_t %double_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%val = OpUndef %double_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %double_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_false_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_false_simple.spvasm32 new file mode 100644 index 00000000..d62f7334 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_false_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_false_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%bool_val = OpUndef %bool_t +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_false_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_false_simple.spvasm64 new file mode 100644 index 00000000..3f05d655 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_false_simple.spvasm64 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_false_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%bool_val = OpUndef %bool_t +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_float_simple.spvasm32 new file mode 100644 index 00000000..90f91c17 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_float_simple.spvasm32 @@ -0,0 +1,28 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%val = OpUndef %float_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_float_simple.spvasm64 new file mode 100644 index 00000000..b67a00e9 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_float_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%val = OpUndef %float_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_half_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_half_simple.spvasm32 new file mode 100644 index 00000000..df367bb5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_half_simple.spvasm32 @@ -0,0 +1,31 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_half_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%half_t = OpTypeFloat 16 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%half_val = OpUndef %half_t +%val = OpFConvert %float_t %half_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_half_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_half_simple.spvasm64 new file mode 100644 index 00000000..5d464ff7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_half_simple.spvasm64 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_half_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%half_t = OpTypeFloat 16 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%func_t = OpTypeFunction %void_t %float_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%half_val = OpUndef %half_t +%val = OpFConvert %float_t %half_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %float_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_int3_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_int3_simple.spvasm32 new file mode 100644 index 00000000..a2361a63 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_int3_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_int3_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int3_t = OpTypeVector %int_t 3 +%int3_ptr_t = OpTypePointer CrossWorkgroup %int3_t +%func_t = OpTypeFunction %void_t %int3_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int3_ptr_t +%entry = OpLabel +%vec = OpUndef %int3_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int3_ptr_t %inptr %idx + OpStore %current %vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_int3_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_int3_simple.spvasm64 new file mode 100644 index 00000000..9290f0d8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_int3_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_int3_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int3_t = OpTypeVector %int_t 3 +%int3_ptr_t = OpTypePointer CrossWorkgroup %int3_t +%func_t = OpTypeFunction %void_t %int3_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int3_ptr_t +%entry = OpLabel +%vec = OpUndef %int3_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int3_ptr_t %inptr %idx + OpStore %current %vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_int4_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_int4_simple.spvasm32 new file mode 100644 index 00000000..cac2954f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_int4_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_int4_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%vec = OpUndef %int4_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx + OpStore %current %vec Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_int4_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_int4_simple.spvasm64 new file mode 100644 index 00000000..dd4219a6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_int4_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_int4_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int4_ptr_t +%entry = OpLabel +%vec = OpUndef %int4_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int4_ptr_t %inptr %idx + OpStore %current %vec + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_int_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_int_simple.spvasm32 new file mode 100644 index 00000000..0cc5658f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_int_simple.spvasm32 @@ -0,0 +1,28 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_int_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%val = OpUndef %int_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_int_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_int_simple.spvasm64 new file mode 100644 index 00000000..f01ff94a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_int_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_int_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%val = OpUndef %int_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_long_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_long_simple.spvasm32 new file mode 100644 index 00000000..451f0174 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_long_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_long_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%val = OpUndef %long_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_long_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_long_simple.spvasm64 new file mode 100644 index 00000000..dcc12b9d --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_long_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_long_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%func_t = OpTypeFunction %void_t %long_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %long_ptr_t +%entry = OpLabel +%val = OpUndef %long_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %long_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_short_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_short_simple.spvasm32 new file mode 100644 index 00000000..d1213404 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_short_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_short_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%val = OpUndef %short_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_short_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_short_simple.spvasm64 new file mode 100644 index 00000000..e2256b8e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_short_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_short_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%short_t = OpTypeInt 16 0 +%short_ptr_t = OpTypePointer CrossWorkgroup %short_t +%func_t = OpTypeFunction %void_t %short_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %short_ptr_t +%entry = OpLabel +%val = OpUndef %short_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %short_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_struct_int_char_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_struct_int_char_simple.spvasm32 new file mode 100644 index 00000000..94c04e0f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_struct_int_char_simple.spvasm32 @@ -0,0 +1,31 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_struct_int_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct_val = OpUndef %struct_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_struct_int_char_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_struct_int_char_simple.spvasm64 new file mode 100644 index 00000000..f4b52052 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_struct_int_char_simple.spvasm64 @@ -0,0 +1,35 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_struct_int_char_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct_val = OpUndef %struct_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_struct_int_float_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_struct_int_float_simple.spvasm32 new file mode 100644 index 00000000..26161e22 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_struct_int_float_simple.spvasm32 @@ -0,0 +1,30 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_struct_int_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%float_t = OpTypeFloat 32 +%struct_t = OpTypeStruct %int_t %float_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct_val = OpUndef %struct_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_struct_int_float_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_struct_int_float_simple.spvasm64 new file mode 100644 index 00000000..dfb707f1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_struct_int_float_simple.spvasm64 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_struct_int_float_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%float_t = OpTypeFloat 32 +%struct_t = OpTypeStruct %int_t %float_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct_val = OpUndef %struct_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_struct_struct_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_struct_struct_simple.spvasm32 new file mode 100644 index 00000000..da1b5709 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_struct_struct_simple.spvasm32 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Kernel + OpCapability Linkage + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_struct_struct_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct2_val = OpUndef %struct2_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct2_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_struct_struct_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_struct_struct_simple.spvasm64 new file mode 100644 index 00000000..57d54dc1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_struct_struct_simple.spvasm64 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_struct_struct_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int2_t = OpTypeVector %int_t 2 +%char_t = OpTypeInt 8 0 +%struct_t = OpTypeStruct %int_t %char_t +%struct2_t = OpTypeStruct %int2_t %struct_t +%struct_ptr_t = OpTypePointer CrossWorkgroup %struct2_t +%func_t = OpTypeFunction %void_t %struct_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %struct_ptr_t +%entry = OpLabel +%struct2_val = OpUndef %struct2_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %struct_ptr_t %inptr %idx + OpStore %current %struct2_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_true_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_true_simple.spvasm32 new file mode 100644 index 00000000..22060fd1 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_true_simple.spvasm32 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_true_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%bool_val = OpUndef %bool_t +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val Aligned 4 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_true_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_true_simple.spvasm64 new file mode 100644 index 00000000..ffbb3bba --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_true_simple.spvasm64 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_true_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%bool_t = OpTypeBool +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t +%shift_val = OpConstant %idx_t 32 +%true_val = OpConstant %int_t 1 +%false_val = OpConstant %int_t 0 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%bool_val = OpUndef %bool_t +%val = OpSelect %int_t %bool_val %true_val %false_val +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_uchar_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_uchar_simple.spvasm32 new file mode 100644 index 00000000..56ca9e8e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_uchar_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_uchar_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uchar_t = OpTypeInt 8 0 +%uchar_ptr_t = OpTypePointer CrossWorkgroup %uchar_t +%func_t = OpTypeFunction %void_t %uchar_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uchar_ptr_t +%entry = OpLabel +%val = OpUndef %uchar_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %uchar_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_uchar_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_uchar_simple.spvasm64 new file mode 100644 index 00000000..5fa778c7 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_uchar_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_uchar_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uchar_t = OpTypeInt 8 0 +%uchar_ptr_t = OpTypePointer CrossWorkgroup %uchar_t +%func_t = OpTypeFunction %void_t %uchar_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uchar_ptr_t +%entry = OpLabel +%val = OpUndef %uchar_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %uchar_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_uint_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_uint_simple.spvasm32 new file mode 100644 index 00000000..c2117ab5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_uint_simple.spvasm32 @@ -0,0 +1,28 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_uint_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uint_t = OpTypeInt 32 0 +%uint_ptr_t = OpTypePointer CrossWorkgroup %uint_t +%func_t = OpTypeFunction %void_t %uint_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uint_ptr_t +%entry = OpLabel +%val = OpUndef %uint_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %uint_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_uint_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_uint_simple.spvasm64 new file mode 100644 index 00000000..a45231ee --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_uint_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_uint_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%uint_t = OpTypeInt 32 0 +%uint_ptr_t = OpTypePointer CrossWorkgroup %uint_t +%func_t = OpTypeFunction %void_t %uint_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %uint_ptr_t +%entry = OpLabel +%val = OpUndef %uint_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %uint_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_ulong_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_ulong_simple.spvasm32 new file mode 100644 index 00000000..42458fb8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_ulong_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_ulong_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ulong_t = OpTypeInt 64 0 +%ulong_ptr_t = OpTypePointer CrossWorkgroup %ulong_t +%func_t = OpTypeFunction %void_t %ulong_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ulong_ptr_t +%entry = OpLabel +%val = OpUndef %ulong_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %ulong_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_ulong_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_ulong_simple.spvasm64 new file mode 100644 index 00000000..f0e87f96 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_ulong_simple.spvasm64 @@ -0,0 +1,32 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_ulong_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ulong_t = OpTypeInt 64 0 +%ulong_ptr_t = OpTypePointer CrossWorkgroup %ulong_t +%func_t = OpTypeFunction %void_t %ulong_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ulong_ptr_t +%entry = OpLabel +%val = OpUndef %ulong_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %ulong_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_ushort_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/undef_ushort_simple.spvasm32 new file mode 100644 index 00000000..a8972f82 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_ushort_simple.spvasm32 @@ -0,0 +1,29 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "undef_ushort_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ushort_t = OpTypeInt 16 0 +%ushort_ptr_t = OpTypePointer CrossWorkgroup %ushort_t +%func_t = OpTypeFunction %void_t %ushort_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ushort_ptr_t +%entry = OpLabel +%val = OpUndef %ushort_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current = OpInBoundsPtrAccessChain %ushort_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/undef_ushort_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/undef_ushort_simple.spvasm64 new file mode 100644 index 00000000..cfdb129a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/undef_ushort_simple.spvasm64 @@ -0,0 +1,33 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "undef_ushort_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%ushort_t = OpTypeInt 16 0 +%ushort_ptr_t = OpTypePointer CrossWorkgroup %ushort_t +%func_t = OpTypeFunction %void_t %ushort_ptr_t +%shift_val = OpConstant %idx_t 32 +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %ushort_ptr_t +%entry = OpLabel +%val = OpUndef %ushort_t +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current = OpInBoundsPtrAccessChain %ushort_ptr_t %inptr %idx + OpStore %current %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/unreachable_simple.spvasm32 b/test_conformance/spirv_new/spirv_txt/unreachable_simple.spvasm32 new file mode 100644 index 00000000..cd1acb9e --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/unreachable_simple.spvasm32 @@ -0,0 +1,34 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "unreachable_simple" + OpName %inptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%outptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%current_in = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%current_out = OpInBoundsPtrAccessChain %int_ptr_t %outptr %idx +%val = OpLoad %int_t %current_in + OpBranch %final_block +%unreachable = OpLabel + OpUnreachable +%final_block = OpLabel + OpStore %current_out %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/unreachable_simple.spvasm64 b/test_conformance/spirv_new/spirv_txt/unreachable_simple.spvasm64 new file mode 100644 index 00000000..ed980907 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/unreachable_simple.spvasm64 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "unreachable_simple" + OpName %inptr "in" + OpName %outptr "out" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %inptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%inptr = OpFunctionParameter %int_ptr_t +%outptr = OpFunctionParameter %int_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%current_in = OpInBoundsPtrAccessChain %int_ptr_t %inptr %idx +%current_out = OpInBoundsPtrAccessChain %int_ptr_t %outptr %idx + OpBranch %final_block +%unreachable = OpLabel + OpUnreachable +%final_block = OpLabel +%val = OpLoad %int_t %current_in + OpStore %current_out %val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_char16_extract.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_char16_extract.spvasm32 new file mode 100644 index 00000000..cd298175 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_char16_extract.spvasm32 @@ -0,0 +1,38 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Vector16 + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_char16_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char16_t = OpTypeVector %char_t 16 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%char16_ptr_t = OpTypePointer CrossWorkgroup %char16_t +%func_t = OpTypeFunction %void_t %char16_ptr_t %char_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %char16_ptr_t +%out_ptr = OpFunctionParameter %char_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %char16_ptr_t %in_ptr %idx +%in_val = OpLoad %char16_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %char_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %char_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_char16_extract.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_char16_extract.spvasm64 new file mode 100644 index 00000000..88fc9d65 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_char16_extract.spvasm64 @@ -0,0 +1,42 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpCapability Vector16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_char16_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char16_t = OpTypeVector %char_t 16 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%char16_ptr_t = OpTypePointer CrossWorkgroup %char16_t +%func_t = OpTypeFunction %void_t %char16_ptr_t %char_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %char16_ptr_t +%out_ptr = OpFunctionParameter %char_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %char16_ptr_t %in_ptr %idx +%in_val = OpLoad %char16_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %char_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %char_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_char16_insert.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_char16_insert.spvasm32 new file mode 100644 index 00000000..f9b818ed --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_char16_insert.spvasm32 @@ -0,0 +1,39 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Vector16 + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_char16_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char16_t = OpTypeVector %char_t 16 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%char16_ptr_t = OpTypePointer CrossWorkgroup %char16_t +%func_t = OpTypeFunction %void_t %char_ptr_t %char16_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %char_ptr_t +%out_ptr = OpFunctionParameter %char16_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %char_ptr_t %in_ptr %idx +%in_val = OpLoad %char_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %char16_ptr_t %out_ptr %idx +%tmp_val = OpLoad %char16_t %out_loc +%out_val = OpVectorInsertDynamic %char16_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_char16_insert.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_char16_insert.spvasm64 new file mode 100644 index 00000000..8cc1d217 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_char16_insert.spvasm64 @@ -0,0 +1,43 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpCapability Vector16 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_char16_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%char_t = OpTypeInt 8 0 +%char16_t = OpTypeVector %char_t 16 +%char_ptr_t = OpTypePointer CrossWorkgroup %char_t +%char16_ptr_t = OpTypePointer CrossWorkgroup %char16_t +%func_t = OpTypeFunction %void_t %char_ptr_t %char16_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %char_ptr_t +%out_ptr = OpFunctionParameter %char16_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %char_ptr_t %in_ptr %idx +%in_val = OpLoad %char_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %char16_ptr_t %out_ptr %idx +%tmp_val = OpLoad %char16_t %out_loc +%out_val = OpVectorInsertDynamic %char16_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_double2_extract.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_double2_extract.spvasm32 new file mode 100644 index 00000000..6c83da7a --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_double2_extract.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_double2_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double2_t = OpTypeVector %double_t 2 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%double2_ptr_t = OpTypePointer CrossWorkgroup %double2_t +%func_t = OpTypeFunction %void_t %double2_ptr_t %double_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %double2_ptr_t +%out_ptr = OpFunctionParameter %double_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %double2_ptr_t %in_ptr %idx +%in_val = OpLoad %double2_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %double_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %double_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_double2_extract.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_double2_extract.spvasm64 new file mode 100644 index 00000000..ecf97f89 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_double2_extract.spvasm64 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_double2_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double2_t = OpTypeVector %double_t 2 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%double2_ptr_t = OpTypePointer CrossWorkgroup %double2_t +%func_t = OpTypeFunction %void_t %double2_ptr_t %double_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %double2_ptr_t +%out_ptr = OpFunctionParameter %double_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %double2_ptr_t %in_ptr %idx +%in_val = OpLoad %double2_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %double_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %double_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_double2_insert.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_double2_insert.spvasm32 new file mode 100644 index 00000000..db1b72ad --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_double2_insert.spvasm32 @@ -0,0 +1,38 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_double2_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double2_t = OpTypeVector %double_t 2 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%double2_ptr_t = OpTypePointer CrossWorkgroup %double2_t +%func_t = OpTypeFunction %void_t %double_ptr_t %double2_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %double_ptr_t +%out_ptr = OpFunctionParameter %double2_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %double_ptr_t %in_ptr %idx +%in_val = OpLoad %double_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %double2_ptr_t %out_ptr %idx +%tmp_val = OpLoad %double2_t %out_loc +%out_val = OpVectorInsertDynamic %double2_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_double2_insert.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_double2_insert.spvasm64 new file mode 100644 index 00000000..961aa486 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_double2_insert.spvasm64 @@ -0,0 +1,42 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_double2_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double2_t = OpTypeVector %double_t 2 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%double2_ptr_t = OpTypePointer CrossWorkgroup %double2_t +%func_t = OpTypeFunction %void_t %double_ptr_t %double2_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %double_ptr_t +%out_ptr = OpFunctionParameter %double2_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %double_ptr_t %in_ptr %idx +%in_val = OpLoad %double_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %double2_ptr_t %out_ptr %idx +%tmp_val = OpLoad %double2_t %out_loc +%out_val = OpVectorInsertDynamic %double2_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_float4_extract.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_float4_extract.spvasm32 new file mode 100644 index 00000000..8b832700 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_float4_extract.spvasm32 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_float4_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float4_t = OpTypeVector %float_t 4 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float4_ptr_t %float_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %float4_ptr_t +%out_ptr = OpFunctionParameter %float_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %float4_ptr_t %in_ptr %idx +%in_val = OpLoad %float4_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %float_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %float_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_float4_extract.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_float4_extract.spvasm64 new file mode 100644 index 00000000..5f832a56 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_float4_extract.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_float4_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float4_t = OpTypeVector %float_t 4 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float4_ptr_t %float_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %float4_ptr_t +%out_ptr = OpFunctionParameter %float_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %float4_ptr_t %in_ptr %idx +%in_val = OpLoad %float4_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %float_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %float_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_float4_insert.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_float4_insert.spvasm32 new file mode 100644 index 00000000..23e729b3 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_float4_insert.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_float4_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float4_t = OpTypeVector %float_t 4 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float_ptr_t %float4_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %float_ptr_t +%out_ptr = OpFunctionParameter %float4_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %float_ptr_t %in_ptr %idx +%in_val = OpLoad %float_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %float4_ptr_t %out_ptr %idx +%tmp_val = OpLoad %float4_t %out_loc +%out_val = OpVectorInsertDynamic %float4_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_float4_insert.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_float4_insert.spvasm64 new file mode 100644 index 00000000..d4e2fe86 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_float4_insert.spvasm64 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_float4_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float4_t = OpTypeVector %float_t 4 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float_ptr_t %float4_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %float_ptr_t +%out_ptr = OpFunctionParameter %float4_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %float_ptr_t %in_ptr %idx +%in_val = OpLoad %float_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %float4_ptr_t %out_ptr %idx +%tmp_val = OpLoad %float4_t %out_loc +%out_val = OpVectorInsertDynamic %float4_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_int4_extract.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_int4_extract.spvasm32 new file mode 100644 index 00000000..690a9253 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_int4_extract.spvasm32 @@ -0,0 +1,36 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_int4_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t %int_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %int4_ptr_t +%out_ptr = OpFunctionParameter %int_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %int4_ptr_t %in_ptr %idx +%in_val = OpLoad %int4_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %int_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_int4_extract.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_int4_extract.spvasm64 new file mode 100644 index 00000000..68a0aece --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_int4_extract.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_int4_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int4_ptr_t %int_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %int4_ptr_t +%out_ptr = OpFunctionParameter %int_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %int4_ptr_t %in_ptr %idx +%in_val = OpLoad %int4_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %int_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %int_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_int4_insert.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_int4_insert.spvasm32 new file mode 100644 index 00000000..2a91b78c --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_int4_insert.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_int4_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int4_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %int_ptr_t +%out_ptr = OpFunctionParameter %int4_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %idx +%in_val = OpLoad %int_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %int4_ptr_t %out_ptr %idx +%tmp_val = OpLoad %int4_t %out_loc +%out_val = OpVectorInsertDynamic %int4_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_int4_insert.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_int4_insert.spvasm64 new file mode 100644 index 00000000..67231af4 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_int4_insert.spvasm64 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_int4_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%int_t = OpTypeInt 32 0 +%int4_t = OpTypeVector %int_t 4 +%int_ptr_t = OpTypePointer CrossWorkgroup %int_t +%int4_ptr_t = OpTypePointer CrossWorkgroup %int4_t +%func_t = OpTypeFunction %void_t %int_ptr_t %int4_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %int_ptr_t +%out_ptr = OpFunctionParameter %int4_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %int_ptr_t %in_ptr %idx +%in_val = OpLoad %int_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %int4_ptr_t %out_ptr %idx +%tmp_val = OpLoad %int4_t %out_loc +%out_val = OpVectorInsertDynamic %int4_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_long2_extract.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_long2_extract.spvasm32 new file mode 100644 index 00000000..e0fe95c5 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_long2_extract.spvasm32 @@ -0,0 +1,37 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_long2_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long2_t = OpTypeVector %long_t 2 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%long2_ptr_t = OpTypePointer CrossWorkgroup %long2_t +%func_t = OpTypeFunction %void_t %long2_ptr_t %long_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %long2_ptr_t +%out_ptr = OpFunctionParameter %long_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %long2_ptr_t %in_ptr %idx +%in_val = OpLoad %long2_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %long_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %long_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_long2_extract.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_long2_extract.spvasm64 new file mode 100644 index 00000000..9c523f13 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_long2_extract.spvasm64 @@ -0,0 +1,40 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_long2_extract" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long2_t = OpTypeVector %long_t 2 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%long2_ptr_t = OpTypePointer CrossWorkgroup %long2_t +%func_t = OpTypeFunction %void_t %long2_ptr_t %long_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %long2_ptr_t +%out_ptr = OpFunctionParameter %long_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %long2_ptr_t %in_ptr %idx +%in_val = OpLoad %long2_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %long_ptr_t %out_ptr %idx +%out_val = OpVectorExtractDynamic %long_t %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_long2_insert.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_long2_insert.spvasm32 new file mode 100644 index 00000000..2a2e1ca6 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_long2_insert.spvasm32 @@ -0,0 +1,38 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_long2_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long2_t = OpTypeVector %long_t 2 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%long2_ptr_t = OpTypePointer CrossWorkgroup %long2_t +%func_t = OpTypeFunction %void_t %long_ptr_t %long2_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %long_ptr_t +%out_ptr = OpFunctionParameter %long2_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%in_loc = OpInBoundsPtrAccessChain %long_ptr_t %in_ptr %idx +%in_val = OpLoad %long_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %long2_ptr_t %out_ptr %idx +%tmp_val = OpLoad %long2_t %out_loc +%out_val = OpVectorInsertDynamic %long2_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_long2_insert.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_long2_insert.spvasm64 new file mode 100644 index 00000000..dfea0bc8 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_long2_insert.spvasm64 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_long2_insert" + OpName %in_ptr "in" + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %in_ptr FuncParamAttr NoCapture + OpDecorate %out_ptr FuncParamAttr NoCapture + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%vec_idx_t = OpTypeInt 32 0 +%void_t = OpTypeVoid +%long_t = OpTypeInt 64 0 +%long2_t = OpTypeVector %long_t 2 +%long_ptr_t = OpTypePointer CrossWorkgroup %long_t +%long2_ptr_t = OpTypePointer CrossWorkgroup %long2_t +%func_t = OpTypeFunction %void_t %long_ptr_t %long2_ptr_t %vec_idx_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%in_ptr = OpFunctionParameter %long_ptr_t +%out_ptr = OpFunctionParameter %long2_ptr_t +%vec_idx = OpFunctionParameter %vec_idx_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%in_loc = OpInBoundsPtrAccessChain %long_ptr_t %in_ptr %idx +%in_val = OpLoad %long_t %in_loc +%out_loc = OpInBoundsPtrAccessChain %long2_ptr_t %out_ptr %idx +%tmp_val = OpLoad %long2_t %out_loc +%out_val = OpVectorInsertDynamic %long2_t %tmp_val %in_val %vec_idx + OpStore %out_loc %out_val + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_times_scalar_double.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_double.spvasm32 new file mode 100644 index 00000000..52f4c655 --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_double.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Float64 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_times_scalar" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %attr FuncParamAttr NoCapture +%attr = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %attr %res %lhs %rhs +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%double4_t = OpTypeVector %double_t 4 +%double4_ptr_t = OpTypePointer CrossWorkgroup %double4_t +%func_t = OpTypeFunction %void_t %double4_ptr_t %double4_ptr_t %double_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %double4_ptr_t +%lhs = OpFunctionParameter %double4_ptr_t +%rhs = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_ptr = OpInBoundsPtrAccessChain %double4_ptr_t %lhs %idx +%lhs_val = OpLoad %double4_t %lhs_ptr Aligned 32 +%rhs_ptr = OpInBoundsPtrAccessChain %double_ptr_t %rhs %idx +%rhs_val = OpLoad %double_t %rhs_ptr Aligned 8 +%res_val = OpVectorTimesScalar %double4_t %lhs_val %rhs_val +%res_ptr = OpInBoundsPtrAccessChain %double4_ptr_t %res %idx + OpStore %res_ptr %res_val Aligned 32 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_times_scalar_double.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_double.spvasm64 new file mode 100644 index 00000000..686b538b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_double.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Float64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_times_scalar" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %attr FuncParamAttr NoCapture +%attr = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %attr %res %lhs %rhs +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%void_t = OpTypeVoid +%double_t = OpTypeFloat 64 +%double_ptr_t = OpTypePointer CrossWorkgroup %double_t +%double4_t = OpTypeVector %double_t 4 +%double4_ptr_t = OpTypePointer CrossWorkgroup %double4_t +%func_t = OpTypeFunction %void_t %double4_ptr_t %double4_ptr_t %double_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %double4_ptr_t +%lhs = OpFunctionParameter %double4_ptr_t +%rhs = OpFunctionParameter %double_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_ptr = OpInBoundsPtrAccessChain %double4_ptr_t %lhs %idx +%lhs_val = OpLoad %double4_t %lhs_ptr Aligned 32 +%rhs_ptr = OpInBoundsPtrAccessChain %double_ptr_t %rhs %idx +%rhs_val = OpLoad %double_t %rhs_ptr Aligned 8 +%res_val = OpVectorTimesScalar %double4_t %lhs_val %rhs_val +%res_ptr = OpInBoundsPtrAccessChain %double4_ptr_t %res %idx + OpStore %res_ptr %res_val Aligned 32 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_times_scalar_float.spvasm32 b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_float.spvasm32 new file mode 100644 index 00000000..b5ec7f6b --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_float.spvasm32 @@ -0,0 +1,41 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %func "vector_times_scalar" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %attr FuncParamAttr NoCapture +%attr = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %attr %res %lhs %rhs +%idx_t = OpTypeInt 32 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%float4_t = OpTypeVector %float_t 4 +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float4_ptr_t %float4_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %float4_ptr_t +%lhs = OpFunctionParameter %float4_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx = OpCompositeExtract %idx_t %idx3 0 +%lhs_ptr = OpInBoundsPtrAccessChain %float4_ptr_t %lhs %idx +%lhs_val = OpLoad %float4_t %lhs_ptr Aligned 16 +%rhs_ptr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_ptr Aligned 4 +%res_val = OpVectorTimesScalar %float4_t %lhs_val %rhs_val +%res_ptr = OpInBoundsPtrAccessChain %float4_ptr_t %res %idx + OpStore %res_ptr %res_val Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_txt/vector_times_scalar_float.spvasm64 b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_float.spvasm64 new file mode 100644 index 00000000..e450102f --- /dev/null +++ b/test_conformance/spirv_new/spirv_txt/vector_times_scalar_float.spvasm64 @@ -0,0 +1,45 @@ + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int16 + OpCapability Int64 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %func "vector_times_scalar" + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpDecorate %attr FuncParamAttr NoCapture +%attr = OpDecorationGroup + OpDecorate %global_id BuiltIn GlobalInvocationId + OpDecorate %global_id Constant + OpDecorate %global_id LinkageAttributes "__spirv_GlobalInvocationId" Import + OpGroupDecorate %attr %res %lhs %rhs +%idx_t = OpTypeInt 64 0 +%idx3_t = OpTypeVector %idx_t 3 +%idx3_ptr_t = OpTypePointer UniformConstant %idx3_t +%shift_val = OpConstant %idx_t 32 +%void_t = OpTypeVoid +%float_t = OpTypeFloat 32 +%float_ptr_t = OpTypePointer CrossWorkgroup %float_t +%float4_t = OpTypeVector %float_t 4 +%float4_ptr_t = OpTypePointer CrossWorkgroup %float4_t +%func_t = OpTypeFunction %void_t %float4_ptr_t %float4_ptr_t %float_ptr_t +%global_id = OpVariable %idx3_ptr_t UniformConstant +%func = OpFunction %void_t None %func_t +%res = OpFunctionParameter %float4_ptr_t +%lhs = OpFunctionParameter %float4_ptr_t +%rhs = OpFunctionParameter %float_ptr_t +%entry = OpLabel +%idx3 = OpLoad %idx3_t %global_id Aligned 0 +%idx_tmp = OpCompositeExtract %idx_t %idx3 0 +%idx_shift = OpShiftLeftLogical %idx_t %idx_tmp %shift_val +%idx = OpShiftRightArithmetic %idx_t %idx_shift %shift_val +%lhs_ptr = OpInBoundsPtrAccessChain %float4_ptr_t %lhs %idx +%lhs_val = OpLoad %float4_t %lhs_ptr Aligned 16 +%rhs_ptr = OpInBoundsPtrAccessChain %float_ptr_t %rhs %idx +%rhs_val = OpLoad %float_t %rhs_ptr Aligned 4 +%res_val = OpVectorTimesScalar %float4_t %lhs_val %rhs_val +%res_ptr = OpInBoundsPtrAccessChain %float4_ptr_t %res %idx + OpStore %res_ptr %res_val Aligned 16 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/testBase.h b/test_conformance/spirv_new/testBase.h new file mode 100644 index 00000000..098e896c --- /dev/null +++ b/test_conformance/spirv_new/testBase.h @@ -0,0 +1,37 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ +#pragma once + +#ifndef _testBase_h +#define _testBase_h + +#include "../../test_common/harness/compat.h" +#include "../../test_common/harness/rounding_mode.h" + +#include +#include +#include +#include + +#include "procs.h" + +// Ensure max min macros are undefined - compilation issues when using min max from numeric_limits template class +#if defined( max ) + #undef max +#endif + +#if defined( min ) + #undef min +#endif + +#endif // _testBase_h diff --git a/test_conformance/spirv_new/test_cl_khr_spirv_no_integer_wrap_decoration.cpp b/test_conformance/spirv_new/test_cl_khr_spirv_no_integer_wrap_decoration.cpp new file mode 100644 index 00000000..84f8ed1f --- /dev/null +++ b/test_conformance/spirv_new/test_cl_khr_spirv_no_integer_wrap_decoration.cpp @@ -0,0 +1,223 @@ +/****************************************************************** +Copyright (c) 2018 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include +#include + + +template +int test_ext_cl_khr_spirv_no_integer_wrap_decoration(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *spvName, + const char *funcName, + const char *Tname) +{ + + cl_int err = CL_SUCCESS; + const int num = 10; + std::vector h_lhs(num); + std::vector h_rhs(num); + std::vector expected_results(num); + std::vector h_ref(num); + if (!is_extension_available(deviceID, "cl_khr_spirv_no_integer_wrap_decoration")) { + log_info("Extension cl_khr_spirv_no_integer_wrap_decoration not supported; skipping tests.\n"); + return 0; + } + + /*Test with some values that do not cause overflow*/ + if (std::is_signed::value == true) { + h_lhs.push_back((T)-25000); + h_lhs.push_back((T)-3333); + h_lhs.push_back((T)-7); + h_lhs.push_back((T)-1); + h_lhs.push_back(0); + h_lhs.push_back(1); + h_lhs.push_back(1024); + h_lhs.push_back(2048); + h_lhs.push_back(4094); + h_lhs.push_back(10000); + } else { + h_lhs.push_back(0); + h_lhs.push_back(1); + h_lhs.push_back(3); + h_lhs.push_back(5); + h_lhs.push_back(10); + h_lhs.push_back(100); + h_lhs.push_back(1024); + h_lhs.push_back(2048); + h_lhs.push_back(4094); + h_lhs.push_back(52888); + } + + h_rhs.push_back(0); + h_rhs.push_back(1); + h_rhs.push_back(2); + h_rhs.push_back(3); + h_rhs.push_back(4); + h_rhs.push_back(5); + h_rhs.push_back(6); + h_rhs.push_back(7); + h_rhs.push_back(8); + h_rhs.push_back(9); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + std::string kernelStr; + + { + std::stringstream kernelStream; + kernelStream << "#define spirv_fadd(a, b) (a) + (b) \n"; + kernelStream << "#define spirv_fsub(a, b) (a) - (b) \n"; + kernelStream << "#define spirv_fmul(a, b) (a) * (b) \n"; + kernelStream << "#define spirv_fshiftleft(a, b) (a) << (b) \n"; + kernelStream << "#define spirv_fnegate(a, b) (-a) \n"; + + kernelStream << "#define T " << Tname << "\n"; + kernelStream << "#define FUNC spirv_" << funcName << "\n"; + kernelStream << "__kernel void fmath_cl(__global T *out, \n"; + kernelStream << "const __global T *lhs, const __global T *rhs) \n"; + kernelStream << "{ \n"; + kernelStream << " int id = get_global_id(0); \n"; + kernelStream << " out[id] = FUNC(lhs[id], rhs[id]); \n"; + kernelStream << "} \n"; + kernelStr = kernelStream.str(); + } + + size_t kernelLen = kernelStr.size(); + const char *kernelBuf = kernelStr.c_str(); + + for (int i = 0; i < num; i++) { + if (std::string(funcName) == std::string("fadd")) { + expected_results[i] = h_lhs[i] + h_rhs[i]; + } else if (std::string(funcName) == std::string("fsub")) { + expected_results[i] = h_lhs[i] - h_rhs[i]; + } else if (std::string(funcName) == std::string("fmul")) { + expected_results[i] = h_lhs[i] * h_rhs[i]; + } else if (std::string(funcName) == std::string("fshiftleft")) { + expected_results[i] = h_lhs[i] << h_rhs[i]; + } else if (std::string(funcName) == std::string("fnegate")) { + expected_results[i] = 0 - h_lhs[i]; + } + } + + { + // Run the cl kernel for reference results + clProgramWrapper prog; + err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL); + SPIRV_CHECK_ERROR(err, "Failed to create cl program"); + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err); + SPIRV_CHECK_ERROR(err, "Failed to create cl kernel"); + + clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create ref buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &ref); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + err = clEnqueueReadBuffer(queue, ref, CL_TRUE, 0, bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + } + + for (int i = 0; i < num; i++) { + if (expected_results[i] != h_ref[i]) { + log_error("Values do not match at index %d expected = %d got = %d\n", i, expected_results[i], h_ref[i]); + return -1; + } + } + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (expected_results[i] != h_res[i]) { + log_error("Values do not match at location %d expected = %d got = %d\n", i, expected_results[i], h_res[i]); + return -1; + } + } + + return 0; +} + +#define TEST_FMATH_FUNC(TYPE, FUNC) \ + TEST_SPIRV_FUNC(ext_cl_khr_spirv_no_integer_wrap_decoration_##FUNC##_##TYPE) \ + { \ + return test_ext_cl_khr_spirv_no_integer_wrap_decoration(deviceID, context, queue, \ + "ext_cl_khr_spirv_no_integer_wrap_decoration_"#FUNC"_"#TYPE, \ + #FUNC, \ + #TYPE \ + ); \ + } + +TEST_FMATH_FUNC(int, fadd) +TEST_FMATH_FUNC(int, fsub) +TEST_FMATH_FUNC(int, fmul) +TEST_FMATH_FUNC(int, fshiftleft) +TEST_FMATH_FUNC(int, fnegate) +TEST_FMATH_FUNC(uint, fadd) +TEST_FMATH_FUNC(uint, fsub) +TEST_FMATH_FUNC(uint, fmul) +TEST_FMATH_FUNC(uint, fshiftleft) \ No newline at end of file diff --git a/test_conformance/spirv_new/test_decorate.cpp b/test_conformance/spirv_new/test_decorate.cpp new file mode 100644 index 00000000..766a6b68 --- /dev/null +++ b/test_conformance/spirv_new/test_decorate.cpp @@ -0,0 +1,604 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed h_in whole or h_in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited h_in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +h_in whole or h_in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" +#include +#include +#include +#include +#include + +#ifndef isnan +// Ensure isnan is always present as a macro +#define isnan std::isnan +#endif + +long double reference_remainderl(long double x, long double y); +int gIsInRTZMode = 0; +int gDeviceILogb0 = 1; +int gDeviceILogbNaN = 1; +int gCheckTininessBeforeRounding = 1; + + +static int verify_results(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *kname, + const clProgramWrapper &prog) +{ + const int num = 1 << 20; + std::vector h_lhs(num); + std::vector h_rhs(num); + + cl_int err = 0; + + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + h_lhs[i] = genrand(seed); + h_rhs[i] = genrand(seed); + } + + clKernelWrapper kernel = clCreateKernel(prog, kname, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + size_t bytes = sizeof(cl_int) * num; + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != (h_lhs[i] + h_rhs[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +int test_decorate_full(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name) +{ + clProgramWrapper prog; + cl_int err = 0; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + return verify_results(deviceID, context, queue, name, prog); +} + +TEST_SPIRV_FUNC(decorate_restrict) +{ + return test_decorate_full(deviceID, context, queue, "decorate_restrict"); +} + +TEST_SPIRV_FUNC(decorate_aliased) +{ + return test_decorate_full(deviceID, context, queue, "decorate_aliased"); +} + +TEST_SPIRV_FUNC(decorate_alignment) +{ + //TODO: Check for results ? How to ensure buffers are aligned + clProgramWrapper prog; + return get_program_with_il(prog, deviceID, context, "decorate_alignment"); +} + +TEST_SPIRV_FUNC(decorate_constant) +{ + return test_decorate_full(deviceID, context, queue, "decorate_constant"); +} + +TEST_SPIRV_FUNC(decorate_cpacked) +{ + PACKED( + struct packed_struct_t { + cl_int ival; + cl_char cval; + } + ); + + typedef struct packed_struct_t packed_t; + + const int num = 1 << 20; + + std::vector packed(num); + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, "decorate_cpacked"); + + clKernelWrapper kernel = clCreateKernel(prog, "decorate_cpacked", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + size_t bytes = sizeof(packed_t) * num; + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + if (h_res[i].ival != 2100483600 || + h_res[i].cval != 127) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + + return 0; +} + +template +int verify_saturated_results(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *kname, + const clProgramWrapper &prog) +{ + if(std::string(kname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + cl_int err = 0; + + const int num = 1 << 20; + + clKernelWrapper kernel = clCreateKernel(prog, kname, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + size_t in_bytes = sizeof(Ti) * num; + size_t out_bytes = sizeof(To) * num; + + std::vector h_lhs(num); + std::vector h_rhs(num); + + To loVal = std::numeric_limits::min(); + To hiVal = std::numeric_limits::max(); + + Tl range = (Tl)(hiVal) - (Tl)(loVal); + + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + h_lhs[i] = genrand(seed) * range; + Tl val = (genrand(seed) % hiVal); + // randomly set some values on rhs to NaN + if (val * 20 < hiVal) { + h_rhs[i] = NAN; + } else { + h_rhs[i] = (Ti)(val); + } + } + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, in_bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, in_bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, out_bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + Tl ival = (Tl)(h_lhs[i] * h_rhs[i]); + To val = (To)std::min(std::max(ival, loVal), hiVal); + + if (isnan(h_rhs[i])) { + val = 0; + } + + if (val != h_res[i]) { + log_error("Value error at %d\n", i); + return -1; + } + } + + return 0; +} + + +template +int test_saturate_full(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const char *types) +{ + if(std::string(types).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + clProgramWrapper prog; + cl_int err = 0; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + return verify_saturated_results(deviceID, context, queue, name, prog); +} + +#define TEST_SATURATED_CONVERSION(Ti, Tl, To) \ + TEST_SPIRV_FUNC(decorate_saturated_conversion_##To) \ + { \ + typedef cl_##Ti cl_Ti; \ + typedef cl_##Tl cl_Tl; \ + typedef cl_##To cl_To; \ + return test_saturate_full \ + (deviceID, context, queue, \ + "decorate_saturated_conversion_" #To, \ + #Ti #Tl #To); \ + } \ + +TEST_SATURATED_CONVERSION(float, int, char) +TEST_SATURATED_CONVERSION(float, uint, uchar) +TEST_SATURATED_CONVERSION(float, int, short) +TEST_SATURATED_CONVERSION(float, uint, ushort) +TEST_SATURATED_CONVERSION(double, long, int) +TEST_SATURATED_CONVERSION(double, ulong, uint) + +int test_image_decorate(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name) +{ + const int width = 4096; + const int height = 4096; + + std::vector src(width * height); + RandomSeed seed(gRandomSeed); + + for (auto &val : src) { + val = genrand(seed); + } + + cl_image_format imageFormat; + imageFormat.image_channel_data_type = CL_UNSIGNED_INT32; + imageFormat.image_channel_order = CL_RGBA; + + cl_image_desc desc; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = width; + desc.image_height = height; + desc.image_depth = 0; + desc.image_array_size = 0; + desc.image_row_pitch = 0; // Automatically calculate the pitch + desc.image_slice_pitch = 0; // Not needed for 2D + desc.num_mip_levels = 0; + desc.num_samples = 0; + desc.mem_object = NULL; + + cl_int err = CL_SUCCESS; + + clMemWrapper srcImage = clCreateImage(context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, + &imageFormat, &desc, + &src[0], &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + size_t bytes = src.size() * sizeof(cl_uint4); + clMemWrapper dstBuffer = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &dstBuffer); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2 of the kernel"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &srcImage); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1 of the kernel"); + + size_t global[] = {width, height}; + err = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector dst(src.size()); + err = clEnqueueReadBuffer(queue, dstBuffer, CL_TRUE, 0, bytes, &dst[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy data back to host"); + + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + int srcIdx = j * width + i; + int dstIdx = i * height + j; + if (dst[dstIdx] != src[srcIdx]) { + log_error("Values do not match at location (%d, %d) of src\n", i, j); + } + } + } + + return 0; +} + +#define TEST_SPIRV_IMAGE_DECORATE(type) \ + TEST_SPIRV_FUNC(decorate_##type) \ + { \ + PASSIVE_REQUIRE_IMAGE_SUPPORT(deviceID); \ + return test_image_decorate(deviceID, context, queue, \ + "decorate_" #type); \ + } \ + +TEST_SPIRV_IMAGE_DECORATE(volatile) +TEST_SPIRV_IMAGE_DECORATE(coherent) +TEST_SPIRV_IMAGE_DECORATE(nonwritable) + +TEST_SPIRV_FUNC(decorate_nonreadable) +{ + PASSIVE_REQUIRE_IMAGE_SUPPORT(deviceID); + const char *name = "decorate_nonreadable"; + const int width = 4096; + const int height = 4096; + cl_int err = CL_SUCCESS; + + std::vector src(width * height); + RandomSeed seed(gRandomSeed); + + for (auto &val : src) { + val = genrand(seed); + } + + size_t bytes = src.size() * sizeof(cl_uint4); + clMemWrapper srcBuffer = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + err = clEnqueueWriteBuffer(queue, srcBuffer, CL_TRUE, 0, bytes, &src[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy data back to host"); + + cl_image_format imageFormat; + imageFormat.image_channel_data_type = CL_UNSIGNED_INT32; + imageFormat.image_channel_order = CL_RGBA; + + cl_image_desc desc; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = height; + desc.image_height = width; + desc.image_depth = 0; + desc.image_array_size = 0; + desc.image_row_pitch = 0; // Automatically calculate the pitch + desc.image_slice_pitch = 0; // Not needed for 2D + desc.num_mip_levels = 0; + desc.num_samples = 0; + desc.mem_object = NULL; + + + clMemWrapper dstImage = clCreateImage(context, CL_MEM_WRITE_ONLY, + &imageFormat, &desc, + NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create image object"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &dstImage); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2 of the kernel"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &srcBuffer); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1 of the kernel"); + + size_t global[] = {width, height}; + err = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector dst(src.size()); + size_t origin[] = {0, 0, 0}; + size_t region[] = {height, width, 1}; + err = clEnqueueReadImage(queue, dstImage, CL_TRUE, origin, region, 0, 0, &dst[0], 0, NULL, NULL); + + + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + int srcIdx = j * width + i; + int dstIdx = i * height + j; + if (dst[dstIdx] != src[srcIdx]) { + log_error("Values do not match at location (%d, %d) of src\n", i, j); + } + } + } + + return 0; +} + +template +int test_fp_rounding(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + std::vector &h_in, + std::vector &h_out) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + const int num = h_in.size(); + const size_t in_bytes = num * sizeof(Ti); + const size_t out_bytes = num * sizeof(To); + cl_int err = 0; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create input buffer"); + + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_ONLY, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create output buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to write to input"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from output"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_out[i]) { + log_error("Values do not match at location %d. Original :%lf, Expected: %ld, Found %ld\n", + i, h_in[i], h_out[i], h_res[i]); + return -1; + } + } + + return 0; +} + +template +inline To round_to_zero(Ti in) +{ + To out = (To)(in); + return out; +} + +template +int sign(T val) +{ + if (val < 0) return -1; + if (val > 0) return 1; + return 0; +} + +template +inline To round_to_even(Ti in) +{ + // https://en.wikipedia.org/wiki/Rounding#Round_half_to_even + return std::floor(in + 0.5) - 1 + std::abs(sign(reference_remainderl((long double)in, 2) - 0.5)); +} + +template +inline To round_to_posinf(Ti in) +{ + To out = std::ceil(in); + return out; +} + +template +inline To round_to_neginf(Ti in) +{ + To out = std::floor(in); + return out; +} + +#define TEST_SPIRV_FP_ROUNDING_DECORATE(name, func, Ti, To) \ + TEST_SPIRV_FUNC(decorate_fp_rounding_mode_##name##_##Ti##_##To) \ + { \ + typedef cl_##Ti clTi; \ + typedef cl_##To clTo; \ + const int num = 1 << 16; \ + std::vector in(num); \ + std::vector out(num); \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + in[i] = num * genrand(seed) - num/2; \ + out[i] = func(in[i]); \ + } \ + const char *name = "decorate_rounding_" #name "_" #Ti "_" #To; \ + return test_fp_rounding(deviceID, context, queue, \ + name, in, out); \ + } \ + +TEST_SPIRV_FP_ROUNDING_DECORATE(rte, round_to_even, float, int); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtz, round_to_zero, float, int); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtp, round_to_posinf, float, int); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtn, round_to_neginf, float, int); + +TEST_SPIRV_FP_ROUNDING_DECORATE(rte, round_to_even, double, long); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtz, round_to_zero, double, long); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtp, round_to_posinf, double, long); +TEST_SPIRV_FP_ROUNDING_DECORATE(rtn, round_to_neginf, double, long); diff --git a/test_conformance/spirv_new/test_linkage.cpp b/test_conformance/spirv_new/test_linkage.cpp new file mode 100644 index 00000000..93972c93 --- /dev/null +++ b/test_conformance/spirv_new/test_linkage.cpp @@ -0,0 +1,117 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed h_in whole or h_in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited h_in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +h_in whole or h_in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +static int test_linkage_compile(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *fname, + clProgramWrapper &prog) +{ + cl_int err = CL_SUCCESS; + std::vector buffer_vec = readSPIRV(fname); + + int file_bytes = buffer_vec.size(); + if (file_bytes == 0) { + log_error("File not found\n"); + return -1; + } + unsigned char *buffer = &buffer_vec[0]; + + prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL"); + + err = clCompileProgram(prog, 1, &deviceID, + NULL, // options + 0, // num headers + NULL, // input headers + NULL, // header include names + NULL, // callback + NULL // User data + ); + SPIRV_CHECK_ERROR(err, "Failed to compile spv program"); + return 0; +} + +TEST_SPIRV_FUNC(linkage_export_function_compile) +{ + clProgramWrapper prog; + return test_linkage_compile(deviceID, context, queue, "linkage_export", prog); +} + +TEST_SPIRV_FUNC(linkage_import_function_compile) +{ + clProgramWrapper prog; + return test_linkage_compile(deviceID, context, queue, "linkage_import", prog); +} + +TEST_SPIRV_FUNC(linkage_import_function_link) +{ + int err = 0; + + clProgramWrapper prog_export; + err = test_linkage_compile(deviceID, context, queue, "linkage_export", prog_export); + SPIRV_CHECK_ERROR(err, "Failed to compile export program"); + + clProgramWrapper prog_import; + err = test_linkage_compile(deviceID, context, queue, "linkage_import", prog_import); + SPIRV_CHECK_ERROR(err, "Failed to compile import program"); + + cl_program progs[] = {prog_export, prog_import}; + + clProgramWrapper prog = clLinkProgram(context, 1, &deviceID, NULL, 2, progs, NULL, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to link programs"); + + clKernelWrapper kernel = clCreateKernel(prog, "test_linkage", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + const int num = 1 << 20; + std::vector h_in(num); + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + h_in[i] = genrand(seed); + } + + size_t bytes = sizeof(cl_float) * num; + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, in, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read to output"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != -h_in[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + + return 0; +} diff --git a/test_conformance/spirv_new/test_op_atomic.cpp b/test_conformance/spirv_new/test_op_atomic.cpp new file mode 100644 index 00000000..e4b6feb1 --- /dev/null +++ b/test_conformance/spirv_new/test_op_atomic.cpp @@ -0,0 +1,99 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_atomic(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + const int num, + bool is_inc) +{ + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + size_t bytes = num * sizeof(T); + clMemWrapper ctr_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(T), NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + T initial, result; + + if (is_inc) { + initial = 0; + result = num; + } else { + initial = num; + result = 0; + } + + err = clEnqueueWriteBuffer(queue, ctr_mem, CL_TRUE, 0, sizeof(T), &initial, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper val_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &val_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &ctr_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + T count = 0; + err = clEnqueueReadBuffer(queue, ctr_mem, CL_TRUE, 0, sizeof(T), &count, 0, NULL, NULL); + + if (count != result) { + log_error("Counter value does not match. Expected: %d, Found: %d\n", result, (int)count); + return -1; + } + + std::vector flags(num, 0); + std::vector locs(num, -1); + std::vector host(num); + err = clEnqueueReadBuffer(queue, val_mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + T idx = host[i] - (is_inc ? 0 : 1); + if (flags[idx] == 1) { + log_error("Atomic inc value is repeated at %d and %d\n", locs[idx], i); + return -1; + } else { + flags[idx] = 1; + locs[idx] = i; + } + } + return 0; +} + +TEST_SPIRV_FUNC(op_atomic_inc_global) +{ + int num = 1 << 16; + return test_atomic(deviceID, context, queue, + "atomic_inc_global", num, true); +} + +TEST_SPIRV_FUNC(op_atomic_dec_global) +{ + int num = 1 << 16; + return test_atomic(deviceID, context, queue, + "atomic_dec_global", num, false); +} diff --git a/test_conformance/spirv_new/test_op_branch.cpp b/test_conformance/spirv_new/test_op_branch.cpp new file mode 100644 index 00000000..ec61afd9 --- /dev/null +++ b/test_conformance/spirv_new/test_op_branch.cpp @@ -0,0 +1,82 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_branch_simple(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper in_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clEnqueueWriteBuffer(queue, in_mem, CL_TRUE, 0, bytes, &results[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper out_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &out_mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, out_mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_BRANCH_SIMPLE(NAME) \ + TEST_SPIRV_FUNC(op_##NAME##_simple) \ + { \ + RandomSeed seed(gRandomSeed); \ + int num = 1 << 10; \ + std::vector results(num); \ + for (int i = 0; i < num; i++) { \ + results[i] = genrand(seed); \ + } \ + return test_branch_simple(deviceID, context, queue, \ + #NAME "_simple", \ + results); \ + } \ + + +TEST_BRANCH_SIMPLE(label) +TEST_BRANCH_SIMPLE(branch) +TEST_BRANCH_SIMPLE(unreachable) diff --git a/test_conformance/spirv_new/test_op_branch_conditional.cpp b/test_conformance/spirv_new/test_op_branch_conditional.cpp new file mode 100644 index 00000000..ad94b824 --- /dev/null +++ b/test_conformance/spirv_new/test_op_branch_conditional.cpp @@ -0,0 +1,106 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_branch_conditional(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build spv program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_BRANCH_CONDITIONAL(name) \ + TEST_SPIRV_FUNC(op_##name) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = lhs[i] < rhs[i] ? \ + (rhs[i] - lhs[i]) : (lhs[i] - rhs[i]); \ + } \ + \ + return test_branch_conditional(deviceID, context, queue, \ + #name, \ + lhs, rhs, out); \ + } \ + +TEST_BRANCH_CONDITIONAL(branch_conditional) +TEST_BRANCH_CONDITIONAL(branch_conditional_weighted) diff --git a/test_conformance/spirv_new/test_op_composite_construct.cpp b/test_conformance/spirv_new/test_op_composite_construct.cpp new file mode 100644 index 00000000..d07ebd3f --- /dev/null +++ b/test_conformance/spirv_new/test_op_composite_construct.cpp @@ -0,0 +1,74 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_composite_construct(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +TEST_SPIRV_FUNC(op_composite_construct_int4) +{ + cl_int4 value = {123, 122, 121, 119}; + std::vector results(256, value); + return test_composite_construct(deviceID, context, queue, "composite_construct_int4", results); +} + +TEST_SPIRV_FUNC(op_composite_construct_struct) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + + CustomType1 value1 = {2100483600, 128}; + cl_int2 intvals = {2100480000, 2100480000}; + CustomType2 value2 = {intvals, value1}; + + std::vector results(256, value2); + return test_composite_construct(deviceID, context, queue, "composite_construct_struct", results); +} diff --git a/test_conformance/spirv_new/test_op_constant.cpp b/test_conformance/spirv_new/test_op_constant.cpp new file mode 100644 index 00000000..afffdc35 --- /dev/null +++ b/test_conformance/spirv_new/test_op_constant.cpp @@ -0,0 +1,147 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + + + +template +int test_constant(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_CONSTANT(NAME, type, value) \ + TEST_SPIRV_FUNC(op_constant_##NAME##_simple) \ + { \ + std::vector results(1024, (type)value); \ + return test_constant(deviceID, context, queue, \ + "constant_" #NAME "_simple", \ + results); \ + } \ + +// Boolean tests +TEST_CONSTANT(true , cl_int , 1 ) +TEST_CONSTANT(false , cl_int , 0 ) + +// Integer tests +TEST_CONSTANT(int , cl_int , 123 ) +TEST_CONSTANT(uint , cl_uint , 54321 ) +TEST_CONSTANT(char , cl_char , 20 ) +TEST_CONSTANT(uchar , cl_uchar , 19 ) +TEST_CONSTANT(ushort, cl_ushort, 65000 ) +TEST_CONSTANT(long , cl_long , 34359738368L ) +TEST_CONSTANT(ulong , cl_ulong , 9223372036854775810UL) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation + TEST_CONSTANT(short , int16_t , 32000 ) +#else +TEST_CONSTANT(short , cl_short , 32000 ) +#endif + +// Float tests +TEST_CONSTANT(float , cl_float , 3.1415927 ) +TEST_CONSTANT(double , cl_double , 3.141592653589793) + +TEST_SPIRV_FUNC(op_constant_int4_simple) +{ + cl_int4 value = {123, 122, 121, 119}; + std::vector results(256, value); + return test_constant(deviceID, context, queue, "constant_int4_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_int3_simple) +{ + cl_int3 value = {123, 122, 121, 0}; + std::vector results(256, value); + return test_constant(deviceID, context, queue, "constant_int3_simple", + results, isVectorNotEqual); +} + +TEST_SPIRV_FUNC(op_constant_struct_int_float_simple) +{ + AbstractStruct2 value = {1024, 3.1415}; + std::vector > results(256, value); + return test_constant(deviceID, context, queue, "constant_struct_int_float_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_struct_int_char_simple) +{ + AbstractStruct2 value = {2100483600, 128}; + std::vector > results(256, value); + return test_constant(deviceID, context, queue, "constant_struct_int_char_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_struct_struct_simple) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + + CustomType1 value1 = {2100483600, 128}; + cl_int2 intvals = {2100480000, 2100480000}; + CustomType2 value2 = {intvals, value1}; + + std::vector results(256, value2); + return test_constant(deviceID, context, queue, "constant_struct_struct_simple", results); +} + +TEST_SPIRV_FUNC(op_constant_half_simple) +{ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); + std::vector results(1024, 3.25); + return test_constant(deviceID, context, queue, + "constant_half_simple", + results); +} diff --git a/test_conformance/spirv_new/test_op_copy_object.cpp b/test_conformance/spirv_new/test_op_copy_object.cpp new file mode 100644 index 00000000..b2b99955 --- /dev/null +++ b/test_conformance/spirv_new/test_op_copy_object.cpp @@ -0,0 +1,143 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + + + +template +int test_copy(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + std::vector &results, + bool (*notEqual)(const T&, const T&) = isNotEqual) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + clProgramWrapper prog; + cl_int err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)results.size(); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (notEqual(host[i], results[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_COPY(NAME, type, value) \ + TEST_SPIRV_FUNC(op_copy_##NAME##_simple) \ + { \ + std::vector results(1024, (type)value); \ + return test_copy(deviceID, context, queue, \ + "copy_" #NAME "_simple", \ + results); \ + } \ + +// Integer tests +TEST_COPY(int , cl_int , 123 ) +TEST_COPY(uint , cl_uint , 54321 ) +TEST_COPY(char , cl_char , 20 ) +TEST_COPY(uchar , cl_uchar , 19 ) +TEST_COPY(ushort, cl_ushort, 65000 ) +TEST_COPY(long , cl_long , 34359738368L ) +TEST_COPY(ulong , cl_ulong , 9223372036854775810UL) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation +TEST_COPY(short , int16_t , 32000 ) +#else +TEST_COPY(short , cl_short , 32000 ) +#endif + +// Float tests +TEST_COPY(float , cl_float , 3.1415927 ) +TEST_COPY(double , cl_double , 3.141592653589793) + +TEST_SPIRV_FUNC(op_copy_int4_simple) +{ + cl_int4 value = {123, 122, 121, 119}; + std::vector results(256, value); + return test_copy(deviceID, context, queue, "copy_int4_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_int3_simple) +{ + cl_int3 value = {123, 122, 121, 0}; + std::vector results(256, value); + return test_copy(deviceID, context, queue, "copy_int3_simple", + results, isVectorNotEqual); +} + +TEST_SPIRV_FUNC(op_copy_struct_int_float_simple) +{ + AbstractStruct2 value = {1024, 3.1415}; + std::vector > results(256, value); + return test_copy(deviceID, context, queue, "copy_struct_int_float_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_struct_int_char_simple) +{ + AbstractStruct2 value = {2100483600, 128}; + std::vector > results(256, value); + return test_copy(deviceID, context, queue, "copy_struct_int_char_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_struct_struct_simple) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + + CustomType1 value1 = {2100483600, 128}; + cl_int2 intvals = {2100480000, 2100480000}; + CustomType2 value2 = {intvals, value1}; + + std::vector results(256, value2); + return test_copy(deviceID, context, queue, "copy_struct_struct_simple", results); +} + +TEST_SPIRV_FUNC(op_copy_half_simple) +{ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); + std::vector results(1024, 3.25); + return test_copy(deviceID, context, queue, + "copy_half_simple", + results); +} diff --git a/test_conformance/spirv_new/test_op_fmath.cpp b/test_conformance/spirv_new/test_op_fmath.cpp new file mode 100644 index 00000000..7250eb15 --- /dev/null +++ b/test_conformance/spirv_new/test_op_fmath.cpp @@ -0,0 +1,201 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +template +int test_fmath(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *spvName, + const char *funcName, + const char *Tname, + bool fast_math, + std::vector &h_lhs, + std::vector &h_rhs) +{ + + if(std::string(Tname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + std::string kernelStr; + + { + std::stringstream kernelStream; + + if (is_double::value) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; + } else if (sizeof(T) == sizeof(cl_half)) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; + } + + kernelStream << "#define spirv_fadd(a, b) (a) + (b) \n"; + kernelStream << "#define spirv_fsub(a, b) (a) - (b) \n"; + kernelStream << "#define spirv_fmul(a, b) (a) * (b) \n"; + kernelStream << "#define spirv_fdiv(a, b) (a) / (b) \n"; + kernelStream << "#define spirv_frem(a, b) fmod(a, b) \n"; + kernelStream << "#define spirv_fmod(a, b) copysign(fmod(a,b),b) \n"; + kernelStream << "#define T " << Tname << "\n"; + kernelStream << "#define FUNC spirv_" << funcName << "\n"; + kernelStream << "__kernel void fmath_cl(__global T *out, \n"; + kernelStream << "const __global T *lhs, const __global T *rhs) \n"; + kernelStream << "{ \n"; + kernelStream << " int id = get_global_id(0); \n"; + kernelStream << " out[id] = FUNC(lhs[id], rhs[id]); \n"; + kernelStream << "} \n"; + kernelStr = kernelStream.str(); + } + + size_t kernelLen = kernelStr.size(); + const char *kernelBuf = kernelStr.c_str(); + + const char *options = fast_math ? "-cl-fast-relaxed-math" : NULL; + + std::vector h_ref(num); + + { + // Run the cl kernel for reference results + clProgramWrapper prog; + err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL); + SPIRV_CHECK_ERROR(err, "Failed to create cl program"); + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_cl", &err); + SPIRV_CHECK_ERROR(err, "Failed to create cl kernel"); + + clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create ref buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &ref); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + err = clEnqueueReadBuffer(queue, ref, CL_TRUE, 0, bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + } + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "fmath_spv", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_FMATH_FUNC(TYPE, FUNC, MODE) \ + TEST_SPIRV_FUNC(op_##FUNC##_##TYPE##_##MODE) \ + { \ + if (sizeof(cl_##TYPE) == 2) { \ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ + } \ + const int num = 1 << 20; \ + std::vector lhs(num); \ + std::vector rhs(num); \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrandReal(seed); \ + rhs[i] = genrandReal(seed); \ + } \ + \ + const char *mode = #MODE; \ + return test_fmath(deviceID, context, queue, \ + #FUNC "_" #TYPE, \ + #FUNC, \ + #TYPE, \ + mode[0] == 'f', \ + lhs, rhs); \ + } + +#define TEST_FMATH_MODE(TYPE, MODE) \ + TEST_FMATH_FUNC(TYPE, fadd, MODE) \ + TEST_FMATH_FUNC(TYPE, fsub, MODE) \ + TEST_FMATH_FUNC(TYPE, fmul, MODE) \ + TEST_FMATH_FUNC(TYPE, fdiv, MODE) \ + TEST_FMATH_FUNC(TYPE, frem, MODE) \ + TEST_FMATH_FUNC(TYPE, fmod, MODE) \ + +#define TEST_FMATH_TYPE(TYPE) \ + TEST_FMATH_MODE(TYPE, regular) \ + TEST_FMATH_MODE(TYPE, fast) \ + +TEST_FMATH_TYPE(float) +TEST_FMATH_TYPE(double) + +TEST_FMATH_TYPE(float4) +TEST_FMATH_TYPE(double2) + +TEST_FMATH_TYPE(half) diff --git a/test_conformance/spirv_new/test_op_function.cpp b/test_conformance/spirv_new/test_op_function.cpp new file mode 100644 index 00000000..caa3e0d3 --- /dev/null +++ b/test_conformance/spirv_new/test_op_function.cpp @@ -0,0 +1,89 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +int test_function(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *funcType, + const std::vector &h_in) +{ + cl_int err = CL_SUCCESS; + int num = (int)h_in.size(); + size_t bytes = sizeof(float) * num; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + cl_uint bits = sizeof(void *) * 8; + std::string spvStr = std::string("op_function") + "_" + std::string(funcType); + const char *spvName = spvStr.c_str(); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, spvName, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, in, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != -h_in[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + + +#define TEST_FUNCTION(TYPE) \ + TEST_SPIRV_FUNC(function_##TYPE) \ + { \ + int num = 1 << 20; \ + std::vector in(num); \ + RandomSeed seed(gRandomSeed); \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + return test_function(deviceID, \ + context, \ + queue, \ + #TYPE, \ + in); \ + } \ + +TEST_FUNCTION(none) +TEST_FUNCTION(inline) +TEST_FUNCTION(noinline) +TEST_FUNCTION(pure) +TEST_FUNCTION(const) +TEST_FUNCTION(pure_ptr) diff --git a/test_conformance/spirv_new/test_op_lifetime.cpp b/test_conformance/spirv_new/test_op_lifetime.cpp new file mode 100644 index 00000000..b60e14d6 --- /dev/null +++ b/test_conformance/spirv_new/test_op_lifetime.cpp @@ -0,0 +1,104 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_op_lifetime(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_LIFETIME(name) \ + TEST_SPIRV_FUNC(op_##name) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = lhs[i] - rhs[i]; \ + } \ + \ + return test_op_lifetime(deviceID, context, queue, \ + #name, \ + lhs, rhs, out); \ + } \ + +TEST_LIFETIME(lifetime_simple) diff --git a/test_conformance/spirv_new/test_op_loop_merge.cpp b/test_conformance/spirv_new/test_op_loop_merge.cpp new file mode 100644 index 00000000..23d257d9 --- /dev/null +++ b/test_conformance/spirv_new/test_op_loop_merge.cpp @@ -0,0 +1,113 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_selection_merge(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_in, + const std::vector &h_ref, + const int rep) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_ref.size(); + size_t bytes = num * sizeof(T); + size_t in_bytes = rep * bytes; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create out buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(int), &rep); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + err = clSetKernelArg(kernel, 3, sizeof(int), &num); + SPIRV_CHECK_ERROR(err, "Failed to set arg 3"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_LOOP_BRANCH(control) \ + TEST_SPIRV_FUNC(op_loop_merge_branch_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + int rep = 4; \ + std::vector in(rep * num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + int res = 0; \ + for (int j = 0; j < rep; j++) { \ + cl_int val = genrand(seed) % 1024; \ + res += val; \ + in[j * num + i] = val; \ + } \ + out[i] = res; \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "loop_merge_branch_" #control, \ + in, out, rep); \ + } \ + +TEST_LOOP_BRANCH(none) +TEST_LOOP_BRANCH(unroll) +TEST_LOOP_BRANCH(dont_unroll) + + +TEST_LOOP_BRANCH(conditional_none) +TEST_LOOP_BRANCH(conditional_unroll) +TEST_LOOP_BRANCH(conditional_dont_unroll) diff --git a/test_conformance/spirv_new/test_op_negate.cpp b/test_conformance/spirv_new/test_op_negate.cpp new file mode 100644 index 00000000..1891c9bb --- /dev/null +++ b/test_conformance/spirv_new/test_op_negate.cpp @@ -0,0 +1,119 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +template +int test_negation(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *Tname, + const char *funcName, + const std::vector &h_in, + Tv (*negate)(Tv) = negOp) +{ + if(std::string(Tname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + cl_int err = CL_SUCCESS; + int num = (int)h_in.size(); + size_t bytes = sizeof(Tv) * num; + + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create in buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer"); + + cl_uint bits = sizeof(void *) * 8; + std::string spvStr = std::string(funcName) + "_" + std::string(Tname); + const char *spvName = spvStr.c_str(); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, spvName, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_out(num); + err = clEnqueueReadBuffer(queue, in, CL_TRUE, 0, bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != negate(h_in[i])) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_NEGATION(TYPE, Tv, OP, FUNC) \ + TEST_SPIRV_FUNC(OP##_##TYPE) \ + { \ + int num = 1 << 20; \ + std::vector in(num); \ + RandomSeed seed(gRandomSeed); \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + return test_negation(deviceID, \ + context, \ + queue, \ + #TYPE, \ + #OP, \ + in, FUNC); \ + } \ + + +#define TEST_NEG(TYPE) TEST_NEGATION(TYPE, cl_##TYPE, op_neg, negOp) +#define TEST_NOT(TYPE) TEST_NEGATION(TYPE, cl_##TYPE, op_not, notOp) +#define TEST_NEG_VEC(TYPE, N) TEST_NEGATION(TYPE##N, cl_##TYPE##N, op_neg, (negOpVec)) +#define TEST_NOT_VEC(TYPE, N) TEST_NEGATION(TYPE##N, cl_##TYPE##N, op_not, (notOpVec)) + +TEST_NEG(float) +TEST_NEG(double) +TEST_NEG(int) +TEST_NEG(long) +TEST_NOT(int) +TEST_NOT(long) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation +TEST_NEGATION(short, short, op_neg, negOp) +TEST_NEGATION(short, short, op_not, notOp) +#else +TEST_NEG(short) +TEST_NOT(short) +#endif + +TEST_NEG_VEC(float , 4) +TEST_NEG_VEC(int , 4) +TEST_NOT_VEC(int , 4) diff --git a/test_conformance/spirv_new/test_op_opaque.cpp b/test_conformance/spirv_new/test_op_opaque.cpp new file mode 100644 index 00000000..930e26dc --- /dev/null +++ b/test_conformance/spirv_new/test_op_opaque.cpp @@ -0,0 +1,44 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +TEST_SPIRV_FUNC(op_type_opaque_simple) +{ + const char *name = "opaque"; + int num = (int)(1 << 10); + cl_int err = CL_SUCCESS; + std::vector buffer_vec = readSPIRV(name); + + int file_bytes = buffer_vec.size(); + if (file_bytes == 0) { + log_error("File not found\n"); + return -1; + } + unsigned char *buffer = &buffer_vec[0]; + + clProgramWrapper prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); + SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL"); + + err = clCompileProgram(prog, 1, &deviceID, + NULL, // options + 0, // num headers + NULL, // input headers + NULL, // header include names + NULL, // callback + NULL // User data + ); + SPIRV_CHECK_ERROR(err, "Failed to compile spv program"); + return 0; +} diff --git a/test_conformance/spirv_new/test_op_phi.cpp b/test_conformance/spirv_new/test_op_phi.cpp new file mode 100644 index 00000000..f9c69d79 --- /dev/null +++ b/test_conformance/spirv_new/test_op_phi.cpp @@ -0,0 +1,143 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_phi(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +TEST_SPIRV_FUNC(op_phi_2_blocks) +{ + const int num = 1 << 10; + RandomSeed seed(gRandomSeed); + + std::vector lhs(num); + std::vector rhs(num); + std::vector out(num); + + for (int i = 0; i < num; i++) { + lhs[i] = genrand(seed); + rhs[i] = genrand(seed); + out[i] = lhs[i] < rhs[i] ? (rhs[i] - lhs[i]) : (lhs[i] - rhs[i]); + } + + return test_phi(deviceID, context, queue, "phi_2", lhs, rhs, out); +} + +TEST_SPIRV_FUNC(op_phi_3_blocks) +{ + const int num = 1 << 10; + RandomSeed seed(gRandomSeed); + + std::vector lhs(num); + std::vector rhs(num); + std::vector out(num); + + for (int i = 0; i < num; i++) { + lhs[i] = genrand(seed); + rhs[i] = genrand(seed); + if (lhs[i] < rhs[i]) { + out[i] = lhs[i] < 0 ? -lhs[i] : lhs[i]; + } else { + out[i] = lhs[i] - rhs[i]; + } + } + + return test_phi(deviceID, context, queue, "phi_3", lhs, rhs, out); +} + +TEST_SPIRV_FUNC(op_phi_4_blocks) +{ + const int num = 1 << 10; + RandomSeed seed(gRandomSeed); + + std::vector lhs(num); + std::vector rhs(num); + std::vector out(num); + + for (int i = 0; i < num; i++) { + lhs[i] = genrand(seed); + rhs[i] = genrand(seed); + if (lhs[i] < rhs[i]) { + out[i] = lhs[i] < 0 ? -lhs[i] : lhs[i]; + } else { + out[i] = rhs[i] < 0 ? -rhs[i] : rhs[i]; + } + } + + return test_phi(deviceID, context, queue, "phi_4", lhs, rhs, out); +} diff --git a/test_conformance/spirv_new/test_op_selection_merge.cpp b/test_conformance/spirv_new/test_op_selection_merge.cpp new file mode 100644 index 00000000..6ea47f35 --- /dev/null +++ b/test_conformance/spirv_new/test_op_selection_merge.cpp @@ -0,0 +1,132 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + + +template +int test_selection_merge(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *name, + const std::vector &h_lhs, + const std::vector &h_rhs, + const std::vector &h_ref) +{ + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t bytes = num * sizeof(T); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_SELECT_IF(control) \ + TEST_SPIRV_FUNC(op_selection_merge_if_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = lhs[i] < rhs[i] ? \ + (rhs[i] - lhs[i]) : (lhs[i] - rhs[i]); \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "select_if_" #control, \ + lhs, rhs, out); \ + } \ + +TEST_SELECT_IF(none) +TEST_SELECT_IF(flatten) +TEST_SELECT_IF(dont_flatten) + +#define TEST_SELECT_SWITCH(control) \ + TEST_SPIRV_FUNC(op_selection_merge_swith_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = (lhs[i] + rhs[i]) % 4; \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "select_switch_" #control, \ + lhs, rhs, out); \ + } \ + +TEST_SELECT_SWITCH(none) +TEST_SELECT_SWITCH(flatten) +TEST_SELECT_SWITCH(dont_flatten) diff --git a/test_conformance/spirv_new/test_op_undef.cpp b/test_conformance/spirv_new/test_op_undef.cpp new file mode 100644 index 00000000..659ab1a9 --- /dev/null +++ b/test_conformance/spirv_new/test_op_undef.cpp @@ -0,0 +1,116 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + + + +template +int test_undef(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + int num = (int)(1 << 10); + cl_int err = CL_SUCCESS; + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + size_t bytes = num * sizeof(T); + clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + std::vector host(num); + err = clEnqueueReadBuffer(queue, mem, CL_TRUE, 0, bytes, &host[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + return 0; +} + +#define TEST_UNDEF(NAME, TYPE) \ + TEST_SPIRV_FUNC(op_undef_##NAME##_simple) \ + { \ + return test_undef(deviceID, context, queue, \ + "undef_" #NAME "_simple"); \ + } \ + +// Boolean tests +TEST_UNDEF(true , cl_int ) +TEST_UNDEF(false , cl_int ) + +// Integer tests +TEST_UNDEF(int , cl_int ) +TEST_UNDEF(uint , cl_uint ) +TEST_UNDEF(char , cl_char ) +TEST_UNDEF(uchar , cl_uchar) +TEST_UNDEF(ushort, cl_ushort) +TEST_UNDEF(long , cl_long ) +TEST_UNDEF(ulong , cl_ulong) + +#ifdef __GNUC__ +// std::vector is causing compilation errors on GCC 5.3 (works on gcc 4.8) +// Needs further investigation +TEST_UNDEF(short , int16_t ) +#else +TEST_UNDEF(short , cl_short) +#endif + +// Float tests +TEST_UNDEF(float , cl_float) +TEST_UNDEF(double, cl_double) +TEST_UNDEF(int4 , cl_int4) +TEST_UNDEF(int3 , cl_int3) + + +TEST_SPIRV_FUNC(op_undef_struct_int_float_simple) +{ + typedef AbstractStruct2 CustomType; + return test_undef(deviceID, context, queue, "undef_struct_int_float_simple"); +} + +TEST_SPIRV_FUNC(op_undef_struct_int_char_simple) +{ + typedef AbstractStruct2 CustomType; + return test_undef(deviceID, context, queue, "undef_struct_int_char_simple"); +} + +TEST_SPIRV_FUNC(op_undef_struct_struct_simple) +{ + typedef AbstractStruct2 CustomType1; + typedef AbstractStruct2 CustomType2; + return test_undef(deviceID, context, queue, "undef_struct_struct_simple"); +} + +TEST_SPIRV_FUNC(op_undef_half_simple) +{ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); + return test_undef(deviceID, context, queue, + "undef_half_simple"); +} diff --git a/test_conformance/spirv_new/test_op_vector_extract.cpp b/test_conformance/spirv_new/test_op_vector_extract.cpp new file mode 100644 index 00000000..fe1f8253 --- /dev/null +++ b/test_conformance/spirv_new/test_op_vector_extract.cpp @@ -0,0 +1,104 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_extract(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + const std::vector &h_in, const int n) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + cl_int err = CL_SUCCESS; + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)h_in.size(); + std::vector h_out(num); + + size_t in_bytes = num * sizeof(Tv); + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + size_t out_bytes = num * sizeof(Ts); + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_WRITE, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + for (int k = 0; k < n; k++) { + + err = clSetKernelArg(kernel, 2, sizeof(int), &k); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + if (h_out[i] != h_in[i].s[k]) { + log_error("Values do not match at location %d for vector position %d\n", i, k); + return -1; + } + } + } + return 0; +} + +#define TEST_VECTOR_EXTRACT(TYPE, N) \ + TEST_SPIRV_FUNC(op_vector_##TYPE##N##_extract) \ + { \ + typedef cl_##TYPE##N Tv; \ + typedef cl_##TYPE Ts; \ + const int num = 1 << 20; \ + std::vector in(num); \ + const char *name = "vector_" #TYPE #N "_extract"; \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + \ + return test_extract(deviceID, \ + context, queue, \ + name, \ + in, N); \ + } + +TEST_VECTOR_EXTRACT(int, 4) +TEST_VECTOR_EXTRACT(float, 4) +TEST_VECTOR_EXTRACT(long, 2) +TEST_VECTOR_EXTRACT(double, 2) +TEST_VECTOR_EXTRACT(char, 16) diff --git a/test_conformance/spirv_new/test_op_vector_insert.cpp b/test_conformance/spirv_new/test_op_vector_insert.cpp new file mode 100644 index 00000000..0749c14a --- /dev/null +++ b/test_conformance/spirv_new/test_op_vector_insert.cpp @@ -0,0 +1,122 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +template +int test_insert(cl_device_id deviceID, cl_context context, + cl_command_queue queue, const char *name, + const std::vector &h_in, const int n) +{ + if(std::string(name).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + cl_int err = CL_SUCCESS; + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, name); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, name, &err); + SPIRV_CHECK_ERROR(err, "Failed to create kernel"); + + int num = (int)h_in.size(); + std::vector h_ref(num); + std::vector h_out(num); + + RandomSeed seed(gRandomSeed); + for (int i = 0; i < num; i++) { + for (int j = 0; j < n; j++) { + h_ref[i].s[j] = h_in[i] + genrand(seed); + } + } + + size_t in_bytes = num * sizeof(Ts); + clMemWrapper in = clCreateBuffer(context, CL_MEM_READ_WRITE, in_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, in_bytes, &h_in[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + size_t out_bytes = num * sizeof(Tv); + clMemWrapper out = clCreateBuffer(context, CL_MEM_READ_WRITE, out_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &out); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + for (int k = 0; k < n; k++) { + + // Reset the values in h_out + err = clEnqueueWriteBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to cl_buffer"); + + err = clSetKernelArg(kernel, 2, sizeof(int), &k); + SPIRV_CHECK_ERROR(err, "Failed to set kernel argument"); + + size_t global = num; + // Kernel should the k'th value of the vector in h_out with h_in + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue kernel"); + + err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_out[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy from cl_buffer"); + + for (int i = 0; i < num; i++) { + // Kernel should have replaced k'th value of the vector in h_out with h_in + // The remaining values should be unchanged. + Tv refVec = h_ref[i]; + refVec.s[k] = h_in[i]; + for (int j = 0; j < n; j++) { + if (h_out[i].s[j] != refVec.s[j]) { + log_error("Values do not match at location %d for vector position %d\n", i, k); + return -1; + } + } + } + } + return 0; +} + +#define TEST_VECTOR_INSERT(TYPE, N) \ + TEST_SPIRV_FUNC(op_vector_##TYPE##N##_insert) \ + { \ + typedef cl_##TYPE##N Tv; \ + typedef cl_##TYPE Ts; \ + const int num = 1 << 20; \ + std::vector in(num); \ + const char *name = "vector_" #TYPE #N "_insert"; \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + in[i] = genrand(seed); \ + } \ + \ + return test_insert(deviceID, \ + context, queue, \ + name, \ + in, N); \ + } + +TEST_VECTOR_INSERT(int, 4) +TEST_VECTOR_INSERT(float, 4) +TEST_VECTOR_INSERT(long, 2) +TEST_VECTOR_INSERT(double, 2) +TEST_VECTOR_INSERT(char, 16) diff --git a/test_conformance/spirv_new/test_op_vector_times_scalar.cpp b/test_conformance/spirv_new/test_op_vector_times_scalar.cpp new file mode 100644 index 00000000..99d71f72 --- /dev/null +++ b/test_conformance/spirv_new/test_op_vector_times_scalar.cpp @@ -0,0 +1,181 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#include "testBase.h" +#include "types.hpp" + +#include +#include + +template +int test_vector_times_scalar(cl_device_id deviceID, + cl_context context, + cl_command_queue queue, + const char *Tname, + std::vector &h_lhs, + std::vector &h_rhs) +{ + if(std::string(Tname).find("double") != std::string::npos) { + if(!is_extension_available(deviceID, "cl_khr_fp64")) { + log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + return 0; + } + } + + cl_int err = CL_SUCCESS; + int num = (int)h_lhs.size(); + size_t lhs_bytes = num * sizeof(Tv); + size_t rhs_bytes = num * sizeof(Ts); + size_t res_bytes = lhs_bytes; + int vec_size = sizeof(Tv) / sizeof(Ts); + + clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, lhs_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create lhs buffer"); + + err = clEnqueueWriteBuffer(queue, lhs, CL_TRUE, 0, lhs_bytes, &h_lhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to lhs buffer"); + + clMemWrapper rhs = clCreateBuffer(context, CL_MEM_READ_ONLY, rhs_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create rhs buffer"); + + err = clEnqueueWriteBuffer(queue, rhs, CL_TRUE, 0, rhs_bytes, &h_rhs[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to copy to rhs buffer"); + + std::string kernelStr; + + { + std::stringstream kernelStream; + + if (is_double::value) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; + } else if (sizeof(Ts) == sizeof(cl_half)) { + kernelStream << "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; + } + + kernelStream << "#define Ts " << Tname << "\n"; + kernelStream << "#define Tv " << Tname << vec_size << "\n"; + kernelStream << "__kernel void vector_times_scalar( \n"; + kernelStream << " __global Tv *out, \n"; + kernelStream << " const __global Tv *lhs,\n"; + kernelStream << " const __global Ts *rhs)\n"; + kernelStream << "{ \n"; + kernelStream << " int id = get_global_id(0); \n"; + kernelStream << " out[id] = lhs[id] * rhs[id]; \n"; + kernelStream << "} \n"; + kernelStr = kernelStream.str(); + } + + size_t kernelLen = kernelStr.size(); + const char *kernelBuf = kernelStr.c_str(); + + std::vector h_ref(num); + { + // Run the cl kernel for reference results + clProgramWrapper prog; + err = create_single_kernel_helper_create_program(context, &prog, 1, &kernelBuf, NULL); + SPIRV_CHECK_ERROR(err, "Failed to create cl program"); + + err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "vector_times_scalar", &err); + SPIRV_CHECK_ERROR(err, "Failed to create cl kernel"); + + clMemWrapper ref = clCreateBuffer(context, CL_MEM_READ_WRITE, res_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create ref buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &ref); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + err = clEnqueueReadBuffer(queue, ref, CL_TRUE, 0, res_bytes, &h_ref[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + } + + cl_uint bits = sizeof(void *) * 8; + std::string ref = "vector_times_scalar_"; + ref += Tname; + const char *spvName = ref.c_str(); + + clProgramWrapper prog; + err = get_program_with_il(prog, deviceID, context, spvName); + SPIRV_CHECK_ERROR(err, "Failed to build program"); + + clKernelWrapper kernel = clCreateKernel(prog, "vector_times_scalar", &err); + SPIRV_CHECK_ERROR(err, "Failed to create spv kernel"); + + clMemWrapper res = clCreateBuffer(context, CL_MEM_READ_WRITE, res_bytes, NULL, &err); + SPIRV_CHECK_ERROR(err, "Failed to create res buffer"); + + err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &res); + SPIRV_CHECK_ERROR(err, "Failed to set arg 0"); + + err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &lhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 1"); + + err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &rhs); + SPIRV_CHECK_ERROR(err, "Failed to set arg 2"); + + size_t global = num; + err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel"); + + std::vector h_res(num); + err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, res_bytes, &h_res[0], 0, NULL, NULL); + SPIRV_CHECK_ERROR(err, "Failed to read from ref"); + + for (int i = 0; i < num; i++) { + if (h_res[i] != h_ref[i]) { + log_error("Values do not match at location %d\n", i); + return -1; + } + } + return 0; +} + +#define TEST_VECTOR_TIMES_SCALAR(TYPE, N) \ + TEST_SPIRV_FUNC(op_vector_times_scalar_##TYPE) \ + { \ + if (sizeof(cl_##TYPE) == 2) { \ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ + } \ + typedef cl_##TYPE##N Tv; \ + typedef cl_##TYPE Ts; \ + const int num = 1 << 20; \ + std::vector lhs(num); \ + std::vector rhs(num); \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) { \ + lhs[i] = genrandReal(seed); \ + rhs[i] = genrandReal(seed); \ + } \ + \ + return test_vector_times_scalar(deviceID, \ + context, queue, \ + #TYPE, \ + lhs, rhs); \ + } + +TEST_VECTOR_TIMES_SCALAR(float, 4) +TEST_VECTOR_TIMES_SCALAR(double, 4) diff --git a/test_conformance/spirv_new/types.hpp b/test_conformance/spirv_new/types.hpp new file mode 100644 index 00000000..e7fceba0 --- /dev/null +++ b/test_conformance/spirv_new/types.hpp @@ -0,0 +1,184 @@ +/****************************************************************** +Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved. + +This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. +This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to +third parties, and may not be reproduced, republished, distributed, transmitted, displayed, +broadcast or otherwise exploited in any manner without the express prior written permission +of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce, +disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, +in whole or in part other than under the terms of the Khronos Adopters Agreement +or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient. +******************************************************************/ + +#pragma once +#include + +#if defined(_MSC_VER) || defined(_WIN32) +#define PACKED(__STRUCT__) __pragma(pack(push, 1)) __STRUCT__ __pragma(pack(pop)) +#elif defined(__GNUC__) || defined(__clang__) +#define PACKED(__STRUCT__) __STRUCT__ __attribute__((packed)) +#endif + +template +inline bool isVectorNotEqual(const T &lhs, const T &rhs) +{ + bool result = false; + for (int i = 0; !result && i < n; i++) { + result |= lhs.s[i] != rhs.s[i]; + } + return result; +} + +#define VEC_NOT_EQ_FUNC(TYPE, N) \ + inline bool operator!=(const TYPE##N &lhs, const TYPE##N &rhs) \ + { \ + return isVectorNotEqual(lhs, rhs); \ + } \ + +VEC_NOT_EQ_FUNC(cl_int, 2) +VEC_NOT_EQ_FUNC(cl_int, 4) +VEC_NOT_EQ_FUNC(cl_uint, 4) +VEC_NOT_EQ_FUNC(cl_float, 2) +VEC_NOT_EQ_FUNC(cl_float, 4) +VEC_NOT_EQ_FUNC(cl_double, 2) +VEC_NOT_EQ_FUNC(cl_double, 4) + +template +bool isNotEqual(const T &lhs, const T &rhs) +{ + return lhs != rhs; +} + +// Can replace the following with tuples if c++11 can be used +template +struct AbstractStruct1 +{ + T val; +}; + +template +inline bool operator != (const AbstractStruct1 &lhs, const AbstractStruct1 &rhs) +{ + return lhs.val != rhs.val; +} + +template +struct AbstractStruct2 +{ + T0 val0; + T1 val1; +}; + + +template +inline bool operator != (const AbstractStruct2 &lhs, + const AbstractStruct2 &rhs) +{ + return lhs.val0 != rhs.val0 || lhs.val1 != rhs.val1; +} + + +template struct is_double { static const bool value = false; }; +template<> struct is_double { static const bool value = true; }; +template<> struct is_double { static const bool value = true; }; + +template +T genrandReal(RandomSeed &seed) +{ + return genrand_real1(seed); +} + +template +T genrandRealVec(RandomSeed &seed) +{ + T res; + for (int i = 0; i < N; i++) { + res.s[i] = genrand_real1(seed); + } + return res; +} + +#define GENRAND_REAL_FUNC(TYPE, N) \ + template<> inline TYPE##N genrandReal(RandomSeed &seed) \ + { \ + return genrandRealVec(seed); \ + } \ + +GENRAND_REAL_FUNC(cl_float, 2) +GENRAND_REAL_FUNC(cl_float, 4) +GENRAND_REAL_FUNC(cl_double, 2) +GENRAND_REAL_FUNC(cl_double, 4) + +template<> inline cl_half genrandReal(RandomSeed &seed) +{ + return (cl_half)(genrand_int32(seed) % 2048); +} + +template +T genrand(RandomSeed &seed) +{ + return genrandReal(seed); +} + +template<> inline cl_int genrand(RandomSeed &seed) +{ + return genrand_int32(seed); +} + +template<> inline cl_long genrand(RandomSeed &seed) +{ + return genrand_int32(seed); +} + +template<> inline cl_short genrand(RandomSeed &seed) +{ + return genrand_int32(seed); +} + +#define GENRAND_INT_VEC(T, N) \ + template<> inline T##N genrand(RandomSeed &seed) \ + { \ + T##N res; \ + for (int i = 0; i < N; i++) { \ + res.s[i] = (T)genrand_int32(seed); \ + } \ + return res; \ + } \ + +GENRAND_INT_VEC(cl_int, 4) +GENRAND_INT_VEC(cl_uint, 4) +GENRAND_INT_VEC(cl_long, 2) +GENRAND_INT_VEC(cl_char, 16) + +template +Tv negOp(Tv in) +{ + return -in; +} + +template +Tv notOp(Tv in) +{ + return ~in; +} + +template +Tv negOpVec(Tv in) +{ + Tv out; + for (int i = 0; i < N; i++) { + out.s[i] = -in.s[i]; + } + return out; +} + +template +Tv notOpVec(Tv in) +{ + Tv out; + for (int i = 0; i < N; i++) { + out.s[i] = ~in.s[i]; + } + return out; +}