llvm.org GIT mirror llvm / 162da3c
Add fcopysign instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79664 91177308-0d34-0410-b5e6-96231b3b80d8 Anton Korobeynikov 10 years ago
2 changed file(s) with 29 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8585 "stdy\t{$src, $dst}",
8686 [(store FP64:$src, rriaddr:$dst)]>;
8787
88 def FCOPYSIGN32 : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2),
89 "cpsdr\t{$dst, $src2, $src1}",
90 [(set FP32:$dst, (fcopysign FP32:$src1, FP32:$src2))]>;
91 def FCOPYSIGN64 : Pseudo<(outs FP64:$dst), (ins FP64:$src1, FP64:$src2),
92 "cpsdr\t{$dst, $src2, $src1}",
93 [(set FP64:$dst, (fcopysign FP64:$src1, FP64:$src2))]>;
94
8895 //===----------------------------------------------------------------------===//
8996 // Arithmetic Instructions
9097
0 ; RUN: llvm-as < %s | llc | FileCheck %s
1
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:16:16-f128:128:128"
3 target triple = "s390x-ibm-linux-gnu"
4
5 define double @foo(double %a, double %b) nounwind {
6 entry:
7 ; CHECK: cpsdr %f0, %f2, %f0
8 %0 = tail call double @copysign(double %a, double %b) nounwind readnone
9 ret double %0
10 }
11
12 define float @bar(float %a, float %b) nounwind {
13 entry:
14 ; CHECK: cpsdr %f0, %f2, %f0
15 %0 = tail call float @copysignf(float %a, float %b) nounwind readnone
16 ret float %0
17 }
18
19
20 declare double @copysign(double, double) nounwind readnone
21 declare float @copysignf(float, float) nounwind readnone