如何使用ARM64执行多项式乘法? [英] How to perform polynomial multiplication using ARM64?

查看:372
本文介绍了如何使用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>.)

ARM在

poly128_t vmull_p64 (poly64_t, poly64_t);

对双字低位执行加宽多项式乘法. 在ARMv8 AArch32和AArch64上可用.

Performs widening polynomial multiplication on double-words low part. Available on ARMv8 AArch32 and AArch64.

poly128_t vmull_high_p64 (poly64x2_t, poly64x2_t);

对双字较高的部分执行加宽多项式乘法. 在ARMv8 AArch32和AArch64上可用.

Performs widening polynomial multiplication on double-words high part. Available on ARMv8 AArch32 and AArch64.

推荐答案

Visual C ++ 2017.9(15.9)中的ARM支持仍然十分有限... 2017.9不再具有新功能,因此编译代码将无法工作无需升级到Visual C ++ 2019.

ARM support in Visual C++ 2017.9 (15.9) is still quite limited... 2017.9 won't get new features anymore, so compiling the code won't work without upgrading to Visual C++ 2019.

Visual C ++ 2019为poly64_t添加了类型定义.我正在与来自ARM和Visual Studio开发人员的人员紧密合作,以解决针对32位或64位ARM目标进行编译时遇到的问题.编译器中仍然存在一些需要解决的错误,因此对于生产代码或从Linux和其他类似Unix的系统进行移植不是很好.

Visual C++ 2019 added type definition for poly64_t. I'm working closely with people from ARM and Visual Studio developers to fix issues when compiling for 32-bit or 64-bit ARM targets. There is still some bugs in the compiler that need workarounds so it's not very good for production code, or for porting from Linux and other Unix-like systems.

这篇关于如何使用ARM64执行多项式乘法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