diff options
author | Uros Bizjak <uros@kss-loka.si> | 2004-05-06 07:19:24 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2004-05-06 07:19:24 +0200 |
commit | 5ae27cfaed756438a433459dcb6fd840c9e4112e (patch) | |
tree | 5689624daa1964552ad51ee6161ad703c40aa3ce /gcc/testsuite/gcc.dg/builtins-40.c | |
parent | cf9c6ca5e9cea1cf7ed6e36c3e4a4b89b6c89e85 (diff) | |
download | gcc-5ae27cfaed756438a433459dcb6fd840c9e4112e.zip gcc-5ae27cfaed756438a433459dcb6fd840c9e4112e.tar.gz gcc-5ae27cfaed756438a433459dcb6fd840c9e4112e.tar.bz2 |
optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem.
* optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem.
(fmod_optab): Define corresponding macros.
* optabs.c (init_optabs): Initialize fmod_optab and drem_optab.
* genopinit.c (optabs): Implement fmod_optab and drem_optab
using fmod?f3 and drem?f3 patterns.
* builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_FMOD{,F,L}
using fmod_optab and BUILT_IN_DREM{,F,L} using drem_optab.
(expand_builtin): Expand BUILT_IN_FMOD{,F,L} and
BUILT_IN_DREM{,F,L} using expand_builtin_mathfn_2 if
flag_unsafe_math_optimizations is set.
* reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FPREM_F,
UNSPEC_FPREM_U, UNSPEC_FPREM1_F and UNSPEC_FPREM1_U.
* config/i386/i386.c (ix86_emit_fp_unordered_jump): New function.
* config/i386/i386-protos.h (ix86_emit_fp_unordered_jump):
Prototype here.
* config/i386/i386.md (UNSPEC_FPREM_F, UNSPEC_FPREM_U,
UNSPEC_FPREM1_F, UNSPEC_FPREM1_U): New unspecs to represent x87's
fprem and fprem1 instructions.
(*x86_fnstsw_1): Change input parameter to (reg:CCFP 18).
Rename insn definition to x86_fnstsw_1.
(fpremxf4, fprem1xf4): New patterns to implement fprem and fprem1
x87 instructions.
(fmodsf3, fmoddf3, fmodxf3): New expanders to implement fmodf, fmod
and fmodl built-ins as inline x87 intrinsics.
(dremsf3, dremdf3, dremxf3): New expanders to implement dremf, drem
and dreml built-ins as inline x87 intrinsics.
* testsuite/gcc.dg/builtins-40.c: New test.
From-SVN: r81555
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtins-40.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtins-40.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtins-40.c b/gcc/testsuite/gcc.dg/builtins-40.c new file mode 100644 index 0000000..405c872 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtins-40.c @@ -0,0 +1,47 @@ +/* Copyright (C) 2004 Free Software Foundation. + + Check that fmod, fmodf, fmodl, drem, dremf and dreml + built-in functions compile. + + Written by Uros Bizjak, 5th May 2004. */ + +/* { dg-do compile } */ +/* { dg-options "-O2 -ffast-math" } */ + +extern double fmod(double, double); +extern double drem(double, double); +extern float fmodf(float, float); +extern float dremf(float, float); +extern long double fmodl(long double, long double); +extern long double dreml(long double, long double); + + +double test1(double x, double y) +{ + return fmod(x, y); +} + +double test2(double x, double y) +{ + return drem(x, y); +} + +float test1f(float x, float y) +{ + return fmodf(x, y); +} + +float test2f(float x, float y) +{ + return dremf(x, y); +} + +long double test1l(long double x, long double y) +{ + return fmodl(x, y); +} + +long double test2l(long double x, long double y) +{ + return dreml(x, y); +} |