Home | History | Annotate | Download | only in R600
      1 ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI %s
      2 
      3 declare float @llvm.AMDGPU.cvt.f32.ubyte0(i32) nounwind readnone
      4 declare float @llvm.AMDGPU.cvt.f32.ubyte1(i32) nounwind readnone
      5 declare float @llvm.AMDGPU.cvt.f32.ubyte2(i32) nounwind readnone
      6 declare float @llvm.AMDGPU.cvt.f32.ubyte3(i32) nounwind readnone
      7 
      8 ; SI-LABEL: @test_unpack_byte0_to_float:
      9 ; SI: V_CVT_F32_UBYTE0
     10 define void @test_unpack_byte0_to_float(float addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
     11   %val = load i32 addrspace(1)* %in, align 4
     12   %cvt = call float @llvm.AMDGPU.cvt.f32.ubyte0(i32 %val) nounwind readnone
     13   store float %cvt, float addrspace(1)* %out, align 4
     14   ret void
     15 }
     16 
     17 ; SI-LABEL: @test_unpack_byte1_to_float:
     18 ; SI: V_CVT_F32_UBYTE1
     19 define void @test_unpack_byte1_to_float(float addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
     20   %val = load i32 addrspace(1)* %in, align 4
     21   %cvt = call float @llvm.AMDGPU.cvt.f32.ubyte1(i32 %val) nounwind readnone
     22   store float %cvt, float addrspace(1)* %out, align 4
     23   ret void
     24 }
     25 
     26 ; SI-LABEL: @test_unpack_byte2_to_float:
     27 ; SI: V_CVT_F32_UBYTE2
     28 define void @test_unpack_byte2_to_float(float addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
     29   %val = load i32 addrspace(1)* %in, align 4
     30   %cvt = call float @llvm.AMDGPU.cvt.f32.ubyte2(i32 %val) nounwind readnone
     31   store float %cvt, float addrspace(1)* %out, align 4
     32   ret void
     33 }
     34 
     35 ; SI-LABEL: @test_unpack_byte3_to_float:
     36 ; SI: V_CVT_F32_UBYTE3
     37 define void @test_unpack_byte3_to_float(float addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
     38   %val = load i32 addrspace(1)* %in, align 4
     39   %cvt = call float @llvm.AMDGPU.cvt.f32.ubyte3(i32 %val) nounwind readnone
     40   store float %cvt, float addrspace(1)* %out, align 4
     41   ret void
     42 }
     43