This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

middle-end/9009: floating-point negate and abs optimizations incorrect for ARM


>Number:         9009
>Category:       middle-end
>Synopsis:       floating-point negate and abs optimizations incorrect for ARM
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 19 09:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Richard Earnshaw
>Release:        unknown-1.0
>Organization:
>Environment:
arm-elf cross
>Description:
Testsuite gcc.c-torture/exectue/930614-1.c fails after this patch:

2002-12-07  Roger Sayle  <roger@eyesopen.com>

        * real.h (real_format): Add signbit field.
        * real.c (ieee_single_format, ieee_double_format,
        ieee_extended_motorola_format, ieee_extended_intel_96_format,
        ieee_extended_intel_128_format, ibm_extended_format,
        ieee_quad_format, vax_f_format, vax_d_format,
        vax_g_format, i370_single_format, i370_double_format,
        c4x_single_format, c4x_extended_format, real_internal_format):
        Provide suitable signbit value, or -1 to avoid bit twiddling.

        * optabs.c (expand_unop): Try implementing negation of
        floating point modes by flipping the sign bit.
        (expand_abs): Try implementing abs of floating point modes
        by clearing the sign bit.

>How-To-Repeat:
Run the testsuite
>Fix:
The reason for the failure is that on an ARM little-endian system the floating-point sign bit is in the lowest addressed word (that is, the sign bit is at position 31 (not 63) when the floating point value is considered as a 'long long' (ARM FPA double format is motorola word order, even when the system is little-endian).

The code needs to take this into account (FLOAT_WORDS_BIG_ENDIAN != WORDS_BIG_ENDIAN) => the hi and lo fields should be swapped over.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]