maratyszcza / opcodes Goto Github PK
View Code? Open in Web Editor NEWDatabase of CPU Opcodes
License: Other
Database of CPU Opcodes
License: Other
VBMI2 consists of many useful instruction , such as VPCOMPRESSB.
Requested for Maratyszcza/PeachPy#52
MOVZX/MOVSX lack instruction names in Golang assembly. X-ref Maratyszcza/PeachPy#58
We're mixing two different formatting techniques in Python here:
def __str__(self):
return "0x%02X".format(self.byte)
This involves a lot of details:
{eh}
syntax (memory forms)Example instructions:
I have been trying to install PeachPy using pip, and got the following error:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 158, in save_modules
yield saved
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 49, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-fc8nrebe/opcodes-0.3.12/setup.py", line 17, in <module>
self.run_command("generate")
File "/tmp/easy_install-fc8nrebe/opcodes-0.3.12/setup.py", line 10, in read_text_file
import os
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3870: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 95, in <module>
"generate": GenerateInstructions,
File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 325, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 446, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 855, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1127, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1139, in obtain
return installer(requirement)
File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 518, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 672, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 698, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 879, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1118, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1104, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 257, in run_setup
raise
File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 170, in save_modules
saved_exc.resume()
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 145, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python3.6/site-packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 158, in save_modules
yield saved
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 49, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-fc8nrebe/opcodes-0.3.12/setup.py", line 17, in <module>
self.run_command("generate")
File "/tmp/easy_install-fc8nrebe/opcodes-0.3.12/setup.py", line 10, in read_text_file
import os
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3870: ordinal not in range(128)
Later I found out this is caused by ’
in the readme.rst
and it has been fixed in 7b1030b, but the PyPI package is not updated to contain this fix.
Is there any plan to update the PyPI package?
Hey! I'm somewhat new to this, but I'm a bit confused digging around in the x86_64.xml
. For example, this instruction
<InstructionForm gas-name="movabsl">
<Operand type="eax" input="false" output="true"/>
<Operand type="moffs32"/>
<Encoding>
<Opcode byte="A1"/>
<DataOffset size="4" value="#1"/>
</Encoding>
</InstructionForm>
which would encode to A1 78 56 34 12
seems to not be valid on x86-64, only on x86.
Am I missing something here?
In x86.py
and x86_64.py
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
Description:
Issue Description:
The current configuration file format in use shows signs of being outdated, potentially hindering the project's adaptability and distancing it from modern Python development practices. To address this, I propose migrating to pyproject.toml
, a widely accepted standard for Python projects introduced by PEP 518 and implemented in Python 3.7. This move aims to ensure our project stays current and well-supported.
Advantages:
Standardization: pyproject.toml
has become a widely accepted standard for Python project configuration. Adopting it will align our project with industry norms, fostering collaboration, and making integration with other tools and frameworks more straightforward.
Future-Proofing: By embracing pyproject.toml
, we future-proof our project, ensuring compatibility with evolving Python standards and best practices. This is crucial for maintaining the project's long-term viability and reducing technical debt.
Historical Background:
The introduction of the pyproject.toml
file was realized through PEP 518, titled "Specifying Minimum Build System Requirements for Python Projects." This PEP was accepted and implemented in Python 3.7, providing a standardized way to specify build system requirements for Python projects, replacing the previous use of setup.py
or setup.cfg
files.
Proposed Steps:
Configuration Migration: Swiftly transition the existing configuration to pyproject.toml
to align with best practices in the Python community.
Documentation Update: Promptly update project documentation to guide users and contributors through the new pyproject.toml
configuration structure.
Testing and Validation: Rigorously test the project's build and dependency management under the new configuration to guarantee a smooth transition without compromising project stability.
Additional Context:
I am willing to actively contribute to this migration process and submit a Pull Request promptly.
Thank you for your attention to this matter.
This isn't a question regarding the functionality of the tool but rather about the generation of the XML files in the first place.
I suppose you didn't write it by hand. Did you grab the information using a PDF miner?
Could you shed some light in the details of the generation procedure?
As a separate topic, how would you generate a similar XML table for ARM instructions?
Thanks for your help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.