public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/30652]  New: SSE expansion is missing for isinf() and other fpclassify functions
@ 2007-01-31 12:39 ubizjak at gmail dot com
  2007-01-31 12:57 ` [Bug target/30652] " rguenth at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ubizjak at gmail dot com @ 2007-01-31 12:39 UTC (permalink / raw)
  To: gcc-bugs

Following testcase does not compile to inlined asm when -mfpmath=sse is used:

--cut here--
int test(double a)
{
        return isinf(a + 2.0);
}
--cut here--

gcc -O2 -msse3 -mfpmath=sse -fomit-frame-pointer:

test:
        movsd   .LC0, %xmm0
        addsd   4(%esp), %xmm0
        movsd   %xmm0, 4(%esp)
        jmp     isinf

An "isinf<mode>2" expander in config/i386/i386.md should be enhanced to expand
isinf() function to use SSE1/SSE2 FP bitops for -mfmpath=sse.


-- 
           Summary: SSE expansion is missing for isinf() and other
                    fpclassify functions
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ssemmx
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ubizjak at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
@ 2007-01-31 12:57 ` rguenth at gcc dot gnu dot org
  2007-02-01  0:28 ` rth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-31 12:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-01-31 12:57 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-01-31 12:57:28
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
  2007-01-31 12:57 ` [Bug target/30652] " rguenth at gcc dot gnu dot org
@ 2007-02-01  0:28 ` rth at gcc dot gnu dot org
  2007-02-01  8:16 ` ubizjak at gmail dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rth at gcc dot gnu dot org @ 2007-02-01  0:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rth at gcc dot gnu dot org  2007-02-01 00:28 -------
The generic implementation, including for SSE, is 

  isgreater (abs(f), FLT_MAX)

For isfinite, use islessequal instead.  For isnan, one can use 

  isunordered(f, f)

For isnormal, it'd be

  isgreaterequal(abs(f), FLT_MIN) & islessequal(abs(f), FLT_MAX)

which is less likely to be friendly to inline.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
  2007-01-31 12:57 ` [Bug target/30652] " rguenth at gcc dot gnu dot org
  2007-02-01  0:28 ` rth at gcc dot gnu dot org
@ 2007-02-01  8:16 ` ubizjak at gmail dot com
  2007-06-13 15:57 ` ghazi at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ubizjak at gmail dot com @ 2007-02-01  8:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ubizjak at gmail dot com  2007-02-01 08:16 -------
