OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [builtins-9.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Copyright (C) 2003 Free Software Foundation.
2
 
3
   Check that constant folding of built-in math functions doesn't
4
   break anything.
5
 
6
   Written by Roger Sayle, 2nd April 2003.  */
7
 
8
/* { dg-do compile } */
9
/* { dg-options "-O2 -ffast-math" } */
10
 
11
extern double log(double);
12
extern double exp(double);
13
extern double sqrt(double);
14
extern double pow(double,double);
15
 
16
extern float logf(float);
17
extern float expf(float);
18
extern float sqrtf(float);
19
extern float powf(float,float);
20
 
21
extern long double logl(long double);
22
extern long double expl(long double);
23
extern long double sqrtl(long double);
24
extern long double powl(long double,long double);
25
 
26
 
27
double test1(double x, double y)
28
{
29
  return log(pow(x,y));
30
}
31
 
32
double test2(double x, double y)
33
{
34
  return sqrt(pow(x,y));
35
}
36
 
37
double test3(double x, double y)
38
{
39
  return pow(exp(x),y);
40
}
41
 
42
double test4(double x, double y)
43
{
44
  return pow(sqrt(x),y);
45
}
46
 
47
double test5(double x, double y, double z)
48
{
49
  return pow(pow(x,y),z);
50
}
51
 
52
 
53
float test1f(float x, float y)
54
{
55
  return logf(powf(x,y));
56
}
57
 
58
float test2f(float x, float y)
59
{
60
  return sqrtf(powf(x,y));
61
}
62
 
63
float test3f(float x, float y)
64
{
65
  return powf(expf(x),y);
66
}
67
 
68
float test4f(float x, float y)
69
{
70
  return powf(sqrtf(x),y);
71
}
72
 
73
float test5f(float x, float y, float z)
74
{
75
  return powf(powf(x,y),z);
76
}
77
 
78
 
79
long double test1l(long double x, long double y)
80
{
81
  return logl(powl(x,y));
82
}
83
 
84
long double test2l(long double x, long double y)
85
{
86
  return sqrtl(powl(x,y));
87
}
88
 
89
long double test3l(long double x, long double y)
90
{
91
  return powl(expl(x),y);
92
}
93
 
94
long double test4l(long double x, long double y)
95
{
96
  return powl(sqrtl(x),y);
97
}
98
 
99
long double test5l(long double x, long double y, long double z)
100
{
101
  return powl(powl(x,y),z);
102
}
103
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.