c++ - 在 x86_64 上非临时加载 32 位和 64 位值的 C/C++ 内在函数?

标签 c++ c assembly intrinsics cpu-cache

在 x86_64 上是否有用于 32 位和 64 位值的非临时加载(即没有缓存的加载,直接来自 DRAM)的 C/C++ 内在函数?

我的编译器是 MSVC++2017 工具集 v141。但欢迎其他编译器的内在函数,以及对底层汇编指令的引用。

最佳答案

在撰写本文时(2017 年 8 月)GP 寄存器没有非时间负载


唯一可用的非时间指令是:

整数域

(v)movntdqa (load) despite the name this instruction moves 128/256/512 bits, aligned on their natural boundary, into xmm/ymm/zmm registers respectively.
(v)movntdq (store) despite the name this instruction moves xmm/ymm/zmm registers into a 128/256/512 bits, aligned on their natural boundary, memory location.

GP 注册

movnti (store) store a 32/64-bit GP register into a DWORD/QWORD in memory.

MMX 寄存器

movntq (store) 将 MMX 寄存器存储到内存中的 QWORD 中。

浮点域

(v)movntpd/s (store) (legacy and VEX encoded) store a xmm/ymm/zmm register into an aligned 128/256/512 bits memory location. Like movntdq but in the FP domain.

(v)movntpd/s (store) (EVEX encoded) store a xmm/ymm/zmm register into an aligned 512 bits memory location clearing the upper unused bits. Like movntdq but in the FP domain.
Intel manuals are contradictory on this

蒙面 Action

(v)maskmovdqu (store) stores the bytes of an xmm register according to the mask in another xmm register.

(v)maskmovq (store) stores the bytes of an MMX register according to the mask in another MMX register.

关于c++ - 在 x86_64 上非临时加载 32 位和 64 位值的 C/C++ 内在函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45622539/

相关文章:

c++ - Qt - QScrollArea - 将添加的小部件对齐到顶部

c++ - 如何在 C++ 中填充 int 和 vector<int> 的映射?

c++ - 使用 QDomDocument 类的 xml 文件中的 Lastchild

c - 如何从函数中的变量获取值并在 C 中的另一个函数中使用它?

c - 下面的 C 代码在 Fedora 上运行,但在 RaspberryPi 1 上运行时出现段错误

C:使用来自单独文件的函数

c++ - 设置boost文件系统

c - 在 MSP430 软件中缩短 2 个不同的端口

assembly - 什么是处理器提示?

c - 为什么我要向堆栈指针添加一个地址?