File: fast-math-arithmetic.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (26 lines) | stat: -rw-r--r-- 1,898 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
! RUN: %flang_fc1 -emit-fir -ffp-contract=fast %s -o - 2>&1 | FileCheck --check-prefixes=CONTRACT,ALL %s
! RUN: %flang_fc1 -emit-fir -menable-no-infs -ffp-contract=off %s -o - 2>&1 | FileCheck --check-prefixes=NINF,ALL %s
! RUN: %flang_fc1 -emit-fir -menable-no-nans -ffp-contract=off %s -o - 2>&1 | FileCheck --check-prefixes=NNAN,ALL %s
! RUN: %flang_fc1 -emit-fir -fapprox-func -ffp-contract=off %s -o - 2>&1 | FileCheck --check-prefixes=AFN,ALL %s
! RUN: %flang_fc1 -emit-fir -fno-signed-zeros -ffp-contract=off %s -o - 2>&1 | FileCheck --check-prefixes=NSZ,ALL %s
! RUN: %flang_fc1 -emit-fir -mreassociate -ffp-contract=off %s -o - 2>&1 | FileCheck --check-prefixes=REASSOC,ALL %s
! RUN: %flang_fc1 -emit-fir -freciprocal-math -ffp-contract=off %s -o - 2>&1 | FileCheck --check-prefixes=ARCP,ALL %s
! RUN: %flang_fc1 -emit-fir -ffp-contract=fast -menable-no-infs -menable-no-nans -fapprox-func -fno-signed-zeros -mreassociate -freciprocal-math %s -o - 2>&1 | FileCheck --check-prefixes=FAST,ALL %s
! RUN: %flang_fc1 -emit-fir -ffast-math %s -o - 2>&1 | FileCheck --check-prefixes=FAST,ALL %s

! ALL-LABEL: func.func @_QPtest
subroutine test(x)
  real x
! CONTRACT: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:contract]]> : f32
! NINF: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:ninf]]> : f32
! NNAN: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:nnan]]> : f32
! AFN: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:afn]]> : f32
! NSZ: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:nsz]]> : f32
! REASSOC: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:reassoc]]> : f32
! ARCP: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:arcp]]> : f32
! FAST: arith.mulf{{.*}}, {{.*}} fastmath<[[ATTRS:fast]]> : f32
! ALL: arith.divf{{.*}}, {{.*}} fastmath<[[ATTRS]]> : f32
! ALL: arith.addf{{.*}}, {{.*}} fastmath<[[ATTRS]]> : f32
! ALL: arith.subf{{.*}}, {{.*}} fastmath<[[ATTRS]]> : f32
  x = x * x + x / x - x
end subroutine test