1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64el -mcpu=mips4 -target-abi=n64 | \ 2*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck %s -check-prefixes=ALL,64 3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64el -mcpu=mips64 -target-abi=n64 | \ 4*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck %s -check-prefixes=ALL,64 5*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64el -mcpu=mips64r2 -target-abi=n64 | \ 6*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck %s -check-prefixes=ALL,64R2 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Workerdeclare double @copysign(double, double) nounwind readnone 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Workerdeclare float @copysignf(float, float) nounwind readnone 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Workerdefine float @func2(float %d, double %f) nounwind readnone { 13*9880d681SAndroid Build Coastguard Workerentry: 14*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: func2: 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Worker; 64-DAG: lui $[[T0:[0-9]+]], 32767 17*9880d681SAndroid Build Coastguard Worker; 64-DAG: ori $[[MSK0:[0-9]+]], $[[T0]], 65535 18*9880d681SAndroid Build Coastguard Worker; 64-DAG: and $[[AND0:[0-9]+]], ${{[0-9]+}}, $[[MSK0]] 19*9880d681SAndroid Build Coastguard Worker; 64-DAG: dsrl $[[DSRL:[0-9]+]], ${{[0-9]+}}, 63 20*9880d681SAndroid Build Coastguard Worker; 64-DAG: sll $[[SLL0:[0-9]+]], $[[DSRL]], 0 21*9880d681SAndroid Build Coastguard Worker; 64-DAG: sll $[[SLL1:[0-9]+]], $[[SLL0]], 31 22*9880d681SAndroid Build Coastguard Worker; 64: or $[[OR:[0-9]+]], $[[AND0]], $[[SLL1]] 23*9880d681SAndroid Build Coastguard Worker; 64: mtc1 $[[OR]], $f0 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Worker; 64R2: dextu ${{[0-9]+}}, ${{[0-9]+}}, 63, 1 26*9880d681SAndroid Build Coastguard Worker; 64R2: ins $[[INS:[0-9]+]], ${{[0-9]+}}, 31, 1 27*9880d681SAndroid Build Coastguard Worker; 64R2: mtc1 $[[INS]], $f0 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker %add = fadd float %d, 1.000000e+00 30*9880d681SAndroid Build Coastguard Worker %conv = fptrunc double %f to float 31*9880d681SAndroid Build Coastguard Worker %call = tail call float @copysignf(float %add, float %conv) nounwind readnone 32*9880d681SAndroid Build Coastguard Worker ret float %call 33*9880d681SAndroid Build Coastguard Worker} 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Workerdefine double @func3(double %d, float %f) nounwind readnone { 36*9880d681SAndroid Build Coastguard Workerentry: 37*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: func3: 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Worker; 64-DAG: mfc1 $[[MFC:[0-9]+]], $f13 40*9880d681SAndroid Build Coastguard Worker; 64-DAG: srl $[[SRL:[0-9]+]], $[[MFC:[0-9]+]], 31 41*9880d681SAndroid Build Coastguard Worker; 64: dsll $[[DSLL:[0-9]+]], $[[SRL]], 63 42*9880d681SAndroid Build Coastguard Worker; 64-DAG: daddiu $[[R1:[0-9]+]], $zero, 1 43*9880d681SAndroid Build Coastguard Worker; 64-DAG: dsll $[[R2:[0-9]+]], $[[R1]], 63 44*9880d681SAndroid Build Coastguard Worker; 64-DAG: daddiu $[[R3:[0-9]+]], $[[R2]], -1 45*9880d681SAndroid Build Coastguard Worker; 64-DAG: dmfc1 $[[R0:[0-9]+]], ${{.*}} 46*9880d681SAndroid Build Coastguard Worker; 64: and $[[AND0:[0-9]+]], $[[R0]], $[[R3]] 47*9880d681SAndroid Build Coastguard Worker; 64: or $[[OR:[0-9]+]], $[[AND0]], $[[DSLL]] 48*9880d681SAndroid Build Coastguard Worker; 64: dmtc1 $[[OR]], $f0 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Worker; 64R2: ext ${{[0-9]+}}, ${{[0-9]+}}, 31, 1 51*9880d681SAndroid Build Coastguard Worker; 64R2: dins $[[INS:[0-9]+]], ${{[0-9]+}}, 63, 1 52*9880d681SAndroid Build Coastguard Worker; 64R2: dmtc1 $[[INS]], $f0 53*9880d681SAndroid Build Coastguard Worker 54*9880d681SAndroid Build Coastguard Worker %add = fadd double %d, 1.000000e+00 55*9880d681SAndroid Build Coastguard Worker %conv = fpext float %f to double 56*9880d681SAndroid Build Coastguard Worker %call = tail call double @copysign(double %add, double %conv) nounwind readnone 57*9880d681SAndroid Build Coastguard Worker ret double %call 58*9880d681SAndroid Build Coastguard Worker} 59