1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=GCN %s 2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=VI -check-prefix=GCN %s 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.amdgcn.div.fixup.f32(float, float, float) nounwind readnone 5*9880d681SAndroid Build Coastguard Workerdeclare double @llvm.amdgcn.div.fixup.f64(double, double, double) nounwind readnone 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Worker; GCN-LABEL: {{^}}test_div_fixup_f32: 8*9880d681SAndroid Build Coastguard Worker; SI-DAG: s_load_dword [[SA:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0xb 9*9880d681SAndroid Build Coastguard Worker; SI-DAG: s_load_dword [[SC:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0xd 10*9880d681SAndroid Build Coastguard Worker; SI-DAG: s_load_dword [[SB:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0xc 11*9880d681SAndroid Build Coastguard Worker; VI-DAG: s_load_dword [[SA:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0x2c 12*9880d681SAndroid Build Coastguard Worker; VI-DAG: s_load_dword [[SC:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0x34 13*9880d681SAndroid Build Coastguard Worker; VI-DAG: s_load_dword [[SB:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0x30 14*9880d681SAndroid Build Coastguard Worker; GCN-DAG: v_mov_b32_e32 [[VC:v[0-9]+]], [[SC]] 15*9880d681SAndroid Build Coastguard Worker; GCN-DAG: v_mov_b32_e32 [[VB:v[0-9]+]], [[SB]] 16*9880d681SAndroid Build Coastguard Worker; GCN: v_div_fixup_f32 [[RESULT:v[0-9]+]], [[SA]], [[VB]], [[VC]] 17*9880d681SAndroid Build Coastguard Worker; GCN: buffer_store_dword [[RESULT]], 18*9880d681SAndroid Build Coastguard Worker; GCN: s_endpgm 19*9880d681SAndroid Build Coastguard Workerdefine void @test_div_fixup_f32(float addrspace(1)* %out, float %a, float %b, float %c) nounwind { 20*9880d681SAndroid Build Coastguard Worker %result = call float @llvm.amdgcn.div.fixup.f32(float %a, float %b, float %c) nounwind readnone 21*9880d681SAndroid Build Coastguard Worker store float %result, float addrspace(1)* %out, align 4 22*9880d681SAndroid Build Coastguard Worker ret void 23*9880d681SAndroid Build Coastguard Worker} 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Worker; GCN-LABEL: {{^}}test_div_fixup_f64: 26*9880d681SAndroid Build Coastguard Worker; GCN: v_div_fixup_f64 27*9880d681SAndroid Build Coastguard Workerdefine void @test_div_fixup_f64(double addrspace(1)* %out, double %a, double %b, double %c) nounwind { 28*9880d681SAndroid Build Coastguard Worker %result = call double @llvm.amdgcn.div.fixup.f64(double %a, double %b, double %c) nounwind readnone 29*9880d681SAndroid Build Coastguard Worker store double %result, double addrspace(1)* %out, align 8 30*9880d681SAndroid Build Coastguard Worker ret void 31*9880d681SAndroid Build Coastguard Worker} 32