# V6 Release With the `v6` release we added a new update mechanism called `Auto-Sync`. This is a huge step for Capstone, because it allows for easy module updates, easier addition of new architectures, easy features addition and guarantees less faulty disassembly. This release adds a huge amount of new architectures, extensions, bug fixes and quality of life improvements. ## Contributors Almost all the work was sponsored by [RizinOrg](https://rizin.re/). This release would have simply not happened without them. The developers with the biggest contributions were (alphabetically): - `TriCore` - @billow (Sponsored) - `LoongArch` - @jiegec and @FurryAcetylCoA - `Alpha`, `HPPA` - @R33v0LT (Sponsored) - `AArch64`, `ARM`, `Auto-Sync`, `PPC`, `SystemZ`, modernized testing - @Rot127 (Sponsored) - `Mips`, `NanoMips` - @wargio There are also multiple smaller additions - Reviewing all PRs = @kabeor - Architecture module registration - @oleavr - Building of thin binaries for Apple - @rickmark - Python packaging and testing - @twizmwazin, @peace-maker - `RISCV` operand access info - @wxrdnx And of course there were many more improvements done by other contributors, which add to the release just as the ones above. For a full list of all the developers, please see the release page. With all that said, we hope you enjoy the new release! ## Overview For `v6` we _updated_ the following architectures: `ARM`, `AArch64`, `Mips` (adding `NanoMips`!), `SystemZ`, `PPC`. And added support for several more: `TriCore` (already in `v5`), `Alpha`, `HPPA`, `LoongArch`. These updates are significant! While in `v5` the most up-to-date module was based on `LLVM 7`, the refactored modules are based on `LLVM 16` (`ARM`, `PPC`) and `LLVM 18` (the others)! As you can see, `Auto-Sync` solves the long existing problem that Capstone being hard to update. For [`Auto-Sync`-enabled modules](https://github.com/capstone-engine/capstone/issues/2015) this is no longer the case. The update process is no pretty much standardized and, while not yet 100% reproducible, creates consistently better maintainable and precise results. To achieve it, we refactored some LLVM backends, so they emit directly the code we use in Capstone. Additionally, we implemented many scripts, which automate a great number of manual steps during the update. Because most of the update steps are automated now, the architecture modules must fit this update mechanism. Which means they move closer to the original LLVM code. On the flip site it brings many breaking changes. You can find a list below with descriptions and justification. With all the trouble this might bring for you, please keep in mind that this will only occur once for each architecture (when it gets refactored for `Auto-Sync`). In the long term this will guarantee more stability, more correctness, more features and on top of this makes Capstone directly comparable to `llvm-obdjdump`. If you want to check the current state of this endeavor read the [main Auto-Sync issue](https://github.com/capstone-engine/capstone/issues/2015). Moreover, if you decide to update an existing architecture module (apart from already updated ones), it would be very much welcome! If you want to join the effort, please drop us a note in the issue comments, so we can assist. ## Why an Alpha? Because the changes are so vast and we still need more feedback from the community. We had many early adopters who helped enormously to find bugs and report issues up until now. But there are still features missing, modules not refactored, the test coverage below 100% in the relevant paths and `Auto-Sync` not completely done yet. With all the new features we want to have more feedback from users and eyes on the code before calling it "complete". Although, it is an Alpha, it doesn't mean it is not well tested! The testing compared to any other release has increased a lot. Both in quantity, coverage and code quality checks. The Alpha release now allows projects to pin-point their build to a specific commit and use the new features, while allowing us to add missing features still on the list for `v6` Gold. Some of them are: update and add more architectures (including x86), rework DIET build, improve Auto-Sync with reproducible file generation and quality of life features and more. So when the final `v6` release happens, the `Auto-Sync` transformation of Capstone is completely done. For `v7` we can then focus on other big features, like [SAIL](https://github.com/rems-project/sail) based disassembler modules or a new API to support VLIW architectures like Hexagon or E2K. ## New features These features are only supported by `auto-sync`-enabled architectures. **More code quality checks** - `clang-tidy` is now run on all files changed by a PR. - ASAN: All tests are now run with the address sanitizer enabled. This includes checking for leaks. **Instruction formats for PPC, SystemZ, LoongArch** The instruction encoding formats are added for PPC. They are accessible via `cs_ppc->format` (and the equivalently for SystemZ, LoongArch). They do follow loosely the ISA formats of instructions but not quite. Unfortunately, LLVM doesn't group the instruction formats perfectly aligned with the ISA. Nonetheless, we hope this additional information is useful to you. **LoongArch** - Architecture support was added (based on LLVM-18). **HPPA** - Architecture support was added. **Alpha** - Architecture support was added (based on LLVM-3) **AArch64** - Updated to LLVM-18 - Adding new instructions of SME, SVE2 extensions. With it the new `sme` and `pred` operands are added. - System operands are provided with way more detail in separated operand. - The `EXACTFPIMM` operand also sets the `fp` field. **PPC** - Updated to LLVM-16 - The instruction encoding formats are added for PPC. They are accessible via `cs_ppc->format`. They do follow loosely the ISA formats of instructions but not quite. Unfortunately, LLVM doesn't group the instruction formats perfectly aligned with the ISA. Nonetheless, we hope this additional information is useful to you. - Branching information in `cs_ppc->bc` is way more detailed now. - The Paired Single extension was added. **SystemZ** - Updated to LLVM-18 - Operands have now read/write access information - Memory operands have now the address mode specified - Immediate operands have a new `imm_width` field. Storing the bit width if known. - CPU features can be enabled or disabled, grouped by architecture (arch8-arch14). **Mips** - Updated to LLVM-18 - Support added for: `NanoMips`, `microMips32r3`, `microMips32r6`, `Mips16`, `Mips I ISA`, `Mips II ISA`, `Mips32 r2 ISA`, `Mips32 r3 ISA`, `Mips32 r5 ISA`, `Mips32 r6 ISA`, `Mips III ISA`, `Mips IV ISA`, `Mips V ISA`, `Mips64 r2 ISA`, `Mips64 r3 ISA`, `Mips64 r5 ISA`, `Mips64 r6 ISA`, `Octeon (cnMIPS)`, `Octeon+ (cnMIPS+)` - Support for different register naming style (`CS_OPT_SYNTAX_NO_DOLLAR`, `CS_OPT_SYNTAX_NOREGNAME`) - In `capstone.h` new MIPS ISA has been added which can be used by themselves. ``` CS_MODE_MIPS16 = CS_MODE_16, ///< Generic mips16 CS_MODE_MIPS32 = CS_MODE_32, ///< Generic mips32 CS_MODE_MIPS64 = CS_MODE_64, ///< Generic mips64 CS_MODE_MICRO = 1 << 4, ///< microMips CS_MODE_MIPS1 = 1 << 5, ///< Mips I ISA Support CS_MODE_MIPS2 = 1 << 6, ///< Mips II ISA Support CS_MODE_MIPS32R2 = 1 << 7, ///< Mips32r2 ISA Support CS_MODE_MIPS32R3 = 1 << 8, ///< Mips32r3 ISA Support CS_MODE_MIPS32R5 = 1 << 9, ///< Mips32r5 ISA Support CS_MODE_MIPS32R6 = 1 << 10, ///< Mips32r6 ISA Support CS_MODE_MIPS3 = 1 << 11, ///< MIPS III ISA Support CS_MODE_MIPS4 = 1 << 12, ///< MIPS IV ISA Support CS_MODE_MIPS5 = 1 << 13, ///< MIPS V ISA Support CS_MODE_MIPS64R2 = 1 << 14, ///< Mips64r2 ISA Support CS_MODE_MIPS64R3 = 1 << 15, ///< Mips64r3 ISA Support CS_MODE_MIPS64R5 = 1 << 16, ///< Mips64r5 ISA Support CS_MODE_MIPS64R6 = 1 << 17, ///< Mips64r6 ISA Support CS_MODE_OCTEON = 1 << 18, ///< Octeon cnMIPS Support CS_MODE_OCTEONP = 1 << 19, ///< Octeon+ cnMIPS Support CS_MODE_NANOMIPS = 1 << 20, ///< Generic nanomips CS_MODE_NMS1 = ((1 << 21) | CS_MODE_NANOMIPS), ///< nanoMips NMS1 CS_MODE_I7200 = ((1 << 22) | CS_MODE_NANOMIPS), ///< nanoMips I7200 CS_MODE_MICRO32R3 = (CS_MODE_MICRO | CS_MODE_MIPS32R3), ///< microMips32r3 CS_MODE_MICRO32R6 = (CS_MODE_MICRO | CS_MODE_MIPS32R6), ///< microMips32r6 ``` It is also possible to disable floating point support by adding `CS_MODE_MIPS_NOFLOAT`. - **`CS_MODE_MIPS_PTR64` is now required to decode 64-bit pointers**, like jumps and calls (for example: `jal $t0`). **RISCV** - Operands have now read/write access information **Xtensa** - Architecture support was added (based on LLVM-18). - Support for `LITBASE`. Set the `LITBASE` with `cs_option(handle, CS_OPT_LITBASE, litbase_value)`. **BPF** - Added support for eBPF `ATOMIC` class instructions (using Linux mnemonics, not GNU ones. E.g. `acmpxchg64` instead of `axchg`) - Added support for eBPF signed `ALU` class instructions (`sdiv`, `smod`, `movs` variants. E.g. `smod r9, 0xc9d1d20b`) - Added support for eBPF `JMP32` class instructions (E.g. `jslt32 r7, -0xa46e0bd, -0x33f1`) - Updated the syntax for eBPF legacy packet instructions (similar to LLVM mnemonics, not GNU ones (E.g. `ldabsw [skb-0x8]`). `skb` is the socket buffer. - Corrected the signedness interpretation of `immidiate` and `offset` operands **UX** - Instruction alias (see below). - `cstool`: Architecture specific options can now be enabled with `cstool +