• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -verify-machineinstrs < %s -mattr=-vsx -mtriple=powerpc-apple-darwin | FileCheck %s
2
3define double @fabs(double %f) {
4; CHECK-LABEL: fabs:
5; CHECK:       ; %bb.0:
6; CHECK-NEXT:    fabs f1, f1
7; CHECK-NEXT:    blr
8;
9  %t = tail call double @fabs( double %f ) readnone
10  ret double %t
11}
12
13define float @bitcast_fabs(float %x) {
14; CHECK-LABEL: bitcast_fabs:
15; CHECK:       ; %bb.0:
16; CHECK-NEXT:    stfs f1, -8(r1)
17; CHECK:         lwz r2, -8(r1)
18; CHECK-NEXT:    clrlwi r2, r2, 1
19; CHECK-NEXT:    stw r2, -4(r1)
20; CHECK-NEXT:    lfs f1, -4(r1)
21; CHECK-NEXT:    blr
22;
23  %bc1 = bitcast float %x to i32
24  %and = and i32 %bc1, 2147483647
25  %bc2 = bitcast i32 %and to float
26  ret float %bc2
27}
28
29