Home | History | Annotate | Download | only in AMDGPU
      1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
      2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s  | FileCheck -check-prefix=GCN %s
      3 
      4 declare float @llvm.fabs.f32(float) #0
      5 declare double @llvm.fabs.f64(double) #0
      6 declare float @llvm.amdgcn.frexp.mant.f32(float) #0
      7 declare double @llvm.amdgcn.frexp.mant.f64(double) #0
      8 
      9 ; GCN-LABEL: {{^}}s_test_frexp_mant_f32:
     10 ; GCN: v_frexp_mant_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}
     11 define void @s_test_frexp_mant_f32(float addrspace(1)* %out, float %src) #1 {
     12   %frexp.mant = call float @llvm.amdgcn.frexp.mant.f32(float %src)
     13   store float %frexp.mant, float addrspace(1)* %out
     14   ret void
     15 }
     16 
     17 ; GCN-LABEL: {{^}}s_test_fabs_frexp_mant_f32:
     18 ; GCN: v_frexp_mant_f32_e64 {{v[0-9]+}}, |{{s[0-9]+}}|
     19 define void @s_test_fabs_frexp_mant_f32(float addrspace(1)* %out, float %src) #1 {
     20   %fabs.src = call float @llvm.fabs.f32(float %src)
     21   %frexp.mant = call float @llvm.amdgcn.frexp.mant.f32(float %fabs.src)
     22   store float %frexp.mant, float addrspace(1)* %out
     23   ret void
     24 }
     25 
     26 ; GCN-LABEL: {{^}}s_test_fneg_fabs_frexp_mant_f32:
     27 ; GCN: v_frexp_mant_f32_e64 {{v[0-9]+}}, -|{{s[0-9]+}}|
     28 define void @s_test_fneg_fabs_frexp_mant_f32(float addrspace(1)* %out, float %src) #1 {
     29   %fabs.src = call float @llvm.fabs.f32(float %src)
     30   %fneg.fabs.src = fsub float -0.0, %fabs.src
     31   %frexp.mant = call float @llvm.amdgcn.frexp.mant.f32(float %fneg.fabs.src)
     32   store float %frexp.mant, float addrspace(1)* %out
     33   ret void
     34 }
     35 
     36 ; GCN-LABEL: {{^}}s_test_frexp_mant_f64:
     37 ; GCN: v_frexp_mant_f64_e32 {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}
     38 define void @s_test_frexp_mant_f64(double addrspace(1)* %out, double %src) #1 {
     39   %frexp.mant = call double @llvm.amdgcn.frexp.mant.f64(double %src)
     40   store double %frexp.mant, double addrspace(1)* %out
     41   ret void
     42 }
     43 
     44 ; GCN-LABEL: {{^}}s_test_fabs_frexp_mant_f64:
     45 ; GCN: v_frexp_mant_f64_e64 {{v\[[0-9]+:[0-9]+\]}}, |{{s\[[0-9]+:[0-9]+\]}}|
     46 define void @s_test_fabs_frexp_mant_f64(double addrspace(1)* %out, double %src) #1 {
     47   %fabs.src = call double @llvm.fabs.f64(double %src)
     48   %frexp.mant = call double @llvm.amdgcn.frexp.mant.f64(double %fabs.src)
     49   store double %frexp.mant, double addrspace(1)* %out
     50   ret void
     51 }
     52 
     53 ; GCN-LABEL: {{^}}s_test_fneg_fabs_frexp_mant_f64:
     54 ; GCN: v_frexp_mant_f64_e64 {{v\[[0-9]+:[0-9]+\]}}, -|{{s\[[0-9]+:[0-9]+\]}}|
     55 define void @s_test_fneg_fabs_frexp_mant_f64(double addrspace(1)* %out, double %src) #1 {
     56   %fabs.src = call double @llvm.fabs.f64(double %src)
     57   %fneg.fabs.src = fsub double -0.0, %fabs.src
     58   %frexp.mant = call double @llvm.amdgcn.frexp.mant.f64(double %fneg.fabs.src)
     59   store double %frexp.mant, double addrspace(1)* %out
     60   ret void
     61 }
     62 
     63 attributes #0 = { nounwind readnone }
     64 attributes #1 = { nounwind }
     65