public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/29845]  New: sh floating point emulation is inefficient
@ 2006-11-15 17:57 amylaar at gcc dot gnu dot org
  2006-11-15 18:03 ` [Bug target/29845] " amylaar at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-11-15 17:57 UTC (permalink / raw)
  To: gcc-bugs

shortcomings of fp-bit.c (excessive packing, poor choice of algorithms),
poor handling of bitfield accesses by gcc, and problems with register
allocation /
scheduling each cost about a factor of two in performance in the floating point
emulation currently used for the SH port.

Using a hand-coded assembly language implementation can avoid these problems.


-- 
           Summary: sh floating point emulation is inefficient
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amylaar at gcc dot gnu dot org
GCC target triplet: sh-*
 BugsThisDependsOn: 28618
OtherBugsDependingO 29842
             nThis:


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


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

* [Bug target/29845] sh floating point emulation is inefficient
  2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
@ 2006-11-15 18:03 ` amylaar at gcc dot gnu dot org
  2006-11-29 18:52 ` amylaar at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-11-15 18:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from amylaar at gcc dot gnu dot org  2006-11-15 18:02 -------
Created an attachment (id=12624)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12624&action=view)
patch

This patch has been regression tested on i686-pc-linux-gnu X sh-elf.
However, I need approval for the non-SH parts before I can commit it.


-- 


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


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

* [Bug target/29845] sh floating point emulation is inefficient
  2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
  2006-11-15 18:03 ` [Bug target/29845] " amylaar at gcc dot gnu dot org
@ 2006-11-29 18:52 ` amylaar at gcc dot gnu dot org
  2006-11-29 19:03 ` amylaar at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-11-29 18:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from amylaar at gcc dot gnu dot org  2006-11-29 18:52 -------
Created an attachment (id=12708)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12708&action=view)
ChangeLog entries for softfp-diff-20061110

These are the ChangeLog entries for the SH specific code.

The ChangeLog entries for the target-independent code are included in the
patches for the blocking PRs (28618, 29846 and 29847) .


-- 


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


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

* [Bug target/29845] sh floating point emulation is inefficient
  2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
  2006-11-15 18:03 ` [Bug target/29845] " amylaar at gcc dot gnu dot org
  2006-11-29 18:52 ` amylaar at gcc dot gnu dot org
@ 2006-11-29 19:03 ` amylaar at gcc dot gnu dot org
  2007-01-31 13:47 ` christian dot bruel at st dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-11-29 19:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from amylaar at gcc dot gnu dot org  2006-11-29 19:03 -------
Created an attachment (id=12709)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12709&action=view)
ChangeLog entries for softfp-diff-20061110

The previous version was missing the enumeration of two new files.


-- 

amylaar at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #12708|0                           |1
        is obsolete|                            |


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


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

* [Bug target/29845] sh floating point emulation is inefficient
  2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-11-29 19:03 ` amylaar at gcc dot gnu dot org
@ 2007-01-31 13:47 ` christian dot bruel at st dot com
  2007-01-31 13:50 ` christian dot bruel at st dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: christian dot bruel at st dot com @ 2007-01-31 13:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from christian dot bruel at st dot com  2007-01-31 13:47 -------
Hereattached a patch to fix a few problems:

1) Rounding to nearest must be infinity if the "infinitely precise result has a
magniture at least 2 exp Emax (2-2exp-p)" (ansi 754/1985 sect 4.1). The
implementation for addsf3 and adddf3 returned a NaN.
2) Infinity in divsf3.S was not set (case of 1.0/0.0).

2007-01-29  Christian Bruel  <christian.bruel@st.com>

        * config/sh/IEEE-754/m3/adddf3.S: Fix inf mantissa.
        * config/sh/IEEE-754/m3/addsf3.S: Likewise.
        * config/sh/IEEE-754/m3/divsf3.S: Intialize xff000000 label.


-- 


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


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

* [Bug target/29845] sh floating point emulation is inefficient
  2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-01-31 13:47 ` christian dot bruel at st dot com
@ 2007-01-31 13:50 ` christian dot bruel at st dot com
  2007-01-31 13:57 ` christian dot bruel at st dot com
  2007-02-01  3:42 ` amylaar at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: christian dot bruel at st dot com @ 2007-01-31 13:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from christian dot bruel at st dot com  2007-01-31 13:50 -------
Created an attachment (id=12986)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12986&action=view)
fixes the nearest to infinity and divide by 0 bugs.


-- 


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


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

* [Bug target/29845] sh floating point emulation is inefficient
  2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-01-31 13:50 ` christian dot bruel at st dot com
@ 2007-01-31 13:57 ` christian dot bruel at st dot com
  2007-02-01  3:42 ` amylaar at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: christian dot bruel at st dot com @ 2007-01-31 13:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from christian dot bruel at st dot com  2007-01-31 13:56 -------
(From update of attachment 12986)
(note: this diff was made from the wrong direction. (-) shows the newest
version. sorry


-- 


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


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

* [Bug target/29845] sh floating point emulation is inefficient
  2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-01-31 13:57 ` christian dot bruel at st dot com
@ 2007-02-01  3:42 ` amylaar at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2007-02-01  3:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from amylaar at gcc dot gnu dot org  2007-02-01 03:41 -------
(In reply to comment #4)
> Hereattached a patch to fix a few problems:
> 
> 1) Rounding to nearest must be infinity if the "infinitely precise result has a
> magniture at least 2 exp Emax (2-2exp-p)" (ansi 754/1985 sect 4.1). The
> implementation for addsf3 and adddf3 returned a NaN.

Not always a NaN, but it's a bug regardless.  Good catch.
However, this:

 LOCAL(inf):
+       mov     #0,DBLRL

negatively impacts sh3 MA unit scheduling.

It might be an idea to align LOCAL(pos_difference_0) for sh3.


-       tst     r7,r0
+       tst     r7,r0           

You have to be careful with the whitespace.

> 2) Infinity in divsf3.S was not set (case of 1.0/0.0).

>         * config/sh/IEEE-754/m3/divsf3.S: Intialize xff000000 label.
> 
This was supposed to be:

LOCAL(m1):      .word -1
        .balign 4
LOCAL(xff000000):
#ifdef __LITTLE_ENDIAN__
 .word 0
LOCAL(xff00):   .word 0xff00
#else
LOCAL(xff00):   .word 0xff00
 .word 0
#endif

saving four bytes over using unshared constants.


-- 


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


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

end of thread, other threads:[~2007-02-01  3:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-15 17:57 [Bug target/29845] New: sh floating point emulation is inefficient amylaar at gcc dot gnu dot org
2006-11-15 18:03 ` [Bug target/29845] " amylaar at gcc dot gnu dot org
2006-11-29 18:52 ` amylaar at gcc dot gnu dot org
2006-11-29 19:03 ` amylaar at gcc dot gnu dot org
2007-01-31 13:47 ` christian dot bruel at st dot com
2007-01-31 13:50 ` christian dot bruel at st dot com
2007-01-31 13:57 ` christian dot bruel at st dot com
2007-02-01  3:42 ` amylaar 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).