aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-06-15 13:32:31 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-06-15 13:32:31 +0000
commit9d5b9daeb91118c0b3b9f8fbce2f074917d292bc (patch)
tree373d2c373f5f8302c62429a4f3bfecb9e2795db6 /gcc/testsuite
parent84fb20190544bfca4f25ec8e8abd51b763f94fb3 (diff)
downloadgcc-9d5b9daeb91118c0b3b9f8fbce2f074917d292bc.zip
gcc-9d5b9daeb91118c0b3b9f8fbce2f074917d292bc.tar.gz
gcc-9d5b9daeb91118c0b3b9f8fbce2f074917d292bc.tar.bz2
i386.md (expsf2, [...]): New patterns to implement exp, expf and expl built-ins as inline x87 intrinsics.
* config/i386/i386.md (expsf2, expdf2, expxf2): New patterns to implement exp, expf and expl built-ins as inline x87 intrinsics. (UNSPEC_FSCALE, UNSPEC_FRNDINT, UNSPEC_F2XM1): New unspecs to represent x87's fscale, frndint and f2xm1 insns respectively. (*fscale_sfxf3, *fscale_dfxf3, *fscale_xf3): New insn patterns to encode x87's "fscale" instruction followed by a pop. (*frndintxf2): New insn pattern for "frndint". (*f2xm1xf2): New insn pattern for "f2xm1". * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FRNDINT and UNSPEC_F2XM1 like UNSPEC_{SIN,COS} and handle UNSPEC_FSCALE like UNSPEC_FPATAN. * gcc.dg/builtins-22.c: New test case. * gcc.dg/i386-387-1.c: Update to test exp. * gcc.dg/i386-387-2.c: Likewise. From-SVN: r67973
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/builtins-22.c12
-rw-r--r--gcc/testsuite/gcc.dg/i386-387-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/i386-387-2.c2
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5c2b747..4371663 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-15 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/builtins-22.c: New test case.
+ * gcc.dg/i386-387-1.c: Update to test exp.
+ * gcc.dg/i386-387-2.c: Likewise.
+
2003-06-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/format/asm_fprintf-1.c: Update width/precision checks.
diff --git a/gcc/testsuite/gcc.dg/builtins-22.c b/gcc/testsuite/gcc.dg/builtins-22.c
new file mode 100644
index 0000000..916890b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtins-22.c
@@ -0,0 +1,12 @@
+/* Related to PR optimization/10764 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double exp(double x);
+
+double foo(double x)
+{
+ return exp(exp(x));
+}
+
diff --git a/gcc/testsuite/gcc.dg/i386-387-1.c b/gcc/testsuite/gcc.dg/i386-387-1.c
index 0738910..79d25e2 100644
--- a/gcc/testsuite/gcc.dg/i386-387-1.c
+++ b/gcc/testsuite/gcc.dg/i386-387-1.c
@@ -6,9 +6,11 @@
/* { dg-final { scan-assembler "call\t_?sqrt" } } */
/* { dg-final { scan-assembler "call\t_?atan2" } } */
/* { dg-final { scan-assembler "call\t_?log" } } */
+/* { dg-final { scan-assembler "call\t_?exp" } } */
double f1(double x) { return __builtin_sin(x); }
double f2(double x) { return __builtin_cos(x); }
double f3(double x) { return __builtin_sqrt(x); }
double f4(double x, double y) { return __builtin_atan2(x,y); }
double f5(double x) { return __builtin_log(x); }
+double f6(double x) { return __builtin_exp(x); }
diff --git a/gcc/testsuite/gcc.dg/i386-387-2.c b/gcc/testsuite/gcc.dg/i386-387-2.c
index 3bebc75..bfda85b 100644
--- a/gcc/testsuite/gcc.dg/i386-387-2.c
+++ b/gcc/testsuite/gcc.dg/i386-387-2.c
@@ -6,9 +6,11 @@
/* { dg-final { scan-assembler "fsqrt" } } */
/* { dg-final { scan-assembler "fpatan" } } */
/* { dg-final { scan-assembler "fyl2x" } } */
+/* { dg-final { scan-assembler "f2xm1" } } */
double f1(double x) { return __builtin_sin(x); }
double f2(double x) { return __builtin_cos(x); }
double f3(double x) { return __builtin_sqrt(x); }
double f4(double x, double y) { return __builtin_atan2(x,y); }
double f5(double x) { return __builtin_log(x); }
+double f6(double x) { return __builtin_exp(x); }