Skip to content

Commit

Permalink
Merge branch amd-master into amd-common
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Jun 21, 2018
2 parents 3532f40 + 3cf091f commit 3188167
Show file tree
Hide file tree
Showing 16 changed files with 303 additions and 221 deletions.
14 changes: 9 additions & 5 deletions docs/AddressSanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,17 @@ this purpose.
Disabling Instrumentation with ``__attribute__((no_sanitize("address")))``
--------------------------------------------------------------------------

Some code should not be instrumented by AddressSanitizer. One may use the
function attribute ``__attribute__((no_sanitize("address")))`` (which has
deprecated synonyms `no_sanitize_address` and `no_address_safety_analysis`) to
disable instrumentation of a particular function. This attribute may not be
supported by other compilers, so we suggest to use it together with
Some code should not be instrumented by AddressSanitizer. One may use
the attribute ``__attribute__((no_sanitize("address")))`` (which has
deprecated synonyms `no_sanitize_address` and
`no_address_safety_analysis`) to disable instrumentation of a
particular function. This attribute may not be supported by other
compilers, so we suggest to use it together with
``__has_feature(address_sanitizer)``.

The same attribute used on a global variable prevents AddressSanitizer
from adding redzones around it and detecting out of bounds accesses.

Suppressing Errors in Recompiled Code (Blacklist)
-------------------------------------------------

Expand Down
21 changes: 11 additions & 10 deletions include/clang/Basic/AttrDocs.td
Original file line number Diff line number Diff line change
Expand Up @@ -1804,13 +1804,14 @@ This attribute accepts a single parameter that must be one of the following:
def NoSanitizeDocs : Documentation {
let Category = DocCatFunction;
let Content = [{
Use the ``no_sanitize`` attribute on a function declaration to specify
that a particular instrumentation or set of instrumentations should not be
applied to that function. The attribute takes a list of string literals,
which have the same meaning as values accepted by the ``-fno-sanitize=``
flag. For example, ``__attribute__((no_sanitize("address", "thread")))``
specifies that AddressSanitizer and ThreadSanitizer should not be applied
to the function.
Use the ``no_sanitize`` attribute on a function or a global variable
declaration to specify that a particular instrumentation or set of
instrumentations should not be applied. The attribute takes a list of
string literals, which have the same meaning as values accepted by the
``-fno-sanitize=`` flag. For example,
``__attribute__((no_sanitize("address", "thread")))`` specifies that
AddressSanitizer and ThreadSanitizer should not be applied to the
function or variable.

See :ref:`Controlling Code Generation <controlling-code-generation>` for a
full list of supported sanitizer flags.
Expand All @@ -1825,9 +1826,9 @@ def NoSanitizeAddressDocs : Documentation {
let Content = [{
.. _langext-address_sanitizer:

Use ``__attribute__((no_sanitize_address))`` on a function declaration to
specify that address safety instrumentation (e.g. AddressSanitizer) should
not be applied to that function.
Use ``__attribute__((no_sanitize_address))`` on a function or a global
variable declaration to specify that address safety instrumentation
(e.g. AddressSanitizer) should not be applied.
}];
}

Expand Down
8 changes: 4 additions & 4 deletions include/clang/Basic/BuiltinsX86.def
Original file line number Diff line number Diff line change
Expand Up @@ -908,10 +908,10 @@ TARGET_BUILTIN(__builtin_ia32_cvtps2dq512_mask, "V16iV16fV16iUsIi", "nc", "avx51
TARGET_BUILTIN(__builtin_ia32_cvtpd2dq512_mask, "V8iV8dV8iUcIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtps2udq512_mask, "V16iV16fV16iUsIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtpd2udq512_mask, "V8iV8dV8iUcIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_minps512_mask, "V16fV16fV16fV16fUsIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_minpd512_mask, "V8dV8dV8dV8dUcIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_maxps512_mask, "V16fV16fV16fV16fUsIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_maxpd512_mask, "V8dV8dV8dV8dUcIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_minps512, "V16fV16fV16fIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_minpd512, "V8dV8dV8dIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_maxps512, "V16fV16fV16fIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_maxpd512, "V8dV8dV8dIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtdq2ps512_mask, "V16fV16iV16fUsIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtudq2ps512_mask, "V16fV16iV16fUsIi", "nc", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtpd2ps512_mask, "V8fV8dV8fUcIi", "nc", "avx512f")
Expand Down
3 changes: 3 additions & 0 deletions include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -4984,6 +4984,8 @@ class Sema {
SourceLocation NameLoc,
IdentifierInfo &Name);

ParsedType getConstructorName(IdentifierInfo &II, SourceLocation NameLoc,
Scope *S, CXXScopeSpec &SS);
ParsedType getDestructorName(SourceLocation TildeLoc,
IdentifierInfo &II, SourceLocation NameLoc,
Scope *S, CXXScopeSpec &SS,
Expand Down Expand Up @@ -5704,6 +5706,7 @@ class Sema {
//===--------------------------------------------------------------------===//
// C++ Classes
//
CXXRecordDecl *getCurrentClass(Scope *S, const CXXScopeSpec *SS);
bool isCurrentClassName(const IdentifierInfo &II, Scope *S,
const CXXScopeSpec *SS = nullptr);
bool isCurrentClassNameTypo(IdentifierInfo *&II, const CXXScopeSpec *SS);
Expand Down
204 changes: 76 additions & 128 deletions lib/Headers/avx512fintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,104 +944,78 @@ _mm512_maskz_sub_epi32(__mmask16 __U, __m512i __A, __m512i __B)
(__v16si)_mm512_setzero_si512());
}

#define _mm512_max_round_pd(A, B, R) \
(__m512d)__builtin_ia32_maxpd512((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), (int)(R))

#define _mm512_mask_max_round_pd(W, U, A, B, R) \
(__m512d)__builtin_ia32_maxpd512_mask((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), \
(__v8df)(__m512d)(W), (__mmask8)(U), \
(int)(R))
(__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
(__v8df)_mm512_max_round_pd((A), (B), (R)), \
(__v8df)(W))

#define _mm512_maskz_max_round_pd(U, A, B, R) \
(__m512d)__builtin_ia32_maxpd512_mask((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), \
(__v8df)_mm512_setzero_pd(), \
(__mmask8)(U), (int)(R))

#define _mm512_max_round_pd(A, B, R) \
(__m512d)__builtin_ia32_maxpd512_mask((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), \
(__v8df)_mm512_undefined_pd(), \
(__mmask8)-1, (int)(R))
(__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
(__v8df)_mm512_max_round_pd((A), (B), (R)), \
(__v8df)_mm512_setzero_pd())

static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_max_pd(__m512d __A, __m512d __B)
{
return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A,
(__v8df) __B,
(__v8df)
_mm512_setzero_pd (),
(__mmask8) -1,
_MM_FROUND_CUR_DIRECTION);
return (__m512d) __builtin_ia32_maxpd512((__v8df) __A, (__v8df) __B,
_MM_FROUND_CUR_DIRECTION);
}

static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_mask_max_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)
{
return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A,
(__v8df) __B,
(__v8df) __W,
(__mmask8) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512d)__builtin_ia32_selectpd_512(__U,
(__v8df)_mm512_max_pd(__A, __B),
(__v8df)__W);
}

static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_maskz_max_pd (__mmask8 __U, __m512d __A, __m512d __B)
{
return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A,
(__v8df) __B,
(__v8df)
_mm512_setzero_pd (),
(__mmask8) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512d)__builtin_ia32_selectpd_512(__U,
(__v8df)_mm512_max_pd(__A, __B),
(__v8df)_mm512_setzero_pd());
}