(In reply to comment #2)
> The generic implementation, including for SSE, is 

I don't think we want to be too generic there. We should not implement proposed
transformations as part of fold_builtin_classify() [builtins.c] as this would
penalize soft-float targets too much. In this case, we would trade one call to
isinf() to calls to __unorddf2 and__ledf2 plus fabs() bit-manipulation. For
isnan(), we trade the call to isnan to the call to __unorddf2.

IMO, we still need optabs here...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (2 preceding siblings ...)
  2007-02-01  8:16 ` ubizjak at gmail dot com
@ 2007-06-13 15:57 ` ghazi at gcc dot gnu dot org
  2007-06-16  3:44 ` ghazi at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-06-13 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ghazi at gcc dot gnu dot org  2007-06-13 15:57 -------
(In reply to comment #2)
> The generic implementation, including for SSE, is 
>   isgreater (abs(f), FLT_MAX)
> For isfinite, use islessequal instead.  For isnan, one can use 
>   isunordered(f, f)
> For isnormal, it'd be
>   isgreaterequal(abs(f), FLT_MIN) & islessequal(abs(f), FLT_MAX)
> which is less likely to be friendly to inline.

I'd like to do this, but how does one generate FLT_MAX et al. from the
middle-end?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (3 preceding siblings ...)
  2007-06-13 15:57 ` ghazi at gcc dot gnu dot org
@ 2007-06-16  3:44 ` ghazi at gcc dot gnu dot org
  2007-07-18 17:31 ` ghazi at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-06-16  3:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ghazi at gcc dot gnu dot org  2007-06-16 03:44 -------
(In reply to comment #2)
> The generic implementation, including for SSE, is 
>   isgreater (abs(f), FLT_MAX)
> For isfinite, use islessequal instead.  For isnan, one can use 
>   isunordered(f, f)
> For isnormal, it'd be
>   isgreaterequal(abs(f), FLT_MIN) & islessequal(abs(f), FLT_MAX)
> which is less likely to be friendly to inline.

Generic isinf implementation here:
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01103.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (4 preceding siblings ...)
  2007-06-16  3:44 ` ghazi at gcc dot gnu dot org
@ 2007-07-18 17:31 ` ghazi at gcc dot gnu dot org
  2007-07-18 17:42 ` ghazi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-07-18 17:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ghazi at gcc dot gnu dot org  2007-07-18 17:30 -------
Subject: Bug 30652

Author: ghazi
Date: Wed Jul 18 17:30:38 2007
New Revision: 126724

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126724
Log:
        PR target/30652
        PR middle-end/20558

        * builtins.c (expand_builtin_interclass_mathfn): Provide a
        generic fallback for isinf.
        * c-cppbuiltin.c (builtin_define_float_constants): Move FP max
        calculation code ...
        * real.c (get_max_float): ... to here.
        * real.h (get_max_float): New.

testsuite:
        * gcc.dg/pr28796-1.c: Add more cases.
        * gcc.dg/pr28796-2.c: Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/c-cppbuiltin.c
    trunk/gcc/real.c
    trunk/gcc/real.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/pr28796-1.c
    trunk/gcc/testsuite/gcc.dg/pr28796-2.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (5 preceding siblings ...)
  2007-07-18 17:31 ` ghazi at gcc dot gnu dot org
@ 2007-07-18 17:42 ` ghazi at gcc dot gnu dot org
  2007-07-18 17:51 ` ghazi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-07-18 17:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ghazi at gcc dot gnu dot org  2007-07-18 17:42 -------
Subject: Bug 30652

Author: ghazi
Date: Wed Jul 18 17:42:12 2007
New Revision: 126725

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126725
Log:
        PR target/30652

        * builtins.c (expand_builtin_interclass_mathfn): Allow for missing
        optabs infrastructure.  Provide generic implementation for
        FINITE/ISFINITE.
        (expand_builtin): Handle FINITE/ISFINITE.
        (fold_builtin_classify): Make ISFINITE canonical instead of FINITE.
        (fold_builtin_1): Likewise.

        * builtins.def (BUILT_IN_ISFINITE): New.

        * doc/extend.texi: Document isfinite.

testsuite:
        * gcc.dg/pr28796-1.c: Add more cases.
        * gcc.dg/pr28796-2.c: Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/builtins.def
    trunk/gcc/doc/extend.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/pr28796-1.c
    trunk/gcc/testsuite/gcc.dg/pr28796-2.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (6 preceding siblings ...)
  2007-07-18 17:42 ` ghazi at gcc dot gnu dot org
@ 2007-07-18 17:51 ` ghazi at gcc dot gnu dot org
  2007-07-18 18:01 ` ghazi at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-07-18 17:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ghazi at gcc dot gnu dot org  2007-07-18 17:51 -------
Subject: Bug 30652

Author: ghazi
Date: Wed Jul 18 17:51:13 2007
New Revision: 126726

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126726
Log:
        PR target/30652

        * builtins.c (expand_builtin_interclass_mathfn): Provide a generic
        transformation for builtin ISNORMAL.
        (expand_builtin): Handle BUILT_IN_ISNORMAL.
        * builtins.def (BUILT_IN_ISNORMAL): New.
        * doc/extend.texi: Document isnormal.

testsuite:
        * gcc.dg/pr28796-2.c: Add more cases.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/builtins.def
    trunk/gcc/doc/extend.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/pr28796-2.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (7 preceding siblings ...)
  2007-07-18 17:51 ` ghazi at gcc dot gnu dot org
@ 2007-07-18 18:01 ` ghazi at gcc dot gnu dot org
  2008-03-14 16:46 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-07-18 18:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ghazi at gcc dot gnu dot org  2007-07-18 18:00 -------
Generic implementations for isinf, isfinite and isnormal installed on trunk.

Still possibly want optabs where it is profitable.

Also, isnan doesn't allow for optabs at the moment.  Should convert it into
this system.


-- 

ghazi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (8 preceding siblings ...)
  2007-07-18 18:01 ` ghazi at gcc dot gnu dot org
@ 2008-03-14 16:46 ` rguenth at gcc dot gnu dot org
  2008-06-07  4:03 ` ghazi at gcc dot gnu dot org
  2009-11-22 17:58 ` ghazi at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-14 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2008-03-14 16:45 -------
Only partly fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.0                       |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (9 preceding siblings ...)
  2008-03-14 16:46 ` rguenth at gcc dot gnu dot org
@ 2008-06-07  4:03 ` ghazi at gcc dot gnu dot org
  2009-11-22 17:58 ` ghazi at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2008-06-07  4:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ghazi at gcc dot gnu dot org  2008-06-07 04:02 -------
What remains to be done for this PR?

The generic FP classification implementations are all done, including builtin
fpclassify().  Perhaps some optabs still need to be finished?  Or can we close
this one?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/30652] SSE expansion is missing for isinf() and other fpclassify functions
  2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
                   ` (10 preceding siblings ...)
  2008-06-07  4:03 ` ghazi at gcc dot gnu dot org
@ 2009-11-22 17:58 ` ghazi at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2009-11-22 17:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from ghazi at gcc dot gnu dot org  2009-11-22 17:58 -------
What remains to be done here?


-- 

ghazi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30652


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-11-22 17:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-31 12:39 [Bug target/30652] New: SSE expansion is missing for isinf() and other fpclassify functions ubizjak at gmail dot com
2007-01-31 12:57 ` [Bug target/30652] " rguenth at gcc dot gnu dot org
2007-02-01  0:28 ` rth at gcc dot gnu dot org
2007-02-01  8:16 ` ubizjak at gmail dot com
2007-06-13 15:57 ` ghazi at gcc dot gnu dot org
2007-06-16  3:44 ` ghazi at gcc dot gnu dot org
2007-07-18 17:31 ` ghazi at gcc dot gnu dot org
2007-07-18 17:42 ` ghazi at gcc dot gnu dot org
2007-07-18 17:51 ` ghazi at gcc dot gnu dot org
2007-07-18 18:01 ` ghazi at gcc dot gnu dot org
2008-03-14 16:46 ` rguenth at gcc dot gnu dot org
2008-06-07  4:03 ` ghazi at gcc dot gnu dot org
2009-11-22 17:58 ` ghazi at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).