brintos

brintos / llvm-project-archived public Read only

0
0
Text · 843 B · b30e551 Raw
32 lines · plain
1;; #pragma OPENCL EXTENSION cl_khr_fp16 : enable2;; half test()3;; {4;;   half x = 0.1f;5;;   x += 2.0f;6;;   half y = x + x;7;;   return y;8;; }9 10; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV11 12; CHECK-SPIRV-DAG: OpCapability Float16Buffer13; CHECK-SPIRV-DAG: OpCapability Float1614 15define spir_func half @test() {16entry:17  %x = alloca half, align 218  %y = alloca half, align 219  store half 0xH2E66, half* %x, align 220  %0 = load half, half* %x, align 221  %conv = fpext half %0 to float22  %add = fadd float %conv, 2.000000e+0023  %conv1 = fptrunc float %add to half24  store half %conv1, half* %x, align 225  %1 = load half, half* %x, align 226  %2 = load half, half* %x, align 227  %add2 = fadd half %1, %228  store half %add2, half* %y, align 229  %3 = load half, half* %y, align 230  ret half %331}32