| 1 |
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 2 |
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %} |
| 3 |
|
| 4 |
; CHECK-SPIRV: %[[#HALF:]] = OpTypeFloat 16 |
| 5 |
; CHECK-SPIRV: %[[#HALFPTR:]] = OpTypePointer Function %[[#HALF]] |
| 6 |
; CHECK-SPIRV: %[[#HALFV2:]] = OpTypeVector %[[#HALF]] 2 |
| 7 |
; CHECK-SPIRV: %[[#HALFV2PTR:]] = OpTypePointer Function %[[#HALFV2]] |
| 8 |
; CHECK-SPIRV: %[[#CONST:]] = OpConstant %[[#HALF]] 14788 |
| 9 |
; CHECK-SPIRV: %[[#ADDR:]] = OpVariable %[[#HALFPTR]] Function |
| 10 |
; CHECK-SPIRV: %[[#ADDR2:]] = OpVariable %[[#HALFV2PTR]] Function |
| 11 |
; CHECK-SPIRV: %[[#]] = OpExtInst %[[#HALF]] %[[#]] fract %[[#CONST]] %[[#ADDR]] |
| 12 |
; CHECK-SPIRV: %[[#]] = OpExtInst %[[#HALFV2]] %[[#]] fract %[[#]] %[[#ADDR2]] |
| 13 |
|
| 14 |
define spir_kernel void @test() { |
| 15 |
entry: |
| 16 |
%addr = alloca half |
| 17 |
%addr2 = alloca <2 x half> |
| 18 |
%res = call spir_func noundef half @_Z17__spirv_ocl_fractDF16_PU3AS0DF16_(half noundef 0xH39C4, ptr noundef %addr) |
| 19 |
%res2 = call spir_func noundef <2 x half> @_Z17__spirv_ocl_fractDv2_DF16_PU3AS0S_(<2 x half> noundef <half 0xH39C4, half 0xH0000>, ptr noundef %addr2) |
| 20 |
ret void |
| 21 |
} |
| 22 |
|
| 23 |
declare spir_func noundef half @_Z17__spirv_ocl_fractDF16_PU3AS0DF16_(half noundef, ptr noundef) local_unnamed_addr |
| 24 |
|
| 25 |
declare spir_func noundef <2 x half> @_Z17__spirv_ocl_fractDv2_DF16_PU3AS0S_(<2 x half> noundef, ptr noundef) local_unnamed_addr |