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
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
9 ; GCN-LABEL: {{^}}s_test_frexp_mant_f32:
10 ; GCN: v_frexp_mant_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}
11 define amdgpu_kernel 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
17 ; GCN-LABEL: {{^}}s_test_fabs_frexp_mant_f32:
18 ; GCN: v_frexp_mant_f32_e64 {{v[0-9]+}}, |{{s[0-9]+}}|
19 define amdgpu_kernel 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
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 amdgpu_kernel 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
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 amdgpu_kernel 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
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 amdgpu_kernel 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
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 amdgpu_kernel 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
63 attributes #0 = { nounwind readnone }
64 attributes #1 = { nounwind }