Compilation problem of sse4-64.c (note : this is not very recent, I have seen this at least some weeks ago but forgot to report it). gcc version 4.3.2 (Debian 4.3.2-1.1) GNU assembler (GNU Binutils for Debian) 2.18.0.20080103 It also happens on a red-hat 5.2 (gcc 4.1.2, as 2.17.50.0.6-9.el5 20061020) gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../include -I../../../coregrind -I../../../include -I../../../VEX/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT sse4-64.o -MD -MP -MF .deps/sse4-64.Tpo -c -o sse4-64.o sse4-64.c sse4-64.c: Assembler messages: sse4-64.c:3582: Error: suffix or operands invalid for `pblendvb' sse4-64.c:3593: Error: suffix or operands invalid for `pblendvb' sse4-64.c:3649: Error: suffix or operands invalid for `blendvpd' sse4-64.c:3660: Error: suffix or operands invalid for `blendvpd' sse4-64.c:3716: Error: suffix or operands invalid for `blendvps' sse4-64.c:3727: Error: suffix or operands invalid for `blendvps' make[5]: *** [sse4-64.o] Error 1
Hmm, isn't there a check in configure.in for whether the assembler can handle these instructions? If not, there should be.
(In reply to comment #1) > Hmm, isn't there a check in configure.in for whether the assembler > can handle these instructions? If not, there should be. I have a close to zero knowledge of all this but from what I understood: sse4-64 is conditionalized in Makefile.am by BUILD_SSE42_TESTS, which is true if the below compiles: __asm__ __volatile__( "crc32q %%r15,%%r15" : : : "r15" ); It looks like the assembler understands the sse4.2 (checked with the above) but still the assembler cannot assemble all sse4.2 instructions. Adding more instructions in the above test might be sufficient. If this is the correct approach, I can work on a patch, and validate it on a "working" and "non-working" amd64 distribution.
> If this is the correct approach, I can work on a patch, and validate it > on a "working" and "non-working" amd64 distribution. Hmm, looking at this more closely .. > sse4-64.c:3593: Error: suffix or operands invalid for `pblendvb' It doesn't say "I don't know what a plendvb instruction is". It sounds more as if it has a problem with the operands or suffix (whatever that means). Can you figure out what exact instruction (+ operands) it is complaining about? Maybe we can guess what the problem is once we know that.
(In reply to comment #3) > > If this is the correct approach, I can work on a patch, and validate it > > on a "working" and "non-working" amd64 distribution. > > Hmm, looking at this more closely .. > > > sse4-64.c:3593: Error: suffix or operands invalid for `pblendvb' > > It doesn't say "I don't know what a plendvb instruction is". It sounds > more as if it has a problem with the operands or suffix (whatever that means). > > Can you figure out what exact instruction (+ operands) it is > complaining about? Maybe we can guess what the problem is once > we know that. gcc -c -m64 sse4-64.c /tmp/ccL6nisD.s: Assembler messages: /tmp/ccL6nisD.s:100068: Error: suffix or operands invalid for `pblendvb' /tmp/ccL6nisD.s:100081: Error: suffix or operands invalid for `pblendvb' /tmp/ccL6nisD.s:100231: Error: suffix or operands invalid for `blendvpd' /tmp/ccL6nisD.s:100244: Error: suffix or operands invalid for `blendvpd' /tmp/ccL6nisD.s:100392: Error: suffix or operands invalid for `blendvps' /tmp/ccL6nisD.s:100405: Error: suffix or operands invalid for `blendvps' grepping for the insns shows: pblendvb (%rcx), %xmm11 pblendvb %xmm2, %xmm11 blendvpd (%rcx), %xmm11 blendvpd %xmm2, %xmm11 blendvps (%rcx), %xmm11 blendvps %xmm2, %xmm11 Does that look correct? gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42) GNU assembler 2.17.50.0.6-6.el5 20061020
(In reply to comment #4) > (In reply to comment #3) > grepping for the insns shows: > > pblendvb (%rcx), %xmm11 > pblendvb %xmm2, %xmm11 > blendvpd (%rcx), %xmm11 > blendvpd %xmm2, %xmm11 > blendvps (%rcx), %xmm11 > blendvps %xmm2, %xmm11 > > Does that look correct? > > gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42) > GNU assembler 2.17.50.0.6-6.el5 20061020 Some months ago, I spend some (little) time to find the syntax of pblendvb and similar but could not find an authoritative answer. As it compiles on some distributions and not on others, I suppose we are encountering a bug in some old versions of gcc and/or gas. Philippe
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > grepping for the insns shows: > > > > pblendvb (%rcx), %xmm11 > > pblendvb %xmm2, %xmm11 > > blendvpd (%rcx), %xmm11 > > blendvpd %xmm2, %xmm11 > > blendvps (%rcx), %xmm11 > > blendvps %xmm2, %xmm11 > > > > Does that look correct? > > > > gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42) > > GNU assembler 2.17.50.0.6-6.el5 20061020 > > Some months ago, I spend some (little) time to find the syntax of pblendvb and > similar > but could not find an authoritative answer. > As it compiles on some distributions and not on others, I suppose we are > encountering > a bug in some old versions of gcc and/or gas. > Yes, must be. This patch can be used to distinguish: Index: configure.in =================================================================== --- configure.in (revision 12325) +++ configure.in (working copy) @@ -1551,7 +1551,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ do { long long int x; __asm__ __volatile__( - "crc32q %%r15,%%r15" : : : "r15" ); } + "crc32q %%r15,%%r15" : : : "r15" ); + __asm__ __volatile__( + "pblendvb (%rcx), %xmm11"); } while (0) ]])], [ ac_have_as_sse42=yes Without the patch, we would try to compile sse4-64.c on a system with gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42) GNU assembler 2.17.50.0.6-6.el5 20061020 which will fail with the error as shown in comment #4. With the patch SSE4.2 is detected as not supported by gcc/as. I've also tested the patch on a box with these tools gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 GNU assembler (GNU Binutils for Ubuntu) 2.21.0.20110327 which compile sse4-64.c. With and without the patch SSE4.2 is detected as "supported". Anybody has objections to applying the patch?
(In reply to comment #6) > Anybody has objections to applying the patch? Without your patch, regtest fail to compile on debian5. With your patch, it is ok. So, looks ok to me. Thanks
(In reply to comment #7) > (In reply to comment #6) > > Anybody has objections to applying the patch? > Without your patch, regtest fail to compile on debian5. > With your patch, it is ok. > > So, looks ok to me. > Thanks for testing. Patch applied in r12340.