是__int128_t算术由GCC效仿,甚至与SSE? [英] Is __int128_t arithmetic emulated by GCC, even with SSE?

查看:730
本文介绍了是__int128_t算术由GCC效仿,甚至与SSE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说128位的整数数据类型,如 __ int128_t 通过GCC提供的被模仿,因此缓慢。不过,据我所知,各SSE指令集(SSE,SSE2,...,AVX)推出了128位寄存器至少有一些说明。我不知道非常关注SSE或汇编/机器code,所以我想知道,如果有人可以给我解释一下算术与 __ int128_t 是否仿真或不使用现代版本的GCC。

I've heard that the 128-bit integer data-types like __int128_t provided by GCC are emulated and therefore slow. However, I understand that the various SSE instruction sets (SSE, SSE2, ..., AVX) introduced at least some instructions for 128-bit registers. I don't know very much about SSE or assembly / machine code, so I was wondering if someone could explain to me whether arithmetic with __int128_t is emulated or not using modern versions of GCC.

我问这个的原因是因为我想知道是否是有意义的期望int128_t 不同版本的GCC,这取决于SSE之间的性能在 __很大的差异指令冤大头。

The reason I'm asking this is because I'm wondering if it makes sense to expect big differences in __int128_t performance between different versions of GCC, depending on what SSE instructions are taken advantage of.

那么,是什么 __的部分int128_t 算术由GCC仿真,哪些部分均采用SSE指令执行(如果有的话)?

So, what parts of __int128_t arithmetic are emulated by GCC, and what parts are implemented with SSE instructions (if any)?

推荐答案

我在困惑我的问题是两回事。

I was confusing two different things in my question.

首先,PaulR在评论中解释说:有在SSE或AVX没有128位算术运算(除了位运算)。考虑到这一点,128位的算术,对现代基于x86-64的处理器(例如AMD 10系列或英特尔酷睿架构),以进行仿真。这无关与海湾合作委员会。

Firstly, as PaulR explained in the comments: "There are no 128 bit arithmetic operations in SSE or AVX (apart from bitwise operations)". Considering this, 128-bit arithmetic has to be emulated on modern x86-64 based processors (e.g. AMD Family 10 or Intel Core architecture). This has nothing to do with GCC.

问题的第二部分是128位来自SSE / AVX指令或寄存器GCC利益与否算法仿真。正如PaulR的评论暗示,没有太多的SSE / AVX那将让您更轻松地做到128位运算;最有可能的x86-64指令将被用于此目的。在code我感兴趣的是不能用 -mno-SSE 编译,但它编译与 -mno-SSE2 -mno精-sse3 -mno-SSSE3 -mno-SSE4 -mno-SSE4.1 -mno-SSE4.2 -mno-AVX -mno-AVX2 和性能不受影响。所以,我的code没有从现代SSE指令受益。

The second part of the question is whether or not 128-bit arithmetic emulation in GCC benefits from SSE/AVX instructions or registers. As implied in PaulR's comments, there isn't much in SSE/AVX that's going to allow you to do 128-bit arithmetic more easily; most likely x86-64 instructions will be used for this. The code I'm interested in can't compile with -mno-sse, but it compiles fine with -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-avx -mno-avx2 and performance isn't affected. So my code doesn't benefit from modern SSE instructions.

这篇关于是__int128_t算术由GCC效仿,甚至与SSE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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