[clang] [llvm] [AArch64] Refactor implementation of FP8 types (NFC) (PR #118969)

2024-12-06 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/118969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Fix argument passing for SVE tuples (PR #118961)

2024-12-23 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/118961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Arm] Generate explicit bitcasts in NeonEmitter (PR #121802)

2025-01-08 Thread Momchil Velikov via cfe-commits
@@ -1382,14 +1382,15 @@ void Intrinsic::emitBodyAsBuiltinCall() { Type CastToType = T; // Check if an explicit cast is needed. -if (CastToType.isVector() && -(LocalCK == ClassB || (T.isHalf() && !T.isScalarForMangling( { - CastToType.makeInteger(8,

[clang] [llvm] [Arm] Regenerate tests (NFC) (PR #121801)

2025-01-08 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: > Instead it could perform a load with the original type and then emit an LLVM > IR `bitcast`, just like it does for "C-style" Except that it does not work when aggregate types are involved. Using `mem2reg,sroa` is a bit better than just `mem2reg`, even though `sroa` gen

[clang] [AArch64] Update SVE untyped intrinsics to have FP8 variants (PR #123585)

2025-01-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov approved this pull request. https://github.com/llvm/llvm-project/pull/123585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Simplify definitions of SVE/SME intrinsics which set FPMR (PR #123796)

2025-01-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/123796 If an intrinsic has an `fpm_t` parameter, automatically set the flag `SetsFPMR` and append "_fpm" to the name. >From c807a4eb627919cb3161fe89c0623039dc6906d0 Mon Sep 17 00:00:00 2001 From: Momchil Velik

[clang] [Arm] Fix generating code with UB in NeonEmitter (PR #121802)

2025-01-24 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/121802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Alternative implementation of FP8 Neon intrinsics (PR #120476)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov ready_for_review https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Allow FP8 Neon vector types to be used by __builtin_shufflevector (PR #119031)

2025-01-20 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: I've implemented all the relevant Neon FP8 intrinsics on top of two alternative implementations for Neon FP8 vector types: * builtin vector types: https://github.com/llvm/llvm-project/pull/121804 (top of PR stack, this PR right here is a part of it) * using `neon_vector_t

[clang] [AArch64] Implement NEON FP8 vectors as VectorType (PR #123603)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/123603 Reimplement Neon FP8 vector types using attribute `neon_vector_type` instead of having them as builtin types. This allows to implement FP8 Neon intrinsics without the need to add special cases for these

[clang] [AArch64] Refactor implementation of FP8 types (NFC) (PR #123604)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/123604 - The FP8 scalar type (`__mfp8`) was described as a vector type - The FP8 vector types were described/assumed to have integer element type (the element type ought to be `__mfp8`) - Add support for `m` ty

[clang] [llvm] [Experimental] Alternative implementation of FP8 Neon (PR #120476)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Experimental] Alternative implementation of FP8 Neon (PR #120476)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Alternative implementation of FP8 Neon intrinsics (PR #120476)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Update SVE untyped intrinsics to have FP8 variants (PR #123585)

2025-01-20 Thread Momchil Velikov via cfe-commits
@@ -2280,15 +2280,15 @@ let SVETargetGuard = "sve2p1", SMETargetGuard = "sme2" in { let SVETargetGuard = "sve2p1", SMETargetGuard = InvalidMode in { // ZIPQ1, ZIPQ2, UZPQ1, UZPQ2 - def SVZIPQ1 : SInst<"svzipq1[_{d}]", "ddd", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_zip

[clang] [llvm] [AArch64] Add Neon FP8 conversion intrinsics (PR #123612)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/123612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add FP8 Neon intrinsics for dot-product (PR #123613)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/123613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Alternative implementation of FP8 Neon intrinsics (PR #120476)

2025-01-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Refactor implementation of FP8 types (NFC) (PR #123604)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/123604 >From e825bc0f660eb3dce41ee062d04e4e39bbac5d2a Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Fri, 6 Dec 2024 13:09:23 + Subject: [PATCH] [AArch64] Refactor implementation of FP8 types (NFC) *

[clang] [AArch64] Refactor implementation of FP8 types (NFC) (PR #123604)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/123604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Implement NEON FP8 vectors as VectorType (PR #123603)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/123603 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add Neon FP8 conversion intrinsics (PR #123612)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/123612 >From 7ff7e9588f6a76dcbe7deb2dc5f78055f71b476b Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Fri, 6 Dec 2024 19:24:16 + Subject: [PATCH] [AArch64] Add Neon FP8 conversion intrinsics [fixup] A

[clang] [Clang][AArch64] Allow FP8 Neon vector types to be used by __builtin_shufflevector (PR #119031)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/119031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Refactor implementation of FP8 types (NFC) (PR #118969)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/118969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add FP8 Neon intrinsics for dot-product (PR #119911)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/119911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement NEON FP8 intrinsics for fused multiply-add (indexed) (PR #120403)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/120403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement FP8 Neon reinterpret intrinsics (PR #121804)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/121804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement NEON FP8 fused multiply-add intrinsics (non-indexed) (PR #120273)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/120273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add Neon FP8 conversion intrinsics (PR #119033)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/119033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement FP8 Neon reinterpret intrinsics (PR #120476)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement FP8 Neon reinterpret intrinsics (PR #120476)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] FP8 implicit bitcast (PR #122893)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/122893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement NEON FP8 fused multiply-add intrinsics (non-indexed) (PR #123614)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/123614 >From ae09723ecc1cc9bc2cbcef300b05aa2ce5ced448 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 17 Dec 2024 11:42:42 + Subject: [PATCH 1/2] [AArch64] Add FP8 Neon intrinsics for dot-product

[clang] [llvm] [AArch64] Add FP8 Neon intrinsics for dot-product (PR #123613)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/123613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement NEON FP8 intrinsics for fused multiply-add (indexed) (PR #123615)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/123615 >From ffb554ea1ff638237ffc9cb9a491e5a6ad66d8f6 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 17 Dec 2024 17:10:38 + Subject: [PATCH 1/2] [AArch64] Implement NEON FP8 fused multiply-add i

[clang] [llvm] [AArch64] Implement NEON FP8 intrinsics for fused multiply-add (PR #123615)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/123615 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement NEON FP8 intrinsics for fused multiply-add (indexed) (PR #123615)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/123615 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add Neon FP8 conversion intrinsics (PR #123612)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/123612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add FP8 Neon intrinsics for dot-product (PR #123613)

2025-01-27 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/123613 >From ae09723ecc1cc9bc2cbcef300b05aa2ce5ced448 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 17 Dec 2024 11:42:42 + Subject: [PATCH] [AArch64] Add FP8 Neon intrinsics for dot-product THi

[clang] [AArch64] Implement FP8 Neon reinterpret intrinsics (PR #120476)

2025-01-28 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/120476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Momchil Velikov via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) momchil-velikov wrote: It ca

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Momchil Velikov via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) momchil-velikov wrote: > Als

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/124968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-29 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/124968 Fixes #124907 >From e490f9684aa8784299a9195a195433270f2cec79 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Wed, 29 Jan 2025 18:31:18 + Subject: [PATCH] [AArch64] Add MSVC mangling for the __

[clang] [llvm] [AArch64] Add Neon FP8 conversion intrinsics (PR #119033)

2025-01-13 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +bf16 -target-feature +faminmax -emit-llvm -verify %s -o /dev/null momchil-velikov wrote: No, they are both required by `fp8`. https://github.com/llvm/llvm-pro

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-13 Thread Momchil Velikov via cfe-commits
@@ -557,6 +557,10 @@ def invoke_tool(exe, cmd_args, ir, preprocess_cmd=None, verbose=False): UTC_AVOID = "NOTE: Do not autogenerate" UNUSED_NOTE = "NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:" +DATA_LAYOUT_RE = re.compile(

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-13 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/121800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Refactor implementation of FP8 types (NFC) (PR #118969)

2025-01-13 Thread Momchil Velikov via cfe-commits
@@ -57,6 +57,11 @@ // - IsBF true for vector of brain float elements. //===--===// +#ifndef SVE_SCALAR_TYPE +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) \ momchil-velik

[clang] [AArch64] Refactor implementation of FP8 types (NFC) (PR #118969)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/118969 >From e8a216c5effbf426ada5b9deb89fc2b5d9405f7c Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Fri, 6 Dec 2024 13:09:23 + Subject: [PATCH 1/2] [AArch64] Refactor implementation of FP8 types (NFC

[clang] [Clang][AArch64] Allow FP8 Neon vector types to be used by __builtin_shufflevector (PR #119031)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/119031 >From e8a216c5effbf426ada5b9deb89fc2b5d9405f7c Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Fri, 6 Dec 2024 13:09:23 + Subject: [PATCH 1/5] [AArch64] Refactor implementation of FP8 types (NFC

[clang] [AArch64] FP8 implicit bitcast (PR #122893)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/122893 The intrinsics generated in `arm_neon.h` heavily rely on C-style cast operator having bitcast semantics for vector operands. This patch allows such expressions to "convert" to/from FP8 builtin Neon vect

[clang] [AArch64] Refactor implementation of FP8 types (NFC) (PR #118969)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -650,6 +655,8 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) { // An ext_vector_type of Bool is really a vector of bits. llvm::Type *IRElemTy = VT->isExtVectorBoolType() ? llvm::Type::getInt1Ty(getLLVMContext()) +

[clang] [Clang][AArch64] Allow FP8 Neon vector types to be used by __builtin_shufflevector (PR #119031)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -2578,6 +2576,19 @@ bool Type::isSveVLSBuiltinType() const { return false; } +bool Type::isNeonVectorBuiltinType() const { momchil-velikov wrote: Done https://github.com/llvm/llvm-project/pull/119031 ___ cfe-c

[clang] [Clang][AArch64] Allow FP8 Neon vector types to be used by __builtin_shufflevector (PR #119031)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,123 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -triple aarch64-linux -target-feature +neon -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s + +// REQUIRES: a

[clang] [Clang][AArch64] Allow FP8 Neon vector types to be used by __builtin_shufflevector (PR #119031)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -triple aarch64 -fsyntax-only -verify %s + +// REQUIRES: aarch64-registered-target + +typedef __attribute__((neon_vector_type(8))) signed char int8x8_t; +typedef __attribute__((neon_vector_type(16))) signed char int8x16_t; + +typedef __MFloat8x

[clang] [llvm] [AArch64] Add Neon FP8 conversion intrinsics (PR #119033)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,308 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1-triple aarch64-none-linux-gnu -target-feature +neon -target-feature +bf16 -target-feature +fp8 -disable-O0-optnone -Werror -Wall -e

[clang] [llvm] [AArch64] Add FP8 Neon intrinsics for dot-product (PR #119911)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,143 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 + +// RUN: %clang_cc1-triple aarch64-none-linux-gnu -target-feature +neon -target-feature +bf16 -target-feature +fp8 -target-feature +fp8dot2 -target-f

[clang] [llvm] [AArch64] Implement NEON FP8 fused multiply-add intrinsics (non-indexed) (PR #120273)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +bf16 -target-feature +faminmax -target-feature +fp8 -emit-llvm -verify %s -o /dev/null momchil-velikov wrote: They are needed. https://github.com/llvm/llvm-pr

[clang] [llvm] [AArch64] Add FP8 Neon intrinsics for dot-product (PR #119911)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,54 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +bf16 -target-feature +faminmax -target-feature +fp8 -emit-llvm -verify %s -o /dev/null momchil-velikov wrote: They are needed. https://github.com/llvm/llvm-pr

[clang] [llvm] [AArch64] Add FP8 Neon intrinsics for dot-product (PR #119911)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/119911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Implement FP8 SVE/SME reinterpret intrinsics (PR #121063)

2025-01-13 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/121063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Arm] Generate explicit bitcasts in NeonEmitter (PR #121802)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/121802 >From 6a565f4a894fcc7abf35f8bbd3f141ccee5cb301 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 14 Jan 2025 14:49:11 + Subject: [PATCH] [AArch64] Fix generating a code with UB in NeonEmitter

[clang] [Arm] Fix generating code with UB in NeonEmitter (PR #121802)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/121802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Arm] Generate explicit bitcasts in NeonEmitter (PR #121802)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/121802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Arm] Fix generating code with UB in NeonEmitter (PR #121802)

2025-01-14 Thread Momchil Velikov via cfe-commits
@@ -1382,14 +1382,15 @@ void Intrinsic::emitBodyAsBuiltinCall() { Type CastToType = T; // Check if an explicit cast is needed. -if (CastToType.isVector() && -(LocalCK == ClassB || (T.isHalf() && !T.isScalarForMangling( { - CastToType.makeInteger(8,

[clang] [Arm] Fix generating code with UB in NeonEmitter (PR #121802)

2025-01-14 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: I reduced the scope of this PR to just fixing the immediate UB. https://github.com/llvm/llvm-project/pull/121802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Arm] Regenerate tests (NFC) (PR #121801)

2025-01-14 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Abandon for now, the follow-up patch (https://github.com/llvm/llvm-project/pull/121802) was reduced in scope and does not need to update tests. https://github.com/llvm/llvm-project/pull/121801 ___ cfe-commits mailing list cfe-c

[clang] [llvm] [Arm] Regenerate tests (NFC) (PR #121801)

2025-01-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/121801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64]Make Tuple Size Optional for svluti4_lane Intrinsics (PR #123197)

2025-01-16 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov approved this pull request. https://github.com/llvm/llvm-project/pull/123197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-10 Thread Momchil Velikov via cfe-commits
@@ -650,6 +655,16 @@ def get_triple_from_march(march): print("Cannot find a triple. Assume 'x86'", file=sys.stderr) return "x86" +def get_global_underscores(raw_tool_output): +m = DATA_LAYOUT_RE.search(raw_tool_output) +if not m: +return False +data

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-10 Thread Momchil Velikov via cfe-commits
@@ -122,6 +122,11 @@ def parse_clang_ast_json(node, loc, search): if search is None: search = spell mangled = node.get("mangledName", spell) +# Strip leading underscore from globals, so the name matches the LLVM one momchil-

[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

2025-01-10 Thread Momchil Velikov via cfe-commits
@@ -650,6 +655,16 @@ def get_triple_from_march(march): print("Cannot find a triple. Assume 'x86'", file=sys.stderr) return "x86" +def get_global_underscores(raw_tool_output): +m = DATA_LAYOUT_RE.search(raw_tool_output) +if not m: +return False +data

[clang] [llvm] [Arm] Regenerate tests (NFC) (PR #121801)

2025-01-08 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Another things that "works" is changing the codegen for `__builtin_bit_cast` (https://github.com/llvm/llvm-project/blob/32bc029be6265838833623fdd88cc665d5658dc7/clang/lib/CodeGen/CGExprScalar.cpp#L2295). It stores a value with one type and loads it back with another type w

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: > I believe this fixes #113297, right? Yes. https://github.com/llvm/llvm-project/pull/126945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: That's pretty much how I imagined it too, so I'm happy, but let's see what others think. https://github.com/llvm/llvm-project/pull/126945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -201,6 +205,39 @@ SVE_OPAQUE_TYPE(__SVCount_t, __SVCount_t, SveCount, SveCountTy) SVE_SCALAR_TYPE(__mfp8, __mfp8, MFloat8, MFloat8Ty, 8) +#ifndef NEON_VECTOR_TYPE momchil-velikov wrote: Maybe leave comment these should not end up as `BuiltinType` (unlike

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -1440,11 +1440,19 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, if (Target.hasAArch64SVETypes() || (AuxTarget && AuxTarget->hasAArch64SVETypes())) { -#define SVE_TYPE(Name, Id, SingletonId) \ + #define SVE_VECTOR_TYPE(Name, MangledName, Id, Single

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -203,6 +203,11 @@ void LangOptions::setLangDefaults(LangOptions &Opts, Language Lang, Opts.setDefaultFPContractMode(LangOptions::FPM_Fast); } + if (T.isARM() || T.isAArch64()) { momchil-velikov wrote: extra `{` and empty line https://github.com/ll

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
@@ -57,6 +57,10 @@ // - IsBF true for vector of brain float elements. //===--===// +#ifndef SVE_TYPE momchil-velikov wrote: I thought of adding this in one of the previous refactorings, in

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov unassigned https://github.com/llvm/llvm-project/pull/126945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AARCH64][Neon] switch to using bitcasts in arm_neon.h where appropriate (PR #127043)

2025-03-28 Thread Momchil Velikov via cfe-commits
@@ -8747,28 +8752,32 @@ Value *CodeGenFunction::EmitCommonNeonBuiltinExpr( return Builder.CreateBitCast(Result, ResultType, NameHint); } -Value *CodeGenFunction::EmitAArch64CompareBuiltinExpr( -Value *Op, llvm::Type *Ty, const CmpInst::Predicate Fp, -const CmpInst::P

[clang] [Clang][AArch64] Add fp8 variants for untyped NEON intrinsics (PR #128019)

2025-04-14 Thread Momchil Velikov via cfe-commits
@@ -5464,6 +5464,15 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, Builder.CreateStore(errorValue, swiftErrorTemp); } +// Mfloat8 type is loaded as scalar type, but is treated as single +// vector type for other operation

[clang] [Clang][AArch64] Add fp8 variants for untyped NEON intrinsics (PR #128019)

2025-05-08 Thread Momchil Velikov via cfe-commits
@@ -5464,6 +5464,15 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, Builder.CreateStore(errorValue, swiftErrorTemp); } +// Mfloat8 type is loaded as scalar type, but is treated as single +// vector type for other operation

<    1   2   3   4   5