Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/extract_recip_3.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* { dg-do compile } */ | |
2 /* { dg-options "-Ofast -fdump-tree-optimized-raw" } */ | |
3 | |
4 float | |
5 extract_square (float *a, float *b, float x, float y) | |
6 { | |
7 *a = 3 / (y * y); | |
8 *b = 5 / (y * y); | |
9 | |
10 return x / (y * y); | |
11 } | |
12 | |
13 /* Don't expect the 'powmult' (calculation of y * y) | |
14 to be deleted until a later pass, so look for one | |
15 more multiplication than strictly necessary. */ | |
16 float | |
17 extract_recip (float *a, float *b, float x, float y, float z) | |
18 { | |
19 *a = 7 / y; | |
20 *b = x / (y * y); | |
21 | |
22 return z / y; | |
23 } | |
24 | |
25 /* 4 multiplications in 'extract_square', and 4 in 'extract_recip'. */ | |
26 /* { dg-final { scan-tree-dump-times "mult_expr" 8 "optimized" } } */ | |
27 | |
28 /* 1 division in 'extract_square', 1 division in 'extract_recip'. */ | |
29 /* { dg-final { scan-tree-dump-times "rdiv_expr" 2 "optimized" } } */ |