Skip to content

[Headers][X86] Allow MMX/SSE2/AVX2/AVX512BW integer saturated arithmetic intrinsics to be used in constexpr #152506

@RKSimon

Description

@RKSimon

All of these intrinsics wrap generic __builtin_elementwise_add_sat/sub_sat which can already be used in constexpr

_mm_adds_pi8 _mm_adds_pi16
_mm_subs_pi8 _mm_subs_pi16

_mm_adds_epi8 _mm_adds_epi16
_mm_subs_epi8 _mm_subs_epi16

_mm256_adds_epi8 _mm256_adds_epi16
_mm256_subs_epi8 _mm256_subs_epi16

_mm512_adds_epi8 _mm512_adds_epi16
_mm512_subs_epi8 _mm512_subs_epi16

(ignore the AVX512 mask/maskz variants for now)

You can use #152296 for reference - just make sure some of the constants actually saturate!

Metadata

Metadata

Assignees

Labels

backend:X86clang:headersHeaders provided by Clang, e.g. for intrinsicsconstexprAnything related to constant evaluationgood first issuehttps://github.com/llvm/llvm-project/contribute

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions