Home | History | Annotate | Download | only in AMDGPU
      1 ; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck -check-prefix=SI %s
      2 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck -check-prefix=SI %s
      3 
      4 ; SI-LABEL: {{^}}vector_imax:
      5 ; SI: v_max_i32_e32
      6 define void @vector_imax(i32 %p0, i32 %p1, i32 addrspace(1)* %in) #0 {
      7 main_body:
      8   %load = load i32, i32 addrspace(1)* %in, align 4
      9   %max = call i32 @llvm.AMDGPU.imax(i32 %p0, i32 %load)
     10   %bc = bitcast i32 %max to float
     11   call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 0, float %bc, float %bc, float %bc, float %bc)
     12   ret void
     13 }
     14 
     15 ; SI-LABEL: {{^}}scalar_imax:
     16 ; SI: s_max_i32
     17 define void @scalar_imax(i32 %p0, i32 %p1) #0 {
     18 entry:
     19   %max = call i32 @llvm.AMDGPU.imax(i32 %p0, i32 %p1)
     20   %bc = bitcast i32 %max to float
     21   call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 0, float %bc, float %bc, float %bc, float %bc)
     22   ret void
     23 }
     24 
     25 ; Function Attrs: readnone
     26 declare i32 @llvm.AMDGPU.imax(i32, i32) #1
     27 
     28 declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
     29 
     30 attributes #0 = { nounwind }
     31 attributes #1 = { nounwind readnone }
     32 
     33 !0 = !{!"const", null, i32 1}
     34