Bug 42165 - -masm=intel doesn't know how to print AVX instructions
Summary: -masm=intel doesn't know how to print AVX instructions
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.2
: P3 minor
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-24 17:36 UTC by Matti Niemenmaa
Modified: 2009-11-25 22:54 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target:
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2009-11-24 18:04:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matti Niemenmaa 2009-11-24 17:36:59 UTC
Using -masm=intel and -mavx together with something that uses a 256-bit vector causes an internal error:

$ gcc arst.c -mavx -masm=intel
arst.c: In function ‘foo’:
arst.c:2: internal compiler error: in print_operand, at config/i386/i386.c:11324

$ cat arst.c
typedef unsigned long vec __attribute__((vector_size(32)));
void foo(vec a) {}

$ gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.4.2 (GCC)
Comment 1 Jakub Jelinek 2009-11-24 18:04:38 UTC
--- gcc/config/i386/i386.c        2009-11-24 09:59:29.000000000 +0100
+++ gcc/config/i386/i386.c        2009-11-24 19:03:24.871058078 +0100
@@ -11849,6 +11849,7 @@ print_operand (FILE *file, rtx x, int co
               else
                 size = "XMMWORD";
               break;
+            case 32: size = "YMMWORD"; break;      
             default:
               gcc_unreachable ();
             }

should fix this.  Will test it soon.
Comment 2 Jakub Jelinek 2009-11-25 20:20:58 UTC
Subject: Bug 42165

Author: jakub
Date: Wed Nov 25 20:20:40 2009
New Revision: 154652

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154652
Log:
	PR target/42165
	* config/i386/i386.c (print_operand): For 32-byte memory use
	YMMWORD in -masm=intel mode.  Use TBYTE instead of XWORD.
	* config/i386/i386.md (crc32modesuffix): Expand to nothing
	in -masm=intel mode.
	(sse4_2_crc32di): Print just crc32 instead of crc32q in
	-masm=intel mode.
	* config/i386/mmx.md (*mmx_pinsrw): Print correct size of
	memory operand in -masm=intel mode.
	* config/i386/sse.md (*avx_pinsr<ssevecsize>, *sse4_1_pinsrb,
	*sse2_pinsrw): Likewise.
	(sse_cvtss2siq, sse_cvtss2siq_2, sse_cvttss2siq): Don't print
	q suffix in -masm=intel mode.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/i386.md
    trunk/gcc/config/i386/mmx.md
    trunk/gcc/config/i386/sse.md

Comment 3 Jakub Jelinek 2009-11-25 20:54:30 UTC
Subject: Bug 42165

Author: jakub
Date: Wed Nov 25 20:54:12 2009
New Revision: 154655

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154655
Log:
	PR target/42165
	* config/i386/i386.c (print_operand): For 32-byte memory use
	YMMWORD in -masm=intel mode.  Use TBYTE instead of XWORD.
	* config/i386/i386.md (crc32modesuffix): Expand to nothing
	in -masm=intel mode.
	(sse4_2_crc32di): Print just crc32 instead of crc32q in
	-masm=intel mode.
	* config/i386/mmx.md (*mmx_pinsrw): Print correct size of
	memory operand in -masm=intel mode.
	* config/i386/sse.md (*avx_pinsr<ssevecsize>, *sse4_1_pinsrb,
	*sse2_pinsrw): Likewise.
	(sse_cvtss2siq, sse_cvtss2siq_2, sse_cvttss2siq): Don't print
	q suffix in -masm=intel mode.

Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/config/i386/i386.c
    branches/gcc-4_4-branch/gcc/config/i386/i386.md
    branches/gcc-4_4-branch/gcc/config/i386/mmx.md
    branches/gcc-4_4-branch/gcc/config/i386/sse.md

Comment 4 Jakub Jelinek 2009-11-25 22:54:50 UTC
Fixed for 4.4/4.5.