[clang] [clang][CodeGen][MSVC] Return vector types from methods indirectly (PR #157365)
Henry Baba-Weiss via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 11 18:17:13 PDT 2025
================
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -ffreestanding -emit-llvm %s -o - -triple=i686-pc-windows-msvc \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -ffreestanding -emit-llvm %s -o - -triple=x86_64-pc-windows-msvc \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -ffreestanding -emit-llvm %s -o - -triple=i686-pc-windows-msvc \
+// RUN: -fclang-abi-compat=21 | FileCheck --check-prefixes=CLANG21 %s
+// RUN: %clang_cc1 -ffreestanding -emit-llvm %s -o - -triple=x86_64-pc-windows-msvc \
+// RUN: -fclang-abi-compat=21 | FileCheck --check-prefixes=CLANG21 %s
+
+// To match the MSVC ABI, vector types must be returned indirectly from member
+// functions (as long as they do not use the vectorcall calling convention),
+// but must be returned directly everywhere else.
+
+#include <xmmintrin.h>
----------------
henrybw wrote:
Done. (I was also surprised by MSVC returning vectors directly on ARM64, but that's also why I constrained this behavior to only apply to x86/x86-64 targets.)
https://github.com/llvm/llvm-project/pull/157365
More information about the cfe-commits
mailing list