[PATCH, x86_64]: Support exceptions and rounding modes for TFmode soft-fp

Uros Bizjak ubizjak@gmail.com
Thu May 17 20:47:00 GMT 2007


Hello!

Attached patch adds support for exceptions and rounding modes for x86_64 
TFmode soft-fp. The patch takes from glibc's fegetround() and 
feraiseexcept() functions.

I have checked some basic functionality, and it works for all cases I 
have thrown in. If somebody has more thorough FP testsuite, I would be 
very glad to look at results...

The patch itself was bootstrapped and regression tested on x86_64, 
together with my previous longlong.h patch that provides definitions for 
128bit operations.

BTW: In negsf2.c, negdf2.c and negtf2.c, there is a bit of (harmless) 
redundant code:

  ...
  FP_UNPACK_D(A, a);
  FP_NEG_D(R, A);
  FP_PACK_D(r, R);
  FP_CLEAR_EXCEPTIONS;
  FP_HANDLE_EXCEPTIONS;           <<<<-- here
  ...

We probably don't need to handle cleared exceptions...

2007-05-17  Uros Bizjak  <ubizjak@gmail.com>

        * config/i386/sfp-machine.h (FP_EX_INVALID, FP_EX_DENORM,
        FP_EXP_DIVZERO, FP_EX_OVERFLOW, FP_EX_UNDERFLOW, FP_EX_INEXACT):
        New constants.
        (struct fenv): New structure.
        (FP_HANDLE_EXCEPTIONS): New define.
        (FP_RND_NEAREST, FP_RND_ZERO, FP_RND_PINF, FP_RND_MINF): New 
constants.
        (_FP_DECL_EXP): New define.
        (FP_INIT_ROUNDMODE): New define.
        (FP_ROUNDMODE): New define.

Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x86_64-except.diff
Type: text/x-patch
Size: 2566 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070517/c272aab1/attachment.bin>


More information about the Gcc-patches mailing list