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

How is generic SIMD support supposed to work?


Hi,
I didn't like the code we generate for _mm_set style of inlines, where
even when we load constant vector we first construct it on stack from
individual elements creating memory missmatch stall on load time.

I tried to use the SIMD support.  I suppose something like this should
work (and is accepted by parser):
#include <xmmintrin.h>
__v4si
t()
{
  __v4si val = {1,2,3,4};
    return val;
}
and I hope this to be compiled into static initializer loaded at once.
Unforutnately this does not happen, but even worse compiler dies:
athlon:~ # gcc -O2 t.c -msse2 -da
t.c: In function `t':
t.c:7: error: unable to find a register to spill in class `GENERAL_REGS'
t.c:7: error: this is the insn:
(insn:HI 10 9 11 0 0x403ad1e4 (set (subreg:SI (reg/v:V4SI 21 exmm0 [59]) 0)
    (const_int 1 [0x1])) 38 {*movsi_1} (insn_list 9 (nil))
    (nil))
t.c:7: confused by earlier errors, bailing out

Since compiler always generates for moves each setting different SImode
subreg of the vector.  There is no XMM alternative of such instruction
and I am not sure it is valid - how do we define
(set (subreg:SI (vector) 4) (value))
?
Is the other part of register killed, or do we use the rule that SImode
vectors are mixing?  Why we don't use the new vector operations for
this?

What would be preffered way to map this into XMM instructions? (I can
expand the code in emit_move_insn into the xmm sequence and hope that it
will get simplified later that won't happen currently, or perhaps we can
refine the API to be more flexible).

I would like to get the generic SIMD working on SSE in the next period.
Honza


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