1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=sparc | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker; TODO: actually fix the codegen to be optimal. At least we don't 4*9880d681SAndroid Build Coastguard Worker; crash for now, though... 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker;; Bitcast should not do a runtime conversion, but rather emit a 7*9880d681SAndroid Build Coastguard Worker;; constant into integer registers directly. 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: bitcast: 10*9880d681SAndroid Build Coastguard Worker; TODO-CHECK: sethi 1049856, %o0 11*9880d681SAndroid Build Coastguard Worker; TODO-CHECK: sethi 0, %o1 12*9880d681SAndroid Build Coastguard Workerdefine <2 x i32> @bitcast() { 13*9880d681SAndroid Build Coastguard Worker %1 = bitcast double 5.0 to <2 x i32> 14*9880d681SAndroid Build Coastguard Worker ret <2 x i32> %1 15*9880d681SAndroid Build Coastguard Worker} 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker;; Same thing for a call using a double (which gets passed in integer 18*9880d681SAndroid Build Coastguard Worker;; registers) 19*9880d681SAndroid Build Coastguard Worker 20*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_call 21*9880d681SAndroid Build Coastguard Worker; TODO-CHECK: sethi 1049856, %o0 22*9880d681SAndroid Build Coastguard Worker; TODO-CHECK: sethi 0, %o1 23*9880d681SAndroid Build Coastguard Workerdeclare void @a(double) 24*9880d681SAndroid Build Coastguard Workerdefine void @test_call() { 25*9880d681SAndroid Build Coastguard Worker call void @a(double 5.0) 26*9880d681SAndroid Build Coastguard Worker ret void 27*9880d681SAndroid Build Coastguard Worker} 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker;; And for a libcall emitted from the pow intrinsic. (libcall 30*9880d681SAndroid Build Coastguard Worker;; emission happens after SelectionDAG type legalization, so is a bit 31*9880d681SAndroid Build Coastguard Worker;; different than a normal function call. This was crashing before, 32*9880d681SAndroid Build Coastguard Worker;; due to an earlier broken workaround for this issue.) 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_intrins_call 35*9880d681SAndroid Build Coastguard Worker; TODO-CHECK: sethi 1049856, %o0 36*9880d681SAndroid Build Coastguard Worker; TODO-CHECK: sethi 0, %o1 37*9880d681SAndroid Build Coastguard Workerdeclare double @llvm.pow.f64(double, double) 38*9880d681SAndroid Build Coastguard Workerdefine double @test_intrins_call() { 39*9880d681SAndroid Build Coastguard Worker %1 = call double @llvm.pow.f64(double 2.0, double 2.0) 40*9880d681SAndroid Build Coastguard Worker ret double %1 41*9880d681SAndroid Build Coastguard Worker} 42