[clang] [llvm] [X86] AVX10_V2_AUX Implementation (PR #206888)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 30 08:21:58 PDT 2026
================
@@ -5039,6 +5060,307 @@ let Features = "avx10.2", Attributes = [NoThrow, Const, RequiredVectorWidth<512>
def vgetmantbf16512_mask : X86Builtin<"_Vector<32, __bf16>(_Vector<32, __bf16>, _Constant int, _Vector<32, __bf16>, unsigned int)">;
}
+// AVX10 V2 AUX - Convert instructions
+
+// Group A: PS(f32) -> i8 truncating conversions (quarter-size: output always v16i8)
+
+// VCVTPS2BF8
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtps2bf8_128 : X86Builtin<"_Vector<16, char>(_Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtps2bf8_256 : X86Builtin<"_Vector<16, char>(_Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtps2bf8_512 : X86Builtin<"_Vector<16, char>(_Vector<16, float>)">;
+}
+
+// VCVTPS2BF8S
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtps2bf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtps2bf8s_256 : X86Builtin<"_Vector<16, char>(_Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtps2bf8s_512 : X86Builtin<"_Vector<16, char>(_Vector<16, float>)">;
+}
+
+// VCVTPS2HF8
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtps2hf8_128 : X86Builtin<"_Vector<16, char>(_Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtps2hf8_256 : X86Builtin<"_Vector<16, char>(_Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtps2hf8_512 : X86Builtin<"_Vector<16, char>(_Vector<16, float>)">;
+}
+
+// VCVTPS2HF8S
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtps2hf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtps2hf8s_256 : X86Builtin<"_Vector<16, char>(_Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtps2hf8s_512 : X86Builtin<"_Vector<16, char>(_Vector<16, float>)">;
+}
+
+// VCVTROPS2HF8
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtrops2hf8_128 : X86Builtin<"_Vector<16, char>(_Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtrops2hf8_256 : X86Builtin<"_Vector<16, char>(_Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtrops2hf8_512 : X86Builtin<"_Vector<16, char>(_Vector<16, float>)">;
+}
+
+// VCVTROPS2HF8S
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtrops2hf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtrops2hf8s_256 : X86Builtin<"_Vector<16, char>(_Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtrops2hf8s_512 : X86Builtin<"_Vector<16, char>(_Vector<16, float>)">;
+}
+
+// Group B: Bias PS -> i8 conversions (2-operand: bias + f32 source -> i8 dest)
+
+// VCVTBIASPS2BF8
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtbiasps2bf8_128 : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtbiasps2bf8_256 : X86Builtin<"_Vector<16, char>(_Vector<32, char>, _Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtbiasps2bf8_512 : X86Builtin<"_Vector<16, char>(_Vector<64, char>, _Vector<16, float>)">;
+}
+
+// VCVTBIASPS2BF8S
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtbiasps2bf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtbiasps2bf8s_256 : X86Builtin<"_Vector<16, char>(_Vector<32, char>, _Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtbiasps2bf8s_512 : X86Builtin<"_Vector<16, char>(_Vector<64, char>, _Vector<16, float>)">;
+}
+
+// VCVTBIASPS2HF8
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtbiasps2hf8_128 : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtbiasps2hf8_256 : X86Builtin<"_Vector<16, char>(_Vector<32, char>, _Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtbiasps2hf8_512 : X86Builtin<"_Vector<16, char>(_Vector<64, char>, _Vector<16, float>)">;
+}
+
+// VCVTBIASPS2HF8S
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtbiasps2hf8s_128 : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<4, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<256>] in {
+ def vcvtbiasps2hf8s_256 : X86Builtin<"_Vector<16, char>(_Vector<32, char>, _Vector<8, float>)">;
+}
+
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<512>] in {
+ def vcvtbiasps2hf8s_512 : X86Builtin<"_Vector<16, char>(_Vector<64, char>, _Vector<16, float>)">;
+}
+
+// Group C: 8bit -> PS expanding conversions
+
+// VCVTBF82PS
+let Features = "avx10v2aux", Attributes = [NoThrow, RequiredVectorWidth<128>] in {
+ def vcvtbf8_2ps128 : X86Builtin<"_Vector<4, float>(_Vector<16, char>)">;
----------------
ganeshgit wrote:
Done! There are inconsistencies in converts other headers. For aux2, I have followed your comments.
https://github.com/llvm/llvm-project/pull/206888
More information about the cfe-commits
mailing list