xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/uint64-to-float.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mcpu=generic -march=x86-64 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; Verify that we are using the efficient uitofp --> sitofp lowering illustrated
3*9880d681SAndroid Build Coastguard Worker; by the compiler_rt implementation of __floatundisf.
4*9880d681SAndroid Build Coastguard Worker; <rdar://problem/8493982>
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
7*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-darwin10.0.0"
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; CHECK: andl
10*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: testq %rdi, %rdi
11*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: js LBB0_1
12*9880d681SAndroid Build Coastguard Worker; CHECK: cvtsi2ss
13*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: ret
14*9880d681SAndroid Build Coastguard Worker; CHECK: LBB0_1
15*9880d681SAndroid Build Coastguard Worker; CHECK: shrq
16*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: orq
17*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: cvtsi2ss
18*9880d681SAndroid Build Coastguard Workerdefine float @test(i64 %a) {
19*9880d681SAndroid Build Coastguard Workerentry:
20*9880d681SAndroid Build Coastguard Worker  %b = uitofp i64 %a to float
21*9880d681SAndroid Build Coastguard Worker  ret float %b
22*9880d681SAndroid Build Coastguard Worker}
23