Bug 49300 - [x86] Missing SSE4.1 intrinsic function
Summary: [x86] Missing SSE4.1 intrinsic function
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 88918
  Show dependency treegraph
 
Reported: 2011-06-06 09:57 UTC by Piotr Wyderski
Modified: 2019-01-21 12:54 UTC (History)
0 users

See Also:
Host:
Target: i?86-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Wyderski 2011-06-06 09:57:38 UTC
The _mm_extract_epi64() function is available only on x64, but
according to the instruction set, its underlying pextrq instruction 
has the following parameters:

PEXTRQ r/m64, xmm2, imm8

so the m64 mode is available also on 32-bit x86. The function is defined
in smmintrin.h:

#ifdef __x86_64__
extern __inline long long  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_extract_epi64 (__m128i __X, const int __N)
{
  return __builtin_ia32_vec_ext_v2di ((__v2di)__X, __N);
}
#endif
Comment 1 Uroš Bizjak 2019-01-21 12:54:03 UTC
(In reply to Piotr Wyderski from comment #0)
> The _mm_extract_epi64() function is available only on x64, but
> according to the instruction set, its underlying pextrq instruction 
> has the following parameters:
> 
> PEXTRQ r/m64, xmm2, imm8
> 
> so the m64 mode is available also on 32-bit x86.

Not really.

$ more pextrq.s
        pextrq $1, %xmm0, a

$ gcc -c -m32 pextrq.s
pextrq.s: Assembler messages:
pextrq.s:1: Error: `pextrq' is only supported in 64-bit mode