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]

Re: x86/MMX/SSE shift by immediate



On Dec 18, 2003, at 2:25 PM, Richard Henderson wrote:


On Fri, Dec 12, 2003 at 04:41:43PM -0800, Stuart Hastings wrote:
This looks like a typo that crept into several similar vector
instruction patterns.  Currently, MMX/SSE shifts by an immediate value
ICE.

Patch is ok.


Test cases need to either be compile-only or have a runtime test
for no sse available.  There's code for the later in the testsuite
already -- see gcc.dg/20020523-2.c.


r~

One question: would you prefer I cut&paste the CPU detection code from
20020523-2.c, or would you like to see it factored into a shared header
file ? Suggestions, please.

A header file would be nice; dunno how that interacts with the rest of dejagnu, however.


r~

I'm back from the holidays, and here is the same patch with a revised testcase. CVS updated this morning, bootstrapped, DejaGnu, all on Darwin/x86.


I've stolen the clever CPUID code from the existing 20020523-2.c testcase, moved it into a header file named i386-cpuid.h, and revised 20020523-2.c and my previous i386-sse-5.c to ask, at runtime, what features (MMX/SSE/SSE2) are provided by the current host. Both testcases now adjust themselves accordingly.

I've tested this on Darwin/x86 with DejaGnu; both testcases compile and run correctly with my patch. My new testcase ICEs the current TOT compiler at -O2.

I've also compiled both testcases by hand on my home P3 Debian Linux box (no SSE2); they will compile with "-msse2 -O0" and run correctly (the new testcase ICEs here at -O2 as well). I think this shows the runtime CPU detection stuff is working; a better test would be run on a genuine 80386 (no MMX).

This patch does not contain a necessary trivial change to config/i386/darwin.h that makes the Darwin assembler more cooperative; coming soon.

O.K. to commit ?

stuart hastings
Apple Computer

Attachment: gcc.fsf.diffs.txt
Description: Text document

Attachment: i386-sse-5.c
Description: Text document

Attachment: i386-cpuid.h
Description: Text document



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