Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何使用 MMX 寄存器将符号从 16 位字扩展到 32 位字?我想从存储在 MMX 寄存器中的两个 16 位字中获取两个 32 位符号扩展字。不允许使用 SSE4 指令。
问候
你可以只做一个左移(PSLLD),然后是一个算术右移(PSRAD),例如使用内在函数:
PSLLD
PSRAD
v = _mm_srai_pi32(_mm_slli_pi32(v, 16), 16);
(这是假设您已经在每个 32 位字的低半部分拥有 16 位值。)