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

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


Hello!

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
gcc.target/i386/sse-13.c 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
../../gcc-svn/trunk/gcc/recog.c:1357
/home/uros/gcc-svn/trunk/gcc/recog.c:1357:37932:beg:0x8299238
(gdb)

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

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

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

       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.

testsuite/ChangeLog:

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

       PR target/32065
       * gcc.target/i386/pr32065.c: New test.

[1] http://gcc.gnu.org/ml/gcc-testresults/2007-05/msg01171.html

Uros.

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]