135 Commits

Author SHA1 Message Date
Duncan Ogilvie 7055a0c54a Change XGETBV architecture modeling to hypercall 2026-04-08 13:20:13 -04:00
William Tan 56eee94851 fix control-flow decoding and restore smoketests
Handle the synthetic fallthrough sentinel in Sleigh control-flow analysis without indexing past the end of the pcode ops vector. Also fix the aarch32 smoketest flag spelling in CI and keep Nix checks enabled on Darwin so the smoketests run consistently across environments.
2026-03-31 12:50:19 -04:00
kyle-elliott-tob 70ec62035c ci: shift LLVM version window from 15-21 to 17-22
Comment out subnormal (0x1) test inputs for fcvtzu/fcvtzs double-to-
64-bit-integer tests on AArch64. LLVM 22 misselects the SIMD form
(fcvtzu d,d) which drops FE_INEXACT on subnormal inputs.
Upstream: llvm/llvm-project#178603

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:49:25 -04:00
Maurice Heumann 70b6127cf8 Only quietize SNaNs in FLD
Non-SNaN values should not be quietized, if the IE bit was previously set.
2026-03-25 10:28:00 -04:00
Duncan Ogilvie 91f04f5eb9 Add a few missing instructions/tests 2026-03-25 09:18:37 -04:00
Duncan Ogilvie 9a1409721c Fix AVX-512 classification for latest XED 2026-03-25 09:18:37 -04:00
Maurice Heumann 962b68b964 Fix zero extension for MOVD semantics with MMX registers 2026-03-11 08:47:08 -04:00
Maurice Heumann 27b38572f9 Fix PSHUFW instruction semantics 2026-03-11 08:37:59 -04:00
Maurice Heumann 20f6e1c544 Add MOVMSKPS instruction semantics (#751) 2026-02-09 23:30:40 -05:00
momo5502 5999b9757f Add SQRTPD semantics 2026-01-05 08:50:22 -05:00
momo5502 df4d60e779 Use __builtin_sqrt instead of using std library functions
__builtin_sqrt is already used in a few other places in the semantics.
This commit just makes this consistent for all sqrt computations.
2026-01-05 08:50:22 -05:00
Petra Peuker d580b27b71 Remove warnings 2025-12-13 15:41:50 -05:00
Petra Peuker b9d4267ce8 Added (v)addsub instructons 2025-12-13 15:41:50 -05:00
Petra Peuker d52517c7a1 Added broadcast instructions 2025-12-13 15:41:50 -05:00
Petra Peuker 170c4df43f Extended vmovddup; Added (v)movshdup and (v)movsldup 2025-12-13 15:41:50 -05:00
Petra Peuker cf17ff6d03 Added (V)PMOVZXx instructions 2025-12-13 15:41:50 -05:00
Petra Peuker dcf93e624f Added (V)PMOVSXx instructions 2025-12-13 15:41:50 -05:00
Petra Peuker a0450170ad Added VxMASKMOVx instructions 2025-12-13 15:41:50 -05:00
Petra Peuker 715b432a5d Added lddqu instructions 2025-12-13 15:41:50 -05:00
Petra Peuker 9814ba62d8 Adapt index calucaltion to previous pattern 2025-12-13 15:41:50 -05:00
Petra Peuker 9934cab3a3 Fixed vphaddp* instructions 2025-12-13 15:41:50 -05:00
Petra Peuker ac78918621 Added some vpadd* and vphadd* instructions 2025-12-13 15:41:50 -05:00
Boris Trifkovic 0915596dea Resolved issues with MOVZX. 2025-12-13 00:32:18 -05:00
Matteo ae9a4e97ef Resolved issues with NOP. 2025-12-11 17:36:07 -05:00
Matteo 36c1d3ced3 Resolved issues with MOVSX and MOVSXD. 2025-12-11 08:00:51 -05:00
wizardengineer 4f08aef71d Added support for FADD 2025-12-02 08:56:55 -05:00
wizardengineer 6e5d3ada68 Resolved issues with MULX 2025-12-02 08:56:55 -05:00
wizardengineer e1d049e9c9 Resolved LZCNT & TZCNT test failed with xed 2025 2025-12-02 08:56:55 -05:00
wizardengineer 0aa74ba2b1 Fix for Test error with latest XED 2025-12-02 08:56:55 -05:00
Duncan Ogilvie f8acc718c9 Remove deprecated LINK_PUBLIC/PRIVATE specifier 2025-11-23 16:30:47 -05:00
Duncan Ogilvie 9a6868a27d Fix X87 lifting on LLVM 18+ 2025-11-05 20:46:01 -05:00
Duncan Ogilvie 1be540eeef Implement FMADD in terms of std::fma 2025-11-05 20:46:01 -05:00
Duncan Ogilvie 6082054723 Fix bug with uninitialized MONITOR variable causing UB 2025-11-05 20:46:01 -05:00
Duncan Ogilvie eba0652f86 Replace cfenv dependency with new remill FPU intrinsics 2025-11-05 20:46:01 -05:00
Duncan Ogilvie ac78aa9dca Switch to standalone sysroot for semantics compilation 2025-11-05 20:46:01 -05:00
Duncan Ogilvie ddef25db7c Add support for LLVM 15-21 2025-11-05 20:46:01 -05:00
Matteo e42ac37294 Fix UBSan error when computing the state field offsets. 2025-11-05 20:46:01 -05:00
cctv130 b6fc70f0f4 CMake: update to C++20, clean up properties, optimize fetch content (#721)
- Enable C++20 on both Windows and Linux
- Remove unnecessary set_property calls to silence LOCATION warnings
- Replace duplicate -fPIC flags with INTERFACE_POSITION_INDEPENDENT_CODE
- Set FETCHCONTENT_BASE_DIR to speed up sleigh and ghidra-fork downloads/builds
- fixed: Does not match the generator used previously: Unix Makefiles,use ninja instead
2025-09-05 17:55:23 -04:00
cctv130 e272b48e84 fix: windows clang build (#719)
* Update settings.cmake

Fix the issue where debugging on Windows in VSCode doesn’t work

* fix: windows clang build

The following flags are not supported in non-MSVC environments
/EHsc /wd4141 /wd4146 /wd4180 /wd4244 /wd4258 /wd4267 /wd4291
/wd4345 /wd4351 /wd4355 /wd4456 /wd4457 /wd4458 /wd4459 /wd4503
/wd4624 /wd4722 /wd4800 /wd4100 /wd4127 /wd4512 /wd4505 /wd4610
/wd4510 /wd4702 /wd4245 /wd4706 /wd4310 /wd4701 /wd4703 /wd4389
/wd4611 /wd4805 /wd4204 /wd4577 /wd4091 /wd4592 /wd4324

Update cmake_minimum_required(VERSION 3.21) to remove CMake warning.
2025-08-18 17:42:31 -04:00
Masashi Yoshimura aa886a2244 Fix AArch64 breakpoint exception handling to use builtin fuctions or BRK instruction. (#714) 2025-05-13 12:47:08 -04:00
Masashi Yoshimura 92d1867d1a Fix the offset of STUR and LDUR of AArch64 instructions. (#708) 2024-05-11 21:49:42 -04:00
2over12 874490a894 Fix placement of 32 bit regs on e500 and populate the low bits of PC on BE (#702)
* be fixes

* decriptive names

* fix tests
2024-02-28 11:16:37 -05:00
2over12 ec76ca4c53 new layout (#696) 2024-01-12 09:18:52 -05:00
William Tan 17cff6b4df SPARC support via Sleigh (#681)
* initial WIP sleigh based SPARC32 arch

* add install option to build script

* fix register names

* fix incorrect index into current_bytes in loadFill implementation

* add didrestore register

* dlog register adding

* ignore categories

* remove decompile_mode from llvm

* fix register mapping for flags

* remove nextpc/npc since it doesn't appear to be used and breaks anvill

* overlay NPC with NEXT_PC

* remove next_pc correctly since it was still breaking stuff

* Don't mark instruction as "invalid" when we can't determine a control
flow category

* fix pcode cfg for calls and branches

* add double registers to sparc state structure

* match up with ghidra register names

* fix missing header

* add starts for blocks after control flow ops to guarentee a block split for a term

* remove sparc64_sleigh, fix initialization order

* lift floating point numbers using ghidra names

---------

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
Co-authored-by: 2over12 <ian.smith@trailofbits.com>
2023-11-10 07:44:27 -05:00
2over12 0183248218 llvm 17 fixes (#688)
* llvm 17 fix

* more instances

* more fixes

* add inline

* bump ci

* bump cxx common

* add 17 case

* bump xcode version

* macos 13

* xcode 15

* bump docker to llvm 17

* change actual matrix value

* opaque pointers are the default now

* actually remove the option

* debug size

* install tree

* fix install

* fix install?

* get tree after

* build dir?

* tree above

* accumulate

* bug?

* try to remove intermediate packaging

* fix opt

* only inline

* give up on function inlining

* llvm 17

* remove debug tasks

* Update scripts/build.sh

Co-authored-by: William Tan <1284324+Ninja3047@users.noreply.github.com>

* Revert "Update scripts/build.sh"

This reverts commit 6c727a539d.

* debug

* try clear out old build

* retest

* try to save more space

* up

* Clear space and don't use cxx-common docker image (#689)

* Clear space and don't use cxx-common docker image

* Run on all PRs

* Fix perms

* Remove some unnecessary apt commands

* Install LLVM version as root

* Allow writing to external target

* Build before running tests

* Install with sudo

* Simplify with container volume mounts

---------

Co-authored-by: William Tan <1284324+Ninja3047@users.noreply.github.com>
Co-authored-by: Eric Kilmer <eric.d.kilmer@gmail.com>
2023-10-12 16:37:45 -04:00
2over12 a6abbb818c Mirror Sleigh's Byte-width Flags (#668)
* add sleigh state

* remove bad include

* add volatile

* dont run tests in docker deploys

* remove ccache

* Revert "remove ccache"

This reverts commit 221b70a1bc.

* Revert "dont run tests in docker deploys"

This reverts commit 72229acd6e.

* disable packaging in dockerfile

* fix block packagingA

* fix syntax
2023-07-10 12:07:42 -04:00
Eric Kilmer 396e228e93 Fix Linux AArch64 compilation for SPARC32 runtime (#674)
* Fix Linux AArch64 compilation for SPARC32 runtime

Issue with conflicting compilation target(s).

Tests fail though.
2023-05-10 18:38:18 -04:00
Eric Kilmer 22b3d4b231 Fix GCC compilation (#672)
* Fix compilation with GCC

Fixes a few errors reported by GCC and not Clang

1. "non-trivial designated initializers not supported"

    - Fixed by adding array entries that were missing initializers and
      reordering

2. "Cannot bind packed field"

    - This fixes arrays missing initializers for some entries. This
      isn't the greatest fix because instead of using a reference, we
      use a pointer, which is basically the same thing, but it is
      checked less strictly. I think a real fix would be to remove the
      'packed' annotations.

* Add GCC to CI
2023-05-09 18:45:01 -04:00
2over12 1831127e62 fix name add runtime 2023-04-30 10:27:38 -04:00
2over12 9303453ffc allow sleigh version 2023-04-30 10:19:47 -04:00