This is the mail archive of the 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]

[PATCH, i386]: Fix PR target/32065: Many dfp testsuite failures for -msse targets


Attached patch fixes ~50 dfp failures [1] when -msse is used. There
were actually two errors:

1) Compile time error:

For some reason,

(subreg:TI (const_double:TD 0 [0x0] 2.0 [N/A]) 0)) -1 (nil)

is not simplified to (const_double:TI ...). On 32bit hosts with 32bit
HWI (on 64 bit host, it is OK). The problem is, that CONSTANT_P does
not trigger on subreg, immediate is not pushed to memory and invalid
RTL is produced.

2) Runtime error

Since DFP operates through integer moves, it finds (valid) TImode for
move of _Decimal128 value when -msse is in effect. Unforunatelly, when
TImode value is pushed to stack due to _Decimal128 argument passing
convention, this move can result in unaligned move to the stack.

Since middle-end wants TImode so desperatelly, we can still implement
128bit moves via XMM registers. However, when unaligned access is
detected, x86_expand_vector_move_misalign() function is called which
takes care of unaligned memory operands. This approach fixes ALL DFP
failures from the testsuite for -msse.

Patch was bootstrapped and regression tested on i686-pc-linux-gnu.

There is one (unrelated?) problem in the testsuite. Compiling results in something which looks like garbage
collector problem:

_mm_cvtpd_pi32 _mm_cvtpd_epi32 _mm_cvtepi32_ps _mm_cvtepi32_pd
_mm_movepi64_pi64 _mm_move_epi64
Program received signal SIGSEGV, Segmentation fault.
memory_operand (op=0xabababab, mode=VOIDmode) at

op=0xabababab seems a little strange to me...

Otherwise, _mm_move_epi64() can be compiled without problems...

2007-05-24 Uros Bizjak <>

       PR target/32065
       * target/i386/i386.c (ix86_expand_vector_move): Force SUBREGs of
       constants into memory.  Expand unaligned memory references for
       SSE modes via x86_expand_vector_move_misalign() function.


2007-05-24 Uros Bizjak <>

       PR target/32065
       * New test.



Attachment: pr32065.diff
Description: Binary data

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