Skip to content

Commit

Permalink
[Headers] Fix up some conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
pogo59 committed Jun 22, 2023
1 parent 3a57152 commit 3db8410
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
24 changes: 11 additions & 13 deletions clang/lib/Headers/bmi2intrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*===-----------------------------------------------------------------------===
*/

#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
#error "Never use <bmi2intrin.h> directly; include <x86intrin.h> instead."
#ifndef __IMMINTRIN_H
#error "Never use <bmi2intrin.h> directly; include <immintrin.h> instead."
#endif

#ifndef __BMI2INTRIN_H
Expand All @@ -35,6 +35,14 @@ _pext_u32(unsigned int __X, unsigned int __Y)
return __builtin_ia32_pext_si(__X, __Y);
}

static __inline__ unsigned int __DEFAULT_FN_ATTRS
_mulx_u32(unsigned int __X, unsigned int __Y, unsigned int *__P)
{
unsigned long long __res = (unsigned long long) __X * __Y;
*__P = (unsigned int)(__res >> 32);
return (unsigned int)__res;
}

#ifdef __x86_64__

static __inline__ unsigned long long __DEFAULT_FN_ATTRS
Expand Down Expand Up @@ -64,17 +72,7 @@ _mulx_u64 (unsigned long long __X, unsigned long long __Y,
return (unsigned long long) __res;
}

#else /* !__x86_64__ */

static __inline__ unsigned int __DEFAULT_FN_ATTRS
_mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P)
{
unsigned long long __res = (unsigned long long) __X * __Y;
*__P = (unsigned int) (__res >> 32);
return (unsigned int) __res;
}

#endif /* !__x86_64__ */
#endif /* __x86_64__ */

#undef __DEFAULT_FN_ATTRS

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Headers/clzerointrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
*===-----------------------------------------------------------------------===
*/
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
#ifndef __X86INTRIN_H
#error "Never use <clzerointrin.h> directly; include <x86intrin.h> instead."
#endif

Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Headers/rdseedintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*===-----------------------------------------------------------------------===
*/

#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
#error "Never use <rdseedintrin.h> directly; include <x86intrin.h> instead."
#ifndef __IMMINTRIN_H
#error "Never use <rdseedintrin.h> directly; include <immintrin.h> instead."
#endif

#ifndef __RDSEEDINTRIN_H
Expand Down

0 comments on commit 3db8410

Please sign in to comment.