Microsoft 最近发布了 ARM64 构建工具,作为 Visual Studio 15.9 的一部分。我正在完成 ARM64 的移植。我在多项式乘法方面遇到麻烦。
我遇到的问题是,微软没有提供预期的数据类型,例如poly64_t
,或者像这样的演员vreinterpretq_u64_p128
。另请参阅arm64_neon.h https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/km/crt/arm64_neon.h在 GitHub 上。
这无法编译:
#include <arm64_neon.h>
poly128_t VMULL_P64(const poly64_t a, const poly64_t b)
{
return vmull_p64(a, b);
}
结果:
test.cxx(2): error C4430: missing type specifier - int assumed. Note: C++ does n
ot support default-int
test.cxx(2): error C2146: syntax error: missing ';' before identifier 'VMULL_P64
'
test.cxx(3): error C2143: syntax error: missing ';' before '{'
test.cxx(3): error C2447: '{': missing function header (old-style formal list?)
这也无法编译:
#include <arm64_neon.h>
uint64x2_t VMULL_P64(const uint64_t a, const uint64_t b)
{
return vmull_p64(a, b);
}
And:
test.cxx(4): error C2664: '__n128 neon_pmull_64(__n64,__n64)': cannot convert ar
gument 1 from 'const uint64_t' to '__n64'
test.cxx(4): note: No constructor could take the source type, or constructor ove
rload resolution was ambiguous
我把这些拼凑在一起,但似乎是错误的。尤其是中间__n64
(我无法用一条语句来编译它):
#include <arm64_neon.h>
uint64x2_t VMULL_P64(const uint64_t a, const uint64_t b)
{
__n64 x = {a}, y = {b};
return vmull_p64(x, y);
}
其他内容,如 CRC32、CRC32C、AES、SHA-1 和 SHA-256 均正常工作。
微软打算如何让我们使用ARM64来执行多项式乘法?
(标题在哪里<arm64_neon.h>
来自? ARM很清楚标头是<arm_acle.h>
.)
ARM 在 中提供了以下内容ARM C 语言扩展 2.1 (ACLE) http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ihi0053d/index.html:
poly128_t vmull_p64 (poly64_t, poly64_t);
对双字低位部分执行加宽多项式乘法。
适用于 ARMv8 AArch32 和 AArch64。
poly128_t vmull_high_p64 (poly64x2_t, poly64x2_t);
对双字高位部分执行加宽多项式乘法。
适用于 ARMv8 AArch32 和 AArch64。