在 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, intoxmm/ymm/zmm
registers respectively.
(v)movntdq
(store) despite the name this instruction movesxmm/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 axmm/ymm/zmm
register into an aligned 128/256/512 bits memory location. Likemovntdq
but in the FP domain.
(v)movntpd/s
(store) (EVEX encoded) store axmm/ymm/zmm
register into an aligned 512 bits memory location clearing the upper unused bits. Likemovntdq
but in the FP domain.
Intel manuals are contradictory on this
蒙面 Action
(v)maskmovdqu
(store) stores the bytes of anxmm
register according to the mask in anotherxmm
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/