Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
milahu opened this issue Mar 11, 2024 · 0 comments
Open

Comments

@milahu
Copy link

milahu commented Mar 11, 2024

im trying to build b606dde 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant