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

Re: Can a 32 bit GCC running on a 64 bit Intel be made to emit SSE SIMD instructions automatically?


On Sat, May 19, 2012 at 11:57 PM, Tim Prince <n8tm@aol.com> wrote:

>> So, is there any way to make a 32 bit GCC emit mulpd and
>> the like automatically (and correctly), without explicitly
>> calling built-ins, like there is when everything is 64 bits?
>> (Maybe: Does the vectorizer, if applicable, recognize that
>> it may assume presence of suitable hardware and act
>> accordingly?)
>>
>> VECTOR f(double a, double b, double c, double d)
>> {
>> ? return (VECTOR) { a OP c, b OP d };
>> }
>>
>> (VECTOR is an array of two 64 bit FPT components,
>> in all GCC languages I have tried. It works nicely, as said,
>> with 64 bit compilers.)

> Did you consider a suitable -march setting?

I tried dropping -march, and using -march=native, and -march=core2
on this machine. -march=corei7 on another. Irrespective of the switches,
there will be working executables. But they have two xxxsd instructions,
which is unlike the single xxxpd the 64 bit compiler produces
in the 64 bit OS/GCC environment. The programs run on the same
physical processor. So the translated program does use SSE registers,
but the code does not exercise the 128 bit pairs of doubles, only the
64 bit doubles. This creates a huge difference in speed (up to x2).
Hence my question: Does a 32 bit GCC, unlike a 64 bit GCC,
require explicitly calling intrinsics in the source program when
the physical CPU is 64 bit? Or is there a way to cater to the
vectorization circuits of a 32 bit GCC so that is will emit xxxpd?

(The GCCs in the 32 bit software environments given won't accept -m64.)

Georg

Georg


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