47 Commits

Author SHA1 Message Date
kobalicek
12f9ca3b32 [doc] Documentation update (chat links) 2025-11-29 09:13:10 +01:00
kobalicek
28295814dd [doc] Documentation and funding update
* Removed github funding links
  * Fixed few documentation links
2025-11-15 10:54:23 +01:00
kobalicek
b56f4176cb Codebase update and improvements, instruction DB update
* Denested src folder to root, renamed testing to asmjit-testing

  * Refactored how headers are included into <asmjit/...> form. This
    is necessary as compilers would never simplify a path once a ..
    appears in include directory - then paths such as ../core/../core
    appeared in asserts, which was ugly

  * Moved support utilities into asmjit/support/... (still included
    by asmjit/core.h for convenience and compatibility)

  * Added CMakePresets.json for making it easy to develop AsmJit

  * Reworked CMakeLists to be shorter and use CMake option(),
    etc... This simplifies it and makes it using more standard
    features

  * ASMJIT_EMBED now creates asmjit_embed INTERFACE library,
    which is accessible via asmjit::asmjit target - this simplifies
    embedding and makes it the same as library targets from a CMake
    perspective

  * Removed ASMJIT_DEPS - this is now provided by cmake target
    aliases - 'asmjit::asmjit' so users should not need this variable

  * Changed meaning of ASMJIT_LIBS - this now contains only AsmJit
    dependencies without asmjit::asmjit target alias. Don't rely on
    ASMJIT_LIBS anymore as it's only used internally

  * Removed ASMJIT_NO_DEPRECATED option - AsmJit is not going
    to provide controllable deprecations in the future

  * Removed ASMJIT_NO_VALIDATION in favor of ASMJIT_NO_INTROSPECTION,
    which now controls query, features, and validation API presence

  * Removed ASMJIT_DIR option - it was never really needed

  * Removed AMX_TRANSPOSE feature from instruction database (X86).
    Intel has removed it as well, so it's a feature that won't
    be siliconized
2025-11-02 22:31:46 +01:00
kobalicek
212832c329 Updated AsmJit README.md 2025-10-05 17:52:40 +02:00
kobalicek
cdc4eacbb1 [abi] Added more functionality to ujit
* Renamed round to round_even
  * Added round_half_up intrinsic
  * Added floating-point mod
  * Added a scalar version of floating-point abs and neg
  * Added a behavior enum to specify how float to int conversion
    handles out-of-range and NaN cases
  * Updated some APX stuff in instruction database
2025-10-05 17:31:24 +02:00
kobalicek
7596c6d035 [abi] AsmJit v1.18 - performance and memory footprint improvements
* Refactored the whole codebase to use snake_case convention to
    name functions and variables, including member variables.
    Class naming is unchanged and each starts with upper-case
    character. The intention of this change is to make the source
    code more readable and consistent across multiple projects
    where AsmJit is currently used.

  * Refactored support.h to make it more shareable across projects.

  * x86::Vec now inherits from UniVec

  * minor changes in JitAllocator and WriteScope in order to make
    the size of WriteScope smaller

  * added ZoneStatistics and Zone::statistics() getter

  * improved x86::EmitHelper to use tables instead of choose() and
    other mechanisms to pick between SSE and AVX instructions

  * Refactored the whole codebase to use snake_case convention for
    for functions names, function parameter names, struct members,
    and variables

  * Added a non-owning asmjit::Span<T> type and use into public API
    to hide the usage of ZoneVector in CodeHolder, Builder, and
    Compiler. Users now only get Span (with data and size), which
    doesn't require users to know about ZoneVector

  * Removed RAWorkId from RATiedReg in favor of RAWorkReg*

  * Removed GEN from LiveInfo as it's not needed by CFG construction
    to save memory (GEN was merged with LIVE-IN bits). The remaining
    LIVE-IN, LIVE-OUT, and KILL bits are enough, however KILL bits may
    be removed in the future as KILL bits are not needed after LIVE-IN
    and LIVE-OUT converged

  * Optimized the representation of LIVE-IN, LIVE-OUT, and KILL bits
    per block. Now only registers that live across multiple basic
    blocks are included here, which means that virtual registers that
    only live in a single block are not included and won't be overhead
    during liveness analysis. This optimization alone can make liveness
    analysis 90% faster depending on the code generated (more virtual
    registers that only live in a single basic block -> more gains)

  * Optimized building liveness information bits per block. The new
    code uses an optimized algorithm to prevent too many traversals
    and uses a more optimized code for a case in which not too many
    registers are used (it avoids array operations if the number of
    all virtual registers within the function fits a single BitWord)

  * Optimized code that computes which virtual register is only used
    in a single basic block - this aims to optimize register allocator
    in the future by using a designed code path for allocating regs
    only used in a single basic block

  * Reduced the information required for each live-span, which is used
    by bin-packing. Now the struct is 8 bytes, which is good for a lot
    of optimizations C++ compiler can do

  * Added UniCompiler (ujit) which can be used to share code paths
    between X86, X86_64, and AArch64 code generation (experimental).
