Metadata-Version: 2.4
Name: simdref-llvm-mc
Version: 23.1.4
Summary: The llvm-mc assembler from LLVM (X86, AArch64, RISCV) and the Intel XED decoder as a pip wheel
Keywords: llvm,llvm-mc,assembler,encoding
Author-Email: Marco Barbone <mbarbone@flatironinstitute.org>
License-Expression: Apache-2.0 WITH LLVM-exception
License-File: LICENSE
License-File: licenses/XED-LICENSE
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# simdref-llvm-mc

This package ships the `llvm-mc` assembler from the LLVM project as a pip
wheel. It covers the X86, AArch64 and RISCV targets. It is built from the
official llvm-project source release. The wheel also ships the `xed` decoder
from Intel XED. It turns x86 instruction bytes into the XED iform.

## Install

```
pip install simdref-llvm-mc
```

## Usage

Run the assembler from the command line:

```
simdref-llvm-mc -triple=aarch64 -show-encoding
```

Get the binary path from Python:

```python
import simdref_llvm_mc
simdref_llvm_mc.path()
simdref_llvm_mc.path("xed")
```

Run the XED decoder from the command line. It reads hex bytes on stdin, one
instruction on each line, and prints the iclass, iform and decode facts:

```
simdref-xed
```

The wheel version is the pinned LLVM release, for example `23.1.4`. A rebuild
against the same LLVM release adds `.postN`, for example `23.1.4.post1`.
The file `llvm-version.txt` in the source tree holds the release tag on
line 1 and the sha256 of the source tarball on line 2. The file
`xed-version.txt` pins XED and mbuild with four lines: xed tag, xed
sha256, mbuild tag, mbuild sha256.

## Build from source

```
uv build --wheel
```

The build downloads the pinned tarball and checks its sha256. Set
`LLVM_MC_TARBALL=/path/to/llvm-project-<version>.src.tar.xz` to use a
local copy.

## License

Apache-2.0 WITH LLVM-exception. See `LICENSE`. XED is Apache-2.0. See
`licenses/XED-LICENSE`.
