1 ;; #pragma OPENCL EXTENSION cl_khr_fp16 : enable
10 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
12 ; CHECK-SPIRV-DAG: OpCapability Float16Buffer
13 ; CHECK-SPIRV-DAG: OpCapability Float16
15 define spir_func half @test() {
17 %x = alloca half, align 2
18 %y = alloca half, align 2
19 store half 0xH2E66, half* %x, align 2
20 %0 = load half, half* %x, align 2
21 %conv = fpext half %0 to float
22 %add = fadd float %conv, 2.000000e+00
23 %conv1 = fptrunc float %add to half
24 store half %conv1, half* %x, align 2
25 %1 = load half, half* %x, align 2
26 %2 = load half, half* %x, align 2
27 %add2 = fadd half %1, %2
28 store half %add2, half* %y, align 2
29 %3 = load half, half* %y, align 2