aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
8 daysCheck ld* functions for failure (#92)HEADmainChris Jones
All memory read functions (e.g: ld1, ld2, etc...) return a value (either std::nullopt or false) to signal that the memory read failed. Some of these memory read functions were not being checked for failure; fix this by checking these functions for failure.
2024-02-23Support PMULL for 1Q destination vectors (#91)mmc28a
Extend the Neon PMULL instruction to support 1Q destination registers when the CPU feature is supported.
2024-02-15Add support for implicit checks (#86)Chris Jones
Some runtimes make use of implicit checks, where a potentially invalid memory access is performed. If the memory access is invalid then a signal is raised which is then handled by a custom signal handler which decides how to handle the signal, often returning execution to a different function. This patch enables this use case by performing an optional memory access before any actual memory access. This ensures the signal is raised in a fixed location (_vixl_internal_AccessMemory) inside the simulator which allows for signal handlers to determine: 1. That the signal came from inside the simulator (using IsSimulatedMemoryAccess) and can therefore be handled. 2. That simulation can be resumed at a determined location (using GetSignalReturnAddress) by placing that location in the signal handlers ucontext instruction pointer register, thus allowing execution to continue at the next physical instruction. If a signal handler correctly handles a signal raised from inside the simulator then the simulator can return to the main loop to continue simulation at the program counter. If the signal handler needs to return to a different function then it can modify the PC via the existing WritePc function.
2024-02-09Fix some portability and build problems (#89)mmc28a
Remove use of deprecated std::iterator. Fix colordiff use in clang_format script (from jacob.bramley@arm.com). Remove debugger tests from non-simulator builds. Update code coverage record.
2024-02-01Update clang tools to version 11+ (#87)mmc28a
Co-authored-by: Sebastian Nickolls <sebastian.nickolls@arm.com>
2023-12-08Update to C++17 (#82)Chris Jones
Update the default build to use C++17 instead of C++14. This enables usage of C++17 features in VIXL. Note: this removes C++14 as a testing target as use of C++17 features will break building with C++14.
2023-12-08Add a debugger to VIXL simulator (#81)Chris Jones
Add a basic debugger to the VIXL simulator. Once enabled (by default the debugger is disabled) any brk instruction encountered while simulating will cause the interactive debugger to be launched. The debugger supports the following features: - Break - Step - Continue - Printing registers - Toggling tracing - Switching to GDB
2023-09-13Add branch interception to VIXL simulator (#77)Chris Jones
* Add maybe_unused to runtime call arguments Currently runtime calls cannot be done if the function to be called has no parameters because the compiler will give a "unused-but-set-parameter" warning which is treated as an error. Fix this by always using the 'arguments' parameter. Change-Id: I9f4b75ea8b6ae6fe03be33cefa45fa99f5485b7a * Add branch interception to VIXL simulator Simulated AARCH64 code, that is not written in using the macroassembler, can branch (change the simulated PC) to arbitrary function addresses. This works fine if that function is AARCH64 however if that function is a native (x86_64) C++ function then an error (likely SIGILL) will be thrown. To handle this case we need to "intercept" branches to these native (x86_64) C++ functions and instead either perform a runtime call to the function or provide a callback to manually handle the particular case. Add a mechanism to intercept functions as they are branched to within the VIXL simulator. This means that whenever a function X is branched to (e.g: bl X) instead, if provided, a callback function Y is called. If no callback is provided for the interception to function X then a runtime call will be done on function X. Branch interception objects consisting of the function to intercept: X, and an optional callback function Y are stored within the simulator and checked every unconditional branch to register. Change-Id: I874a6fa5b8f0581fe930a7a98f762031bdb2f591
2023-08-15Fixes post-index vector loadstore writeback (#76)Ryan Houdek
2023-06-20Improve SIMD & FP constant materialization (#74)Anton Kirilov
* Fix a code generation issue inside the MacroAssembler::Movi64bitHelper() method that could set the upper 64 bits of a vector register to an incorrect value instead of 0 * Reduce the instructions necessary to materialize a vector constant by 2 when the upper 64 bits are 0, while the lower ones aren't * Restructure the code paths for the immediate forms of FMOV, so that the common case, 0, is handled first
2023-05-09Small optimisation for Assembler::Emit (#71)mmc28a
Inside Emit(), the compiler can't be sure that the pc_ field of the Assembler object doesn't point to itself, so it must be reloaded from the object after the call to memcpy, in order to advance pc_. Emit() is used by all Assembler methods, so optimise it a little by making a local copy of the field.
2023-03-16Add support for CSSC instructions (#69)mmc28a
Add support for CSSC instructions (abs, cnt, ctz, smax, smin, umax, umin) to all components, and refactor some of the code nearby.
2023-03-16Update instruction decoder (#68)mmc28a
Update the decoder to support the latest instructions defined by the architecture and fix tests.
2023-02-24Fix BIC macro assembler definition to be non-commutative (#66)Richard Neill
Without this patch, the macro assembler freely rearranges the registers passed for the BIC instruction to ensure the first source register is the same as the destination register, which it does because the instruction is considered to be commutative. However, the bit-clear instruction is non-commutative as it is the second source register which is negated, and so these should not be simply re-arranged without additional logic. Instead, define Bic to be non-commutative as part of VIXL_SVE_NONCOMM_ARITH_ZPZZ_LIST. Modify the tests for SVE predicated bit-clears accordingly.
2023-01-18Fix pointer authentication modifier source register (#61)mmc28a
Pointer authentication instructions allow the stack pointer as source for the modifier, but simulation was using the zero register instead. Fix this and add a regression test.
2023-01-17Fix register trace involving sp and xzr (#59)mmc28a
Tracing register updates for ldp instructions that use both xzr and sp would not print the updated stack address. This was visible when popping from the stack into xzr, to discard an entry. Fix this and update the trace tests.
2023-01-03Fix incorrect instruction mappings (#58)André Bargull
* Remove left-over 'msr_si_pstate' instruction references * Remove erroneous trailing underscore in instruction names
2022-11-18simulator-aarch64: Fix use of zero register in several SVE load/stores (#47)Mai
In a few SVE load stores, register 31 should be the stack pointer rather than the zero register.
2022-11-16aarch64: Allow testing for the presence of SVE FEAT_EBF16 (#57)Mai
Allows testing the new hwcap for determining SVE support for extended BFloat16 behavior on Linux systems.
2022-11-11Add regression test for movprfx/ext and fix splice (#56)mmc28a
Test the change in c40e2ab0d31b2460537ec10794cb34343da68606 and fix constructive splice similarly.
2022-11-09instructions-aarch64: Handle destructive EXT in CanTakeSVEMovprfx (#55)Mai
The ARM architecture manual states that a destructive SVE EXT instructions might be preceded by a MOVPRFX instruction, and that this is allowed, but that: 1. The MOVPRFX instruction must be unpredicated 2. The MOVPRFX instruction must specify the same destination as the EXT instruction. 3. The destination register cannot refer to any other source operand.
2022-11-02Tidy up System instruction simulation (#54)mmc28a
Refactor VisitSystem so that it uses the forms supplied by the instruction decoder.
2022-10-19logic-aarch64: Fix register clearing bug in extractnarrow (#49)Mai
Fixes a case in the simulator where the upper lanes of the register will be cleared before the narrowing operation occurs. Normally, clearing before hand works... as long as your source and destination are always different. When the source and destination are the same this trounces data that the narrowing operation needs to use.
2022-09-27Fix compilation with Microsoft Visual C++ (#46)Anton Kirilov
Also, fix almost all warnings with the "/W3" setting (default for new command-line projects), and some with "/W4" and "/Wall". The simulator implementation is out of scope because it uses too many POSIX interfaces to be usable (and in fact buildable) on Windows.
2022-09-15Fix disassembly of Neon by-element instructions (#45)mmc28a
The disassembly of Neon by-element instructions, such as fmul, was not decoding register Vm correctly; it can be four or five bits depending on element size. Fix this and add regression tests for all affected instructions.
2022-08-11Merge branch 'main' into mtemteMartyn Capewell
2022-08-11cpu-features: Update OS queryable hwcaps (#43)Mai
* cpu-features: Support hwcap for FEAT_MTE3 * cpu-features: Support hwcap for FEAT_SME * cpu-aarch64: Allow specifying IDRegister field size This will be necessary for testing some SME extensions. Preserves existing behavior by defaulting the field size to 4 bits. * cpu-aarch64: Add skeleton for AA64SMFR0_EL1 This register contains the bulk of the SME extension bitfields. * cpu-features: Support hwcap for FEAT_SME_I16I64 * cpu-features: Support hwcap for FEAT_SME_F64F64 * cpu-features: Support hwcap for FEAT_SME_I8I32 * cpu-features: Support hwcap for FEAT_SME_F16F32 * cpu-features: Support hwcap for FEAT_SME_B16F32 * cpu-features: Support hwcap for FEAT_SME_F32F32 * cpu-features: Support hwcap for FEAT_SME_FA64 * cpu-aarch64: Handle hwcap auxvals separately HWCAP2 makes use of bit 31 and bit 32 which would fall outside the range of what can be handled by one array, so we can split the array into two arrays and combine over them individually. * cpu-features: Support hwcap for FEAT_WFxT * cpu-features: Support hwcap for FEAT_EBF16
2022-08-10Add support for MOPS instructionsMartyn Capewell
The MOPS extension to AArch64 adds support for instructions designed to accelerate functions like memcpy and memset. Implement these in the assembler, disassembler and simulator.
2022-08-04Merge branch 'main' into mteMartyn Capewell
2022-08-03Spelling (#41)Josh Soref
This PR corrects misspellings identified by the check-spelling action. The misspellings have been reported at jsoref@72c5ec8#commitcomment-78705631 * spelling: achieved * spelling: activated * spelling: address * spelling: anonymous * spelling: architecture * spelling: are_consecutive * spelling: assemble * spelling: becoming * spelling: been * spelling: clobbered * spelling: coercion * spelling: condition * spelling: convenience * spelling: correctly * spelling: correspondence * spelling: corresponding * spelling: depend * spelling: dictionary * spelling: emitted * spelling: everything * spelling: excluding * spelling: explicitly * spelling: implementation * spelling: implicitly * spelling: included * spelling: indices * spelling: instruction * spelling: instructions * spelling: labels * spelling: locations * spelling: maximum * spelling: mechanisms * spelling: modifiers * spelling: multiple * spelling: omitted * spelling: one * spelling: overridden * spelling: overwrite * spelling: performed * spelling: predicate * spelling: registers * spelling: reproducible * spelling: separate * spelling: shift * spelling: substitution * spelling: temporary * spelling: test_sve * spelling: the * spelling: threshold * spelling: unconditional * spelling: usually * spelling: variables Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-26[mte] Fix casts for Mac buildsMartyn Capewell
Use C-style casts in place of reinterpret_cast where the conversion may fail.
2022-05-13Simplify disassembler for already decoded mnemonics #5Martyn Capewell
Further simplification of the disassembler using mnemonics provided by the decoder.
2022-05-13Simplify disassembler for already decoded mnemonics #4Martyn Capewell
Further simplification of the disassembler using mnemonics provided by the decoder.
2022-05-13Simplify disassembler for already decoded mnemonics #3Martyn Capewell
Further simplification of the disassembler using mnemonics provided by the decoder.
2022-05-13Simplify disassembler for already decoded mnemonics #2Martyn Capewell
Further simplification of the disassembler using mnemonics provided by the decoder. Also, improve consistency of "unallocated" being reported for those instructions that are undefined.
2022-05-13Simplify disassembler for already decoded mnemonicsMartyn Capewell
The decoder provides its users with a string that contains the mnemonic, and the disassembler already extracts this. Introduce a new function that uses this mnemonic, and apply it to the simplest disassembly cases.
2022-05-13Replace Hash() calls with user-defined literalMartyn Capewell
Where possible, apply the hash-computing user-defined literal ""_h, for clarity and maintainability.
2022-05-11Use statically-initialised std::vectors for decoder dataMartyn Capewell
Replace fixed size arrays with std::vector for static data used by the decoder, and store const references rather than copies in each decoding node.
2022-05-06Replace strings with 2-bit encodings for decoder bit patternsMartyn Capewell
Implement a user-defined literal to store existing decoder bit patterns as binary representations at build time, reducing the amount of static data used.
2022-05-04Index form-to-visitor maps by hashMartyn Capewell
Introduce a user-defined literal that converts a string into its hash, and use it to initialises the keys in form-to-visitor maps.
2022-04-29Remove per-instruction functions and data structuresMartyn Capewell
Improve static code/data size by: 1) Removing the per-instruction visitor functions. The generic Visit() function can be overridden instead to intercept individual instructions, as shown in the existing custom disassembler example. 2) Remove the array of instruction forms. Instead infer the forms from the decoder tree defined by kDecodeMapping. As it's now unused, remove the INSTRUCTION_VISITOR_LIST define too.
2022-04-21[mte] Add cache maintenance operationsMartyn Capewell
Add the EL0 tag-related data cache maintenance operations provided by MTE. Also, tidy up the other CMOs into a map.
2022-04-12[mte] Implement ldg, st2g, stg, stgp, stz2g and stzg (#28)TatWai Chong
2022-03-29Merge branch 'main' into mteMartyn Capewell
2022-03-25A prototype to support memory metadata in the Simulator. (#24)TatWai Chong
MTE is the first-supported target. Add an example to demonstrate how it works.
2022-03-24Fix tracing atomic instructionsMartyn Capewell
Atomic instructions were calling the trace logging with the wrong element size, causing assertion failures when tracing them. Fix this, and add atomic instructions to the trace tests.
2022-03-17Clear upper parts of register in scalar [su]cvtf simulationMartyn Capewell
Scalar SIMD operations that write b, h, s or d registers should set the upper parts of the destination register to zero. Fix the scvtf and ucvtf instructions and add tests for all SISD instructions.
2022-03-09Add explicit IsImmediatePre/PostIndex testsMartyn Capewell
The MemOperand methods IsPreIndex() and IsPostIndex() checked only the addressing mode, leaving the source of the index (immediate or register) ambiguous. Add new versions that explicitly check for an immediate, and update the code to use them.
2022-03-08[mte] Add data processing instructionsMartyn Capewell
Add assembler, disassembler and simulator support for MTE data processing instructions addg, subg, gmi, irg, subp, subps.
2022-02-17aarch64: Allow testing for the presence of FEAT_RPRESlioncash
Allows testing for the presence of increased precision of Reciprocal Estimate and Reciprocal Square Root Estimate from an 8-bit mantissa to a 12-bit mantissa.