Shift指令仅接受8位位移或其他MMX寄存器来容纳转变.这意味着您不能使用eax之类的寄存器来完成这项工作.可以尝试,但有时希望与现实世界无关.顺便说一句,请仔细看一下您发布的宏.无论如何,我认为这似乎是不正确的.请考虑您要执行的操作顺序和期望的结果.由于您使用的宏会在您使用的任何时间发出代码,因此您可以尝试(未经测试):TEST macro a, rot; Result := (A shl (64-rot)) xor (A shr rot); MOVQ mm6, a PSLLQ a, 64-rot PSRLQ mm6, rot PXOR a, mm6endmI've been working on something and run into another couple of problems. First off:ROR64 macro a, rot; Result := (A shl (64-rot)) xor (A shr rot); MOV EAX, 64 SUB EAX, rot PSLLQ a, EAX MOVQ mm6, a PSRLQ mm6, rot PXOR a, mm6endmI've been attempting the process using QWords per the last question (I'll probably attempt it with DWords to learn, too). All I have access to on the dev machine I'm using is MMX instructions, so I've been going there. The problem has been handling the values that come from "rot", since I've determined the MMX ops only work on those registers via the errors I get from MASM32. But when I attempt to put "rot" and "64-rot" into a MMX register, I get more errors. How do I resolve this?Also I will need to be adding MMX registers as QWords. I do not see an instruction in the references to do this. Will I need to be splitting those up into the regular registers anyway or pushing them through the FP instructions? 解决方案 MMX is meant for SIMD programming (it was not meant for 64 Bit operation in general).See wikipedia.. "The main usage of the MMX instruction set is based on the concept of packed data types, which means that instead of using the whole register for a single 64-bit integer, two 32-bit integers, four 16-bit integers, or eight 8-bit integers may be processed concurrently."Nowadays it is obsolete because of the SSEx technology.Sorry, but there is no instruction like PADDQ (take a look PADDx) in the specification.The Shift-Instruction only accept 8Bit displacement or an other MMX Register to hold the amount of shifts. This means you cannot use a register like eax to do the job. Nice try but sometimes wishes have nothing to do with the real world.By the way, please take a close look to your posted macro. Anyway, i think it seems not to be correct. Please think about the order of operation you want to do and the result you expect.Because you use a macro which will emit code at any time you use it you can try (untested):TEST macro a, rot; Result := (A shl (64-rot)) xor (A shr rot); MOVQ mm6, a PSLLQ a, 64-rot PSRLQ mm6, rot PXOR a, mm6endm 这篇关于MMX-使用恒定字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-29 07:12