Skip to content

Support HFA(float) stack passing. #45780

@sandreenko

Description

@sandreenko

According to C++ tests (build natively on the target machine), HFA(float) requires a 4-byte alignment that contradicts with a standard 8-byte alignment for all structs on arm64.

So when passing Vector3 a, Vector3 b on the stack they take 24 bytes, when on default arm64 it would take 32.
However, for a struct Vector3int {int x; int y; int z; } I see normal 8-byte alignment, so 2 of them are taking 32 bytes on the stack.

This behavior is not explicitly described in Apple docs (Writing ARM64 Code for Apple Platforms), so it would be nice to get a confirmation that it is expected.

The issue requires 3 things:

  • Distinguish HFA(float) from struct when create argInfo and putArgs;

  • Fix code in morph args (fgInitArgInfo) and codegen (genPutArgStk) that uses the assumption that SIMD12 arguments can be always propagated as SIMD16.

  • If we have to support non-rounded putArgs for arm64 apple it could be beneficial for other platforms to use as well, because now we create temporary copies

Metadata

Metadata

Assignees

Labels

arch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-mac-os-xmacOS aka OSX

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions