1 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx < %s | FileCheck %s 2 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx < %s | FileCheck -check-prefix=CHECK-VSX %s 3 target 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-f128:128:128-v128:128:128-n32:64" 4 target triple = "powerpc64-unknown-linux-gnu" 5 6 define double @foo_dd(double %a, double %b) #0 { 7 entry: 8 %call = tail call double @copysign(double %a, double %b) #0 9 ret double %call 10 11 ; CHECK-LABEL: @foo_dd 12 ; CHECK: fcpsgn 1, 2, 1 13 ; CHECK: blr 14 ; CHECK-VSX-LABEL: @foo_dd 15 ; CHECK-VSX: xscpsgndp 1, 2, 1 16 ; CHECK-VSX: blr 17 } 18 19 declare double @copysign(double, double) #0 20 21 define float @foo_ss(float %a, float %b) #0 { 22 entry: 23 %call = tail call float @copysignf(float %a, float %b) #0 24 ret float %call 25 26 ; CHECK-LABEL: @foo_ss 27 ; CHECK: fcpsgn 1, 2, 1 28 ; CHECK: blr 29 ; CHECK-VSX-LABEL: @foo_ss 30 ; CHECK-VSX: fcpsgn 1, 2, 1 31 ; CHECK-VSX: blr 32 } 33 34 declare float @copysignf(float, float) #0 35 36 define float @foo_sd(float %a, double %b) #0 { 37 entry: 38 %conv = fptrunc double %b to float 39 %call = tail call float @copysignf(float %a, float %conv) #0 40 ret float %call 41 42 ; CHECK-LABEL: @foo_sd 43 ; CHECK: fcpsgn 1, 2, 1 44 ; CHECK: blr 45 ; CHECK-VSX-LABEL: @foo_sd 46 ; CHECK-VSX: fcpsgn 1, 2, 1 47 ; CHECK-VSX: blr 48 } 49 50 define double @foo_ds(double %a, float %b) #0 { 51 entry: 52 %conv = fpext float %b to double 53 %call = tail call double @copysign(double %a, double %conv) #0 54 ret double %call 55 56 ; CHECK-LABEL: @foo_ds 57 ; CHECK: fcpsgn 1, 2, 1 58 ; CHECK: blr 59 ; CHECK-VSX-LABEL: @foo_ds 60 ; CHECK-VSX: fcpsgn 1, 2, 1 61 ; CHECK-VSX: blr 62 } 63 64 attributes #0 = { nounwind readnone } 65 66