Opcodes icon indicating copy to clipboard operation
Opcodes copied to clipboard

AttributeError: 'EVEX' object has no attribute 'mm'. Did you mean: 'mmm'?

Open milahu opened this issue 3 months ago • 0 comments

im trying to build b606dded8508b3f0e2deb2a663ceda8467f2566d but the build fails with

  File "/build/source/codegen/x86_64.py", line 1119, in main
    instruction_form_init(code, instruction_form, instruction_subforms,
  File "/build/source/codegen/x86_64.py", line 786, in instruction_form_init
    for (flags, encoding_lambda) in encodings:
  File "/build/source/codegen/x86_64.py", line 785, in <lambda>
    encodings = map(lambda e: generate_encoding_lambda(e, instruction_form.operands), instruction_form.encodings)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/source/codegen/x86_64.py", line 423, in generate_encoding_lambda
    evex_args = ["0b" + format(component.mm, "02b"), "0x%02X" % (component.W << 7 | component.pp | 0b100)]
                               ^^^^^^^^^^^^
AttributeError: 'EVEX' object has no attribute 'mm'. Did you mean: 'mmm'?

i tried to replace type="mm" with type="mmm" in opcodes/x86_64.xml but that gives the error

  File "/build/source/codegen/x86_64.py", line 1117, in main
    code.line("%s %s:" % ("if" if form_index == 0 else "elif", " and ".join(operand_checks)))
                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/source/codegen/x86_64.py", line 1115, in <lambda>
    lambda o: generate_operand_check(o[0], o[1], evex_form=is_avx512),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/source/codegen/x86_64.py", line 209, in generate_operand_check
    assert optype in check_map, "Unknown operand type: " + optype
           ^^^^^^^^^^^^^^^^^^^
AssertionError: Unknown operand type: mmm

i tried to replace self.mmm = None with self.mmm = None; self.mm = None in opcodes/x86_64.py but that gives the error

  File "/build/source/codegen/x86_64.py", line 1119, in main
    instruction_form_init(code, instruction_form, instruction_subforms,
  File "/build/source/codegen/x86_64.py", line 786, in instruction_form_init
    for (flags, encoding_lambda) in encodings:
  File "/build/source/codegen/x86_64.py", line 785, in <lambda>
    encodings = map(lambda e: generate_encoding_lambda(e, instruction_form.operands), instruction_form.encodings)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/source/codegen/x86_64.py", line 423, in generate_encoding_lambda
    evex_args = ["0b" + format(component.mm, "02b"), "0x%02X" % (component.W << 7 | component.pp | 0b100)]
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported format string passed to NoneType.__format__

https://opcodes.readthedocs.io/opcodes.html

mm – the EVEX mm (compressed legacy escape) field. Identical to two low bits of VEX.mmmmm field

mmmm – the MVEX mmmm (compressed legacy escape) field. Identical to two low bits of VEX.m-mmmm field.
mmmmm – the VEX m-mmmm (implied leading opcode bytes) field. In AMD documentation this field is called map_select.

https://sandpile.org/x86/opc_enc.htm

mmm
mmmm
mmmmm

cpuinfo

$ grep -m2 -e "^model name" -e ^flags /proc/cpuinfo
model name      : Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts flush_l1d

milahu avatar Mar 11 '24 08:03 milahu