#define _mm512_max_round_ps(A, B, R) \
(__m512)__builtin_ia32_maxps512((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), (int)(R))

#define _mm512_mask_max_round_ps(W, U, A, B, R) \
(__m512)__builtin_ia32_maxps512_mask((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), \
(__v16sf)(__m512)(W), (__mmask16)(U), \
(int)(R))
(__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
(__v16sf)_mm512_max_round_ps((A), (B), (R)), \
(__v16sf)(W))

#define _mm512_maskz_max_round_ps(U, A, B, R) \
(__m512)__builtin_ia32_maxps512_mask((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), \
(__v16sf)_mm512_setzero_ps(), \
(__mmask16)(U), (int)(R))

#define _mm512_max_round_ps(A, B, R) \
(__m512)__builtin_ia32_maxps512_mask((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), \
(__v16sf)_mm512_undefined_ps(), \
(__mmask16)-1, (int)(R))
(__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
(__v16sf)_mm512_max_round_ps((A), (B), (R)), \
(__v16sf)_mm512_setzero_ps())

static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_max_ps(__m512 __A, __m512 __B)
{
return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A,
(__v16sf) __B,
(__v16sf)
_mm512_setzero_ps (),
(__mmask16) -1,
_MM_FROUND_CUR_DIRECTION);
return (__m512) __builtin_ia32_maxps512((__v16sf) __A, (__v16sf) __B,
_MM_FROUND_CUR_DIRECTION);
}

static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_mask_max_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)
{
return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A,
(__v16sf) __B,
(__v16sf) __W,
(__mmask16) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512)__builtin_ia32_selectps_512(__U,
(__v16sf)_mm512_max_ps(__A, __B),
(__v16sf)__W);
}

static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_maskz_max_ps (__mmask16 __U, __m512 __A, __m512 __B)
{
return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A,
(__v16sf) __B,
(__v16sf)
_mm512_setzero_ps (),
(__mmask16) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512)__builtin_ia32_selectps_512(__U,
(__v16sf)_mm512_max_ps(__A, __B),
(__v16sf)_mm512_setzero_ps());
}

