Skip to content

msvc abi incompatibility: x86 __vectorcall changes rules for returning C++ HFA/HVA classes #63417

@efriedma-quic

Description

@efriedma-quic

Testcase for x86-64 Windows:

#include <immintrin.h>
typedef __m128 V;
struct base { V v; };
struct test : base { test(double); protected: V v2;};
test __vectorcall f(test *x) { return *x; }

https://c.godbolt.org/z/9Wq7nozjM

Clang returns in memory; MSVC returns in XMM0/XMM1. As far as I can tell, the general rule here here is similar to #62223: we skip checking if the returned value is a C++14 aggregate. Unlike the AArch64 issue, this also appears to apply to HFAs.

CC @rnk

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions