An example Python package written in x86-64 assembly.
Project description
# Building Python Extension Modules in Assembly
This repository is a proof-of-concept to demonstrate how you can create a Python Extension in 100% assembly.
Demonstrates:
How to write a Python module in pure assembly
How to write a function in pure assembly and call it from Python with Python objects
How to call the C API to create a PyObject and parse PyTuple (arguments) into raw pointers
How to pass data back into Python
How to register a module from assembly
How to create a method definition in assembly
How to write back to the Python stack using the dynamic module loader
How to package a NASM/Assembly Python extension with distutils
The simple proof-of-concept function takes 2 parameters,
`default >>> import pymult >>> pymult.multiply(2, 4) 8 `
## But, Why?
Just because it can be done.
Also, I want to see if some AVX/AVX2 instructions (high-performance matrix multiplication especially) can be used directly from Python.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pymult-0.0.0-py3.8-macosx-10.9-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51347fc3657d39cbb1800c292788a4959360a726250653cf410134e33995162f |
|
MD5 | 9edf0868f2f71f3ca7fc35ff0ca37c48 |
|
BLAKE2b-256 | 49404bb343dc0ddbd2c3efca58caf550112c0bb69a32b05926eb197442fb32c3 |
Hashes for pymult-0.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0e44636cdddf54d5c306422573fc1a2b97bbaa333ce7fcf2ba3d149aaeec5c3 |
|
MD5 | 03d0c8a78dc161d3e7f9ff0913aa7458 |
|
BLAKE2b-256 | dce315b7f16c065981634c973b83125a0971d774757ba307adca57def048b3a3 |