[Feature request] "vectorcall"
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
Microsoft introduced a new calling convention named "__vectorcall" some time ago at the behest of game developers in order to reduce the overhead of passing vectors and similar structure into subroutines. The basic details are the same as regular Win64 calling convention (which is based off of Win32's "__fastcall"), but also attempts to vectorise certain record types and pass them in their entirety through a single XMM or YMM register (the latter only if the compiler is configured to optimise for AVX). I propose a function modifier "vectorcall;" that appears after the function header, much like how "stdcall;" and the like are specified.
The main details can be found here: https://msdn.microsoft.com/en-us/library/dn375768.aspx
Suitable for Win32 and Win64, but might require byte alignment support (see issue 0032780).
Steps to reproduce:
N/A
Additional information:
Also listed here: http://wiki.lazarus.freepascal.org/Feature_Ideas#.22vectorcall.3B.22_modifier_for_Win32_and_Win64
This is already possible in some circumstances under Linux, but it was somewhat neglected on Win64 and completely unsupported on Win32 until "vectorcall" was introduced.
Should probably be ignored with a warning if the platform is not Win32 or Win64.