如何使用ARM64执行多项式乘法? [英] How to perform polynomial multiplication using ARM64?
问题描述
Microsoft最近作为Visual Studio 15.9的一部分发布了他们的ARM64构建工具.我正在准备移植到ARM64.我在多项式乘法方面遇到了麻烦.
Microsoft released their ARM64 build tools recently as part of Visual Studio 15.9. I'm finishing a port to ARM64. I'm having trouble with polynomial multiplication.
我遇到的问题是,Microsoft不提供预期的数据类型(例如poly64_t
)或类型转换(例如vreinterpretq_u64_p128
).另请参见 arm64_neon.h
在GitHub上.
The problem I am having is, Microsoft does not provide the expected data types like poly64_t
, or casts like vreinterpretq_u64_p128
. Also see arm64_neon.h
on 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);
}
并且:
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
(我无法用一个语句来编译它):
I cobbled this together but it just seems wrong. Especially the intermediate __n64
(I could not get it to compile with a single statement):
#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)正在正常工作.
The other stuff, like CRC32, CRC32C, AES, SHA-1 and SHA-256 are working as excepted.
Microsoft打算如何让我们使用ARM64执行多项式乘法?
How does Microsoft intend for us to use ARM64 to perform polynomial multiplication?
(头文件<arm64_neon.h>
来自哪里?ARM很清楚头文件是<arm_acle.h>
.)
(And where did the header <arm64_neon.h>
come from? ARM is very clear the header is <arm_acle.h>
.)