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: [PATCH] Fix __builtin_ia32_vpermil2p* with -mavx (PR target/43667)


On 04/06/2010 05:46 PM, Jakub Jelinek wrote:
Hi!

Compiling
typedef double __v2df __attribute__ ((__vector_size__ (16)));
typedef long long __v2di __attribute__ ((__vector_size__ (16)));
__v2df foo (__v2df X, __v2df Y, __v2di C)
{
   return __builtin_ia32_vpermil2pd (X, Y, C, 1);
}
with -O2 -mavx ICEs with:
a.c:10:1: error: unrecognizable insn:
(insn 8 7 9 3 a.c:9 (set (reg:V2DF 63)
         (unspec:V2DF [
                 (reg/v:V2DF 60 [ X ])
                 (reg/v:V2DF 61 [ Y ])
                 (reg/v:V2DI 62 [ C ])
                 (const_int 1 [0x1])
             ] 168)) -1 (nil))
a.c:10:1: internal compiler error: in extract_insn, at recog.c:2103
Please submit a full bug report,
with preprocessed source if appropriate.
See<http://gcc.gnu.org/bugs.html>  for instructions.
The problem is that these builtins use wrong option mask, the
instructions are guarded with TARGET_XOP, but OPTION_MASK_ISA_AVX
is used.  The patch below fixes it (and also uses correct
case labels in ix86_expand_args_builtin - all other cases use
V*_FTYPE_* enum codes, so using MULTI_* defines in that case
is inconsistent).

Ok for trunk and 4.5?

2010-04-06 Jakub Jelinek<jakub@redhat.com>

PR target/43667
* config/i386/i386.c (bdesc_multi_arg): Use OPTION_MASK_ISA_XOP
instead of OPTION_MASK_ISA_AVX for __builtin_ia32_vpermil2p*.
(ix86_expand_args_builtin): Use V*_FTYPE_* enum codes instead of
MULTI_* defines for 4 argument vpermil2p* builtins.

This is OK everywhere.


Thanks,
Uros.


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