Bug 81941 - Rejects intrinsic use
Summary: Rejects intrinsic use
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 7.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2017-08-23 09:36 UTC by Richard Biener
Modified: 2019-04-11 13:24 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2017-08-23 09:36:58 UTC
#include <xmmintrin.h>

void __attribute__((target("fpmath=sse","sse"))) foo (float *x)
{
  volatile __m128 y = _mm_loadu_ps (x);
}

is rejected as

> gcc-7 -S t.c -m32 -march=i586
In file included from t.c:1:0:
t.c: In function ‘foo’:
/usr/lib64/gcc/x86_64-suse-linux/7/include/xmmintrin.h:932:1: error: inlining failed in call to always_inline ‘_mm_loadu_ps’: target specific option mismatch
 _mm_loadu_ps (float const *__P)
 ^~~~~~~~~~~~
t.c:5:23: note: called from here
   volatile __m128 y = _mm_loadu_ps (x);
                       ^~~~~~~~~~~~~~~~

it works with target("fpmath=sse+387","sse").  I suppose the inlining check
should allow inlining if there's a common subset of fpmath rather than
an exact match only.
Comment 1 Richard Biener 2017-08-23 09:42:38 UTC
Alternatively:

> gcc-7 -S t.c -m32 -mno-sse 
In file included from t.c:1:0:
t.c: In function ‘foo’:
/usr/lib64/gcc/x86_64-suse-linux/7/include/xmmintrin.h:932:1: error: inlining failed in call to always_inline ‘_mm_loadu_ps’: target specific option mismatch
 _mm_loadu_ps (float const *__P)
 ^~~~~~~~~~~~
t.c:5:23: note: called from here
   volatile __m128 y = _mm_loadu_ps (x);
                       ^~~~~~~~~~~~~~~~

vs. accepted:

> gcc-7 -S t.c -mno-sse 
>
Comment 2 Richard Biener 2019-04-11 13:24:55 UTC
Reconfirmed.