2025-09-06 13:44:34 +02:00
kobalicek
03b784c9fe [Doc] Added CONTRIBUTING.md and issue templates; updated docs 2024-01-22 00:25:23 +01:00
kobalicek
5ce45e0356 [ABI] Renamed a64::Vec::ElementType to a64::VecElementType 2023-12-27 13:04:27 +01:00
kobalicek
e4e61c4f15 [ABI] Completely reworked instruction DB and generators
* Instruction database is now part of asmjit to keep it in sync
  * X86/X64 ISA data has been reworked, now in a proper JSON format
  * ARM32 ISA data has been added (currently only DB, support later)
  * ARM64 ISA data has been added
  * ARM features detection has been updated
2023-09-10 09:55:17 +02:00
kobalicek
996deae327 [ABI] Refactored AsmJit to use strong-typed enums, this breaks both API and ABI
[ABI] Added ABI version as an inline namespace, which forms asmjit::_abi_MAJOR_MINOR
[ABI] Added support for AVX512_FP16, 16-bit broadcast, and AVX512_FP16 tests
[ABI] Added initial support for consecutive registers into instruction database and register allocator
[ABI] Added a possibility to use temporary memory in CodeHolder's zone
[ABI] Compiler::setArg() is now deprecated, use FuncNode::setArg()
[Bug] Fixed correct RW information of instructions that only support implicit zeroing with {k}
[Bug] Fixed broadcast to be able to broadcast bcst16 operands
2021-12-13 19:34:56 +01:00
kobalicek
58b6c025f2 [ABI] Added more AVX_VNNI instructions, added MOVABS for explicit Imm64 encodings, added more assembler tests 2021-01-26 01:00:29 +01:00
kobalicek
d7d3db1c4f Updated README.txt and removed a file that is not used anymore 2020-09-16 01:03:38 +02:00
kobalicek
5bc166efdb Updated README.md (Sponsors) 2020-09-12 19:55:16 +02:00
kobalicek
ba30278d66 Added support for more X86 extensions (AMX, AVX512_VP2INTERSECT, MCOMMIT, RDPRU, SERIALIZE, SNP, TSXLDTRK) 2020-07-01 01:07:37 +02:00
kobalicek
f986f7fc44 AsmJit cleanup and refactoring 2020-05-31 23:39:13 +02:00
kobalicek
e78bba83da Added a support for indirect jumps within a function (Compiler) (#286) 2020-05-09 01:00:18 +02:00
kobalicek
80098456b6 Improved CI and enhanced project cosmetics (proper license header and include guards) 2020-05-03 20:06:27 +02:00
kobalicek
9057aa30b6 Improved AsmJit public API to not depend on <windows.h> header 2020-04-29 20:19:17 +02:00
kobalicek
13367b59c2 Removed union{} from asmjit::Operand so it never causes problems with constexpr 2020-04-28 22:23:26 +02:00
kobalicek
ac77dfcd75 Minor changes + fixed x86::Mem constructors to always be explicit 2019-10-25 09:40:26 +02:00
Petr Kobalicek
5d40561d14 Refactored register allocator asm Compiler. (#249)
Refactored build system macros (ASMJIT_BUILD_STATIC -> ASMJIT_STATIC)
Refactored AVX512 broadcast {1toN} - moved to operand from instruction.
Refactored naming - renamed getters to not use get prefix.
Refactored code structure - move arch-specific stuff into x86 namespace.
Refactored some compiler/arch-specific macros, respect rel/abs option in mov REG, [ADDR].
Refactored StringBuilder (Renamed to String, added small string optimization).
Refactored LabelId<->LabelEntry mapping, force label offset to 64-bits on all archs.
Renamed Runtime to Target (JitRuntime kept for now).
Renamed VirtMemManager to JitAllocator.
Renamed VirtMem to JitUtils.
Renamed FuncSignatureX to FuncSignatureBuilder.
Fixed xchg [mem], rex-lo, refactored RelocEntry.
Fixed Logger to always show abs|rel when formatting a memory operand
Fixed Logger to prefix HEX numbers with 0x prefix
Fixed Support::ctzGeneric to always return uint32_t, T doesn't matter.
Fixed LightCall to not save MMX and K registers
Fixed CpuInfo constructor to propagate NoInit (#243)
Added VAES, AVX512_VBMI2, AVX512_VNNI, and AVX512_BITALG cpu-features and instructions.
Added emscripten support (asmjit can be now compiled by emscripten).
Added asmjit.natvis for better MSVC experience
Added x86::ptr_abs|ptr_rel
Added support for multibyte nop r/m (#135)
Added support for 32-bit to 64-bit zero-extended addresses, improved validation of memory addresses, and removed wrt address type as this will be reworked
Added support for multiple sections, reworked address table support (previously known as trampolines)
Added the following x86 modifiers to the x86::Emitter - xacquire(), xrelease(), and k(kreg)
Added a possibility to use REP prefix with RET instruction
Added a possibility to relocate [rel addr] during relocate()
Added a variadic function-call support (Compiler), argument duplication (Compiler), better /dev/shm vs /tmp shared memory handling (VirtMem).
Removed imm_u imm_ptr helpers, imm() can now accept any integer and pointer.
Changed the default behavior of optimizing instructions to disabled with a possibility to enable that feature through kOptionOptimizedForSize
Use default copy construction / assignment to prevent new kind of warnings introduced by GCC 9
2019-07-16 01:24:22 +02:00
kobalicek
761130b1d8 README.md update 2019-05-23 20:36:17 +02:00
kobalicek
1e550aa568 Updated Support section in README.md 2019-01-27 17:58:56 +01:00
kobalicek
2194899168 Updated README.md - Incorporated some changes from PR190 and added a disclaimer about next-wip 2018-11-17 05:13:12 +01:00
Simon Rainer
1370fe6a26 Fixed typos in the Stack Management example (#172) 2017-05-08 15:17:13 +02:00
kobalicek
aa154e3590 Added more instructions (System, MPX, AVX512_VPOPCNTDQ, AVX512_4FMAPS, AVX512_4VNNIW) 2017-02-21 01:55:07 +01:00
kobalicek
0943382a0c Minor changes, fixed a very rare X86Compiler bug in liveness analysis 2017-02-02 00:37:10 +01:00
Petr Kobalicek
b7f6d1e369 Merged asmjit:next branch (#149) 2017-01-26 15:55:03 +01:00
kobalicek
a7d3c757e4 Updated README to inform about the next branch 2016-09-13 00:53:15 +02:00
kobalicek
d25f392c6e Minor code cleanup, fixed 64-bit BMI and BMI2 instructions 2016-06-30 18:59:59 +02:00
kobalicek
4a654c2c49 Fixed bug in PodVectorTmp<> implementation and added a test-case for it. 2016-03-28 02:03:25 +02:00
kobalicek
185a96a46a Reworked CpuInfo (removed X86CpuInfo, added ARM CpuInfo support).
Renamed CodeGen to ExternalTool.
Moved logger constants from asmjit namespace to asmjit::Logger.
Moved AssemblerFeature constants from asmjit namespace to asmjit::Assembler.
Added noexcept to most APIs that are not intended to throw.
Added memory utilities that can read/write to unaligned memory location (ongoing ARM support).
Removed unimplemented instruction scheduler, will be added back when it's working.
2016-03-21 21:41:55 +01:00
kobalicek
d7317987bf Added a link to chat-room to README.md. 2016-03-10 18:01:38 +01:00
kobalicek
b9b1ad6fae Added ASMJIT_NOT_REACHED() to better deal with unreachable code.
Added Visual Studio 2015 scripts and fixed asmjit_test_x86 which now compiles under VS2015
Added StringLogger::getLength()
Added methods to X86Compiler to create a variable operand by its ID
2016-01-02 16:24:54 +01:00
kobalicek
3fcd65cf80 - Moved to cxxtool to generate build.h compiler and platform based definitions.
- Compiler no longer works on its own, it requires Assembler.
- Labels created by Assembler and Compiler now share their IDs, so they can be used nearly interchangeably without weird side-effects and hacks.
- Renamed getError() and setError() to getLastError() and setLastError().
- Renamed compiler nodes to "HL" nodes (preparation for HLStream).
- Renamed FuncConv to CallConv.
- Function calling convention is now part of FuncPrototype.
- Added a possibility to align by inserting zeros (kAlignZero)
- Fixed assertion in X86Compiler that didn't like unhandled function argument(s).
- Added Compiler::embedConstPool() helper, which can be handy if you use your own ConstPool.
- Code refactorization and other minor changes.
- CpuTicks::now() renamed to Utils::getTickCount().
- error.h merged with globals.h
- Documentation updates related to recent API changes.
2015-12-07 07:34:25 +01:00
kobalicek
938691c736 Link update 2015-08-25 12:01:02 +02:00
kobalicek
6061d4b7cf Trigger travis-ci. 2015-07-02 23:40:39 +02:00
kobalicek
104e857b6c README update. 2014-07-17 00:46:01 +02:00
kobalicek
895d33d465 Documentation fixes. 2014-07-15 21:31:23 +02:00
kobalicek
fa955663e3 Changed asmjit namespaces, each architecture has now only one namespace for registers / memory operands.
Changed instruction table schema to minimize its size and added use of EFLAGS register (for scheduler).
Changed the rest of intrinsics accepting `void*` to accept `Ptr` instead.
Changed clear()/reset() concept - only `reset()` now exists and accepts a `releaseMemory` argument.
Changed unit tests to use bundled `Broken` framework.
Moved podvector and podlist to base/containers.
Added CMPS, LODS, MOVS, SCAS, STOS instructions.
Added Label::isInitialized() and Var::isInitialized().
Added X86Scheduler stub - preparing for instruction reordering.
Added support for tracing (see ASMJIT_TRACE) to allow consumers to find bugs in AsmJit quicker.
Fixed possible Zone memory leak.
Fixed and improved alloc/spill (added support for home register which asmjit honors from now).
Fixed Assembler `LEA REG, [LABEL]` bug.
Fixed [Mem, Imm] instructions with zero-sized operand to return error instead of emitting garbage.
Fixed minor bug in VMemMgr - always point to a correct hProcess so it can be used properly (#41).
2014-07-12 17:50:35 +02:00
kobalicek
1cb47ce497 Fixed repo name. 2014-05-15 21:34:02 +02:00
kobalicek
1a73e65534 - Minor reorganization of source code (split defs to operand and instruction info).
- Added JECXZ instruction.
- Doxyfile is now in project root.
- Documentation updates.
2014-05-10 21:19:50 +02:00
kobalicekp
c1d4dd1f63 Minor readme changes. 2014-04-28 11:10:42 +02:00
kobalicekp
b76922fde9 Added basic documentation to README.md. 2014-04-24 02:16:45 +02:00
Petr Kobalicek
43eb0f0402 Update README.md 2014-02-02 12:48:15 +01:00
Petr Kobalicek
9668a771e7 Update README.md 2014-02-02 12:44:41 +01:00
kobalicekp
5c7123fbb3 Initial. 2014-02-02 03:17:30 +01:00