Bee*_*ope 3 x86 assembly x86-64 intel cpu-architecture
是否有任何整数2操作数x86-64指令仅将其第一个操作用作目标,而不用作源+目标1或仅源2,并且p0156在Intel Haswell和/或更高版本的CPU上运行?
对mov指令不感兴趣,即mov名称中的任何内容。
例如,BMI1 blsi eax, edx是2操作数,目标为只写,但只能在Skylake的端口1或端口5上执行。
1大多数指令都属于此类,例如,add eax, ebx代表eax = eax + ebx。
2少数2个操作数整数指令仅将其第一个操作数用作源,例如cmp eax, ebx。
以下Python脚本在uops.info XML文件(https://uops.info/xml.html)中搜索此类指令:
#!/usr/bin/python
import xml.etree.ElementTree as ET
import re
def main():
for XMLInstr in ET.parse('instructions.xml').iter('instruction'):
if len(XMLInstr.findall("./operand[@type='reg']")) != 2:
continue
if not any(True for op in XMLInstr.findall("./operand[@type='reg']") if op.attrib.get('w', '0') == '1' and op.attrib.get('r', '0') == '0'):
continue
if any(re.search("\A\d*\*p0156\Z", m.attrib.get('ports', '')) for m in XMLInstr.findall("./architecture/measurement")):
print XMLInstr.attrib['string']
if __name__ == "__main__":
main()
Run Code Online (Sandbox Code Playgroud)
如果我们从结果中排除了所有指令MOV的名称,仍然存在的唯一指令CBW,CWDE和CDQE。但是,这些指令只有隐式操作数,这可能不是您要查找的。
| 归档时间: |
|
| 查看次数: |
123 次 |
| 最近记录: |