1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -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"
6 define double @foo_dd(double %a, double %b) #0 {
8 %call = tail call double @copysign(double %a, double %b) #0
11 ; CHECK-LABEL: @foo_dd
12 ; CHECK: fcpsgn 1, 2, 1
14 ; CHECK-VSX-LABEL: @foo_dd
15 ; CHECK-VSX: xscpsgndp 1, 2, 1
19 declare double @copysign(double, double) #0
21 define float @foo_ss(float %a, float %b) #0 {
23 %call = tail call float @copysignf(float %a, float %b) #0
26 ; CHECK-LABEL: @foo_ss
27 ; CHECK: fcpsgn 1, 2, 1
29 ; CHECK-VSX-LABEL: @foo_ss
30 ; CHECK-VSX: fcpsgn 1, 2, 1
34 declare float @copysignf(float, float) #0
36 define float @foo_sd(float %a, double %b) #0 {
38 %conv = fptrunc double %b to float
39 %call = tail call float @copysignf(float %a, float %conv) #0
42 ; CHECK-LABEL: @foo_sd
43 ; CHECK: fcpsgn 1, 2, 1
45 ; CHECK-VSX-LABEL: @foo_sd
46 ; CHECK-VSX: fcpsgn 1, 2, 1
50 define double @foo_ds(double %a, float %b) #0 {
52 %conv = fpext float %b to double
53 %call = tail call double @copysign(double %a, double %conv) #0
56 ; CHECK-LABEL: @foo_ds
57 ; CHECK: fcpsgn 1, 2, 1
59 ; CHECK-VSX-LABEL: @foo_ds
60 ; CHECK-VSX: fcpsgn 1, 2, 1
64 attributes #0 = { nounwind readnone }