Commit Graph

14 Commits

Author SHA1 Message Date
kobalicek
118ae6ced1 [Bug] Fixed sign and zero extension in Function API (x86)
The problem was that the sign/zero extension was not working with
TypeIds, but it was working with register IDs, when emitted. Thus,
even when TypeId was uint8, for example, the register could be
uint32, so the final instruction emitted was 'movzx eax, eax', for
example, which was wrong.
2024-01-13 14:31:35 +01:00
kobalicek
3772c447ca [ABI] Accumulated API/ABI changes
* Renamed all eq() methods to equals() (consistency) (ABI)
  * Reorganized some X86 instructions in X86 database
  * Properly detect RISC-V CPU at compile time (Environment)
  * Removed CallConvId::kNone in favor of defaulting to kCDecl (ABI)
  * CallConvId::kHost is now alias to CallConvId::kCDecl (ABI)
  * Added FloatABI to Environment to disginguish between softfloat
    and hardfloat
  * Added more AArch64 CPU features and their detection (ABI)
  * Because of CallConvId changes it's now possible to run
    compiler tests on 32-bit ARM (fixes a bug in test cases)
  * Added QEMU to CI build matrix to test different architectures
2024-01-01 20:15:00 +01:00
kobalicek
a465fe71ab [ABI] Reworked FuncSignature 2023-12-27 21:17:45 +01:00
kobalicek
073f6e85e4 [ABI] Improvements to avoid UB and warnings, clean build with MSAN
* Added more clang compilers on CI (CI)
  * Added memory sanitizer to build matrix (CI)
  * Use problem matcher in all builds (CI)
  * Fixed the use of some constructs in tests
  * Fixed warnings about unused functions in tests
  * Fixed warnings about unused variables caused by some build options
  * Fixed tests to be clean with MSAN (zeroing memory filled by JIT code)
  * Removed -Wclass-memaccess (gcc) from ignored warnings
  * Removed -Wconstant-logical-operand (clang) from ignored warnings
  * Removed -Wunnamed-type-template-args (clang) from ignored warnings
  * Reworked InstData and InstExData to not cause UB (ABI break)

Unfortunately the existing InstData and InstExData was not good for static
analysis and in general compilers emitted warnings regarding accessing
InstNode::_opArray. The reason was that InstExNode added one or two
more operands which extended InstData::_opArray, but there was no way to
tell the C++ compiler about this layout.

It has been changed to InstNode having no operands and InstNodeWithOperands
being templatized for the right number of operands. Nodes that need to
inherit InstNode would just inherit InstNodeWithOperands<N>. It works the
same way as before, just the class hierarchy changed a little.
2023-12-26 19:00:00 +01:00
kobalicek
7c10a14d34 Added indirect branch protection to function abstraction
* Adds a new entry to FuncAttributes
  * Adds a new API to FuncFrame
2023-12-19 12:39:55 +01:00
kobalicek
c1019f1642 Improved testing
* Refactored workflows to use a single workflow for both VM and non-VM builds
  * Compiler tests are now able to test compilation of different architectures
2023-03-11 00:31:03 +01:00
kobalicek
052b4430e9 Fixed indirect jumps to a single label (Compiler) (fixes #380) 2022-09-18 10:26:53 +02:00
kobalicek
a4cb51b532 [Bug] Fixed not cloberring YMM|ZMM registers in function calls that preserve only low 128-bits of vector registers 2022-04-10 00:32:57 +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
a4dd0b2d8b [ABI] Build improvements - replaced ASMJIT_BUIlD_X86 with ASMJIT_NO_X86 and other changes... 2021-03-21 14:42:47 +01:00
kobalicek
7836449c30 Added asmjit_test_perf, which replaces asmjit_bench and provides much better performance overview
Removed asmjit_test_opcode (not needed anymore as we have asmjit_test_assembler and asmjit_test_perf)
2021-03-13 23:05:48 +01:00
kobalicek
70e80b18a5 [Bug] Jump annotation to entry block fix 2021-01-02 12:25:17 +01:00
kobalicek
88129d7389 [Bug] Don't unlink immediately when creating anonymous memory file, switch to GH actions (Fixes #312) 2020-11-07 00:02:16 +01:00
kobalicek
cd44f41d9b Preparation for AArch64 support 2020-09-12 18:19:04 +02:00