static __inline__ __m128 __DEFAULT_FN_ATTRS
Expand Down Expand Up @@ -1205,104 +1179,78 @@ _mm512_maskz_max_epu64 (__mmask8 __M, __m512i __A, __m512i __B)
(__v8di)_mm512_setzero_si512());
}

#define _mm512_min_round_pd(A, B, R) \
(__m512d)__builtin_ia32_minpd512((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), (int)(R))

#define _mm512_mask_min_round_pd(W, U, A, B, R) \
(__m512d)__builtin_ia32_minpd512_mask((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), \
(__v8df)(__m512d)(W), (__mmask8)(U), \
(int)(R))
(__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
(__v8df)_mm512_min_round_pd((A), (B), (R)), \
(__v8df)(W))

#define _mm512_maskz_min_round_pd(U, A, B, R) \
(__m512d)__builtin_ia32_minpd512_mask((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), \
(__v8df)_mm512_setzero_pd(), \
(__mmask8)(U), (int)(R))

#define _mm512_min_round_pd(A, B, R) \
(__m512d)__builtin_ia32_minpd512_mask((__v8df)(__m512d)(A), \
(__v8df)(__m512d)(B), \
(__v8df)_mm512_undefined_pd(), \
(__mmask8)-1, (int)(R))
(__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
(__v8df)_mm512_min_round_pd((A), (B), (R)), \
(__v8df)_mm512_setzero_pd())

static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_min_pd(__m512d __A, __m512d __B)
{
return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A,
(__v8df) __B,
(__v8df)
_mm512_setzero_pd (),
(__mmask8) -1,
_MM_FROUND_CUR_DIRECTION);
return (__m512d) __builtin_ia32_minpd512((__v8df) __A, (__v8df) __B,
_MM_FROUND_CUR_DIRECTION);
}

static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_mask_min_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B)
{
return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A,
(__v8df) __B,
(__v8df) __W,
(__mmask8) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512d)__builtin_ia32_selectpd_512(__U,
(__v8df)_mm512_min_pd(__A, __B),
(__v8df)__W);
}

#define _mm512_mask_min_round_ps(W, U, A, B, R) \
(__m512)__builtin_ia32_minps512_mask((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), \
(__v16sf)(__m512)(W), (__mmask16)(U), \
(int)(R))

#define _mm512_maskz_min_round_ps(U, A, B, R) \
(__m512)__builtin_ia32_minps512_mask((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), \
(__v16sf)_mm512_setzero_ps(), \
(__mmask16)(U), (int)(R))

#define _mm512_min_round_ps(A, B, R) \
(__m512)__builtin_ia32_minps512_mask((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), \
(__v16sf)_mm512_undefined_ps(), \
(__mmask16)-1, (int)(R))

static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_maskz_min_pd (__mmask8 __U, __m512d __A, __m512d __B)
{
return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A,
(__v8df) __B,
(__v8df)
_mm512_setzero_pd (),
(__mmask8) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512d)__builtin_ia32_selectpd_512(__U,
(__v8df)_mm512_min_pd(__A, __B),
(__v8df)_mm512_setzero_pd());
}

#define _mm512_min_round_ps(A, B, R) \
(__m512)__builtin_ia32_minps512((__v16sf)(__m512)(A), \
(__v16sf)(__m512)(B), (int)(R))

#define _mm512_mask_min_round_ps(W, U, A, B, R) \
(__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
(__v16sf)_mm512_min_round_ps((A), (B), (R)), \
(__v16sf)(W))

#define _mm512_maskz_min_round_ps(U, A, B, R) \
(__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
(__v16sf)_mm512_min_round_ps((A), (B), (R)), \
(__v16sf)_mm512_setzero_ps())

static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_min_ps(__m512 __A, __m512 __B)
{
return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A,
(__v16sf) __B,
(__v16sf)
_mm512_setzero_ps (),
(__mmask16) -1,
_MM_FROUND_CUR_DIRECTION);
return (__m512) __builtin_ia32_minps512((__v16sf) __A, (__v16sf) __B,
_MM_FROUND_CUR_DIRECTION);
}

static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_mask_min_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B)
{
return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A,
(__v16sf) __B,
(__v16sf) __W,
(__mmask16) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512)__builtin_ia32_selectps_512(__U,
(__v16sf)_mm512_min_ps(__A, __B),
(__v16sf)__W);
}

static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_maskz_min_ps (__mmask16 __U, __m512 __A, __m512 __B)
{
return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A,
(__v16sf) __B,
(__v16sf)
_mm512_setzero_ps (),
(__mmask16) __U,
_MM_FROUND_CUR_DIRECTION);
return (__m512)__builtin_ia32_selectps_512(__U,
(__v16sf)_mm512_min_ps(__A, __B),
(__v16sf)_mm512_setzero_ps());
}

static __inline__ __m128 __DEFAULT_FN_ATTRS
Expand Down
Loading

0 comments on commit 3188167

Please sign in to comment.