Reorganize handling of added SSE intrinsics to simplify.

This commit is contained in:
Paul Kulchenko 2021-09-20 21:10:12 -07:00 committed by Justine Tunney
parent 2e4b40042a
commit af1153e057

View file

@ -218,53 +218,19 @@ struct thatispacked mayalias __usi128ma {
#define _mm_cmpunord_sd(M128D_0, M128D_1) \
__builtin_ia32_cmpunordsd((__v2df)(M128D_0), (__v2df)(M128D_1))
#define _mm_mul_epu32(A, B) \
#define _mm_SSE2(op, A, B) \
({ \
__m128i R = A; \
asm("pmuludq %1, %0" \
asm(#op " %1, %0" \
: "+x"(R) : "xm"(B)); \
R; \
})
#define _mm_add_epi64(A, B) \
({ \
__m128i R = A; \
asm("paddq %1, %0" \
: "+x"(R) : "xm"(B)); \
R; \
})
#define _mm_srli_epi64(A, B) \
({ \
__m128i R = A; \
asm("psrlq %1, %0" \
: "+x"(R) : "xm"(B)); \
R; \
})
#define _mm_slli_epi64(A, B) \
({ \
__m128i R = A; \
asm("psllq %1, %0" \
: "+x"(R) : "xm"(B)); \
R; \
})
#define _mm_unpacklo_epi64(A, B) \
({ \
__m128i R = A; \
asm("punpcklqdq %1, %0" \
: "+x"(R) : "xm"(B)); \
R; \
})
#define _mm_unpackhi_epi64(A, B) \
({ \
__m128i R = A; \
asm("punpckhqdq %1, %0" \
: "+x"(R) : "xm"(B)); \
R; \
})
#define _mm_mul_epu32(A, B) _mm_SSE2(pmuludq, A, B)
#define _mm_add_epi64(A, B) _mm_SSE2(paddq, A, B)
#define _mm_srli_epi64(A, B) _mm_SSE2(psrlq, A, B)
#define _mm_slli_epi64(A, B) _mm_SSE2(psllq, A, B)
#define _mm_unpacklo_epi64(A, B) _mm_SSE2(punpcklqdq, A, B)
#define _mm_unpackhi_epi64(A, B) _mm_SSE2(punpckhqdq, A, B)
/*───────────────────────────────────────────────────────────────────────────│─╗
cosmopolitan § it's a trap! » sse2 » miscellaneous