CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
128 lines
6.2 KiB
LLVM
128 lines
6.2 KiB
LLVM
; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; CHECK-DAG: %[[#float_64:]] = OpTypeFloat 64
|
|
; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 32
|
|
; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 16
|
|
; CHECK-DAG: %[[#vec2_float_16:]] = OpTypeVector %[[#float_16]] 2
|
|
; CHECK-DAG: %[[#vec2_float_32:]] = OpTypeVector %[[#float_32]] 2
|
|
; CHECK-DAG: %[[#vec2_float_64:]] = OpTypeVector %[[#float_64]] 2
|
|
; CHECK-DAG: %[[#vec3_float_16:]] = OpTypeVector %[[#float_16]] 3
|
|
; CHECK-DAG: %[[#vec3_float_32:]] = OpTypeVector %[[#float_32]] 3
|
|
; CHECK-DAG: %[[#vec3_float_64:]] = OpTypeVector %[[#float_64]] 3
|
|
; CHECK-DAG: %[[#vec4_float_16:]] = OpTypeVector %[[#float_16]] 4
|
|
; CHECK-DAG: %[[#vec4_float_32:]] = OpTypeVector %[[#float_32]] 4
|
|
; CHECK-DAG: %[[#vec4_float_64:]] = OpTypeVector %[[#float_64]] 4
|
|
; CHECK-DAG: %[[#const_f64_1:]] = OpConstant %[[#float_64]] 1
|
|
; CHECK-DAG: %[[#const_f32_1:]] = OpConstant %[[#float_32]] 1
|
|
; CHECK-DAG: %[[#const_f16_1:]] = OpConstant %[[#float_16]] 1
|
|
|
|
; CHECK-DAG: %[[#vec2_const_ones_f16:]] = OpConstantComposite %[[#vec2_float_16]] %[[#const_f16_1]] %[[#const_f16_1]]
|
|
; CHECK-DAG: %[[#vec3_const_ones_f16:]] = OpConstantComposite %[[#vec3_float_16]] %[[#const_f16_1]] %[[#const_f16_1]] %[[#const_f16_1]]
|
|
; CHECK-DAG: %[[#vec4_const_ones_f16:]] = OpConstantComposite %[[#vec4_float_16]] %[[#const_f16_1]] %[[#const_f16_1]] %[[#const_f16_1]] %[[#const_f16_1]]
|
|
|
|
; CHECK-DAG: %[[#vec2_const_ones_f32:]] = OpConstantComposite %[[#vec2_float_32]] %[[#const_f32_1]] %[[#const_f32_1]]
|
|
; CHECK-DAG: %[[#vec3_const_ones_f32:]] = OpConstantComposite %[[#vec3_float_32]] %[[#const_f32_1]] %[[#const_f32_1]] %[[#const_f32_1]]
|
|
; CHECK-DAG: %[[#vec4_const_ones_f32:]] = OpConstantComposite %[[#vec4_float_32]] %[[#const_f32_1]] %[[#const_f32_1]] %[[#const_f32_1]] %[[#const_f32_1]]
|
|
|
|
; CHECK-DAG: %[[#vec2_const_ones_f64:]] = OpConstantComposite %[[#vec2_float_64]] %[[#const_f64_1]] %[[#const_f64_1]]
|
|
; CHECK-DAG: %[[#vec3_const_ones_f64:]] = OpConstantComposite %[[#vec3_float_64]] %[[#const_f64_1]] %[[#const_f64_1]] %[[#const_f64_1]]
|
|
; CHECK-DAG: %[[#vec4_const_ones_f64:]] = OpConstantComposite %[[#vec4_float_64]] %[[#const_f64_1]] %[[#const_f64_1]] %[[#const_f64_1]] %[[#const_f64_1]]
|
|
|
|
|
|
define spir_func noundef half @test_rcp_half(half noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_16]]
|
|
; CHECK: OpFDiv %[[#float_16]] %[[#const_f16_1]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv half 0xH3C00, %p0
|
|
ret half %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <2 x half> @test_rcp_half2(<2 x half> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec2_float_16]]
|
|
; CHECK: OpFDiv %[[#vec2_float_16]] %[[#vec2_const_ones_f16]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <2 x half> <half 0xH3C00, half 0xH3C00>, %p0
|
|
ret <2 x half> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <3 x half> @test_rcp_half3(<3 x half> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec3_float_16]]
|
|
; CHECK: OpFDiv %[[#vec3_float_16]] %[[#vec3_const_ones_f16]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <3 x half> <half 0xH3C00, half 0xH3C00, half 0xH3C00>, %p0
|
|
ret <3 x half> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <4 x half> @test_rcp_half4(<4 x half> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_16]]
|
|
; CHECK: OpFDiv %[[#vec4_float_16]] %[[#vec4_const_ones_f16]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <4 x half> <half 0xH3C00, half 0xH3C00, half 0xH3C00, half 0xH3C00>, %p0
|
|
ret <4 x half> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef float @test_rcp_float(float noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_32]]
|
|
; CHECK: OpFDiv %[[#float_32]] %[[#const_f32_1]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv float 1.000000e+00, %p0
|
|
ret float %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <2 x float> @test_rcp_float2(<2 x float> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec2_float_32]]
|
|
; CHECK: OpFDiv %[[#vec2_float_32]] %[[#vec2_const_ones_f32]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <2 x float> <float 1.000000e+00, float 1.000000e+00>, %p0
|
|
ret <2 x float> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <3 x float> @test_rcp_float3(<3 x float> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec3_float_32]]
|
|
; CHECK: OpFDiv %[[#vec3_float_32]] %[[#vec3_const_ones_f32]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <3 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %p0
|
|
ret <3 x float> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <4 x float> @test_rcp_float4(<4 x float> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_32]]
|
|
; CHECK: OpFDiv %[[#vec4_float_32]] %[[#vec4_const_ones_f32]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %p0
|
|
ret <4 x float> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef double @test_rcp_double(double noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_64]]
|
|
; CHECK: OpFDiv %[[#float_64]] %[[#const_f64_1]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv double 1.000000e+00, %p0
|
|
ret double %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <2 x double> @test_rcp_double2(<2 x double> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec2_float_64:]]
|
|
; CHECK: OpFDiv %[[#vec2_float_64]] %[[#vec2_const_ones_f64]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %p0
|
|
ret <2 x double> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <3 x double> @test_rcp_double3(<3 x double> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec3_float_64:]]
|
|
; CHECK: OpFDiv %[[#vec3_float_64]] %[[#vec3_const_ones_f64]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <3 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>, %p0
|
|
ret <3 x double> %hlsl.rcp
|
|
}
|
|
|
|
define spir_func noundef <4 x double> @test_rcp_double4(<4 x double> noundef %p0) #0 {
|
|
entry:
|
|
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_64]]
|
|
; CHECK: OpFDiv %[[#vec4_float_64]] %[[#vec4_const_ones_f64]] %[[#arg0]]
|
|
%hlsl.rcp = fdiv <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>, %p0
|
|
ret <4 x double> %hlsl.rcp
|
|
}
|