7876 Commits
Author SHA1 Message Date
Aleksei Nurmukhametov f32ea13c30 Restore assertion for unhandled constants in lVectorValuesAllEqual 2026-04-27 08:45:43 -07:00
claude[bot]andaneshlya 1666ab8788 Fix #3805: Handle ConstantFP with vector type in LLVM trunk
LLVM commit d19e954b83cb made -use-constant-fp-for-fixed-length-splat
the default, causing LLVM to represent fixed-length FP vector splats as
ConstantFP with vector type instead of ConstantDataVector. This caused
ISPC to crash on an assertion in lVectorValuesAllEqual.

Changes:
- Add ConstantFP with vector type handling to lVectorValuesAllEqual
- Replace assertion with conservative return false for unhandled constants
- Add ConstantFP with vector type handling to lExtractFirstVectorElement
- Add regression test for scatter with uniform float values

Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: aneshlya <aneshlya@users.noreply.github.com>
2026-04-27 08:45:43 -07:00
dependabot[bot] 3adbbe783b ci: bump the ga-dependencies group with 2 updates
Bumps the ga-dependencies group with 2 updates: [actions/setup-node](https://github.com/actions/setup-node) and [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action).


Updates `actions/setup-node` from 6.3.0 to 6.4.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/53b83947a5a98c8d113130e565377fae1a50d02f...48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e)

Updates `aquasecurity/trivy-action` from 0.35.0 to 0.36.0
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/57a97c7e7821a5776cebc9bb87c984fa69cba8f1...ed142fd0673e97e23eac54620cfb913e5ce36c25)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 19:46:52 -07:00
Jérôme Richard d65a71ad3d Fix the acos function, make it faster and improve tests
- acos now correctly calls the standard library in double precision
- implement faster versions which are also much more accurate close to 1 (no catastrophic cancellation anymore)
- improve the acos tests so to check more use-case and reduce the error bound
2026-04-23 13:42:47 -07:00
Jérôme Richard 7f2bcf72ba Fix the stdlib default log function and make the fast-math one faster
The new default math-lib log implementation now correctly support special values (as opposed to the previous one):
 - Subnormal numbers
 - Infinities
 - NaNs

This new default implementation also reduces the error from about ~3000 ULP (close to 1, due to a catastrophic cancellation) to <4 ULP.

The fast-math-lib implementation is now significantly faster (although less precise: <30 ULP vs <2 ULP).
2026-04-21 03:43:17 -07:00
dependabot[bot] b0b9070794 ci: bump the ga-dependencies group with 2 updates
Bumps the ga-dependencies group with 2 updates: [actions/github-script](https://github.com/actions/github-script) and [softprops/action-gh-release](https://github.com/softprops/action-gh-release).


Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/ed597411d8f924073f98dfc5c65a23a2325f34cd...3a2844b7e9c422d3c10d287c895573f7108da1b3)

Updates `softprops/action-gh-release` from 2.6.1 to 3.0.0
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/153bb8e04406b158c6c84fc1615b65b24149a1fe...b4309332981a82ec1c5618f44dd2e27cc8bfbfda)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ga-dependencies
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 07:46:10 -07:00
Jérôme Richard cd245c6270 stdlib: massively improve the precision of asin (especially close to 0) and make it faster 2026-04-19 21:08:31 -07:00
claude[bot]andAleksei Nurmukhametov 6e942af3e7 Fix LLVM 23 API compatibility for getInlineParams
LLVM trunk commit removed the two-argument getInlineParams(optLevel, SizeOptLevel)
overload in favor of getInlineParamsFromOptLevel(optLevel). Size optimization
is now handled via function attributes (optsize/minsize) instead of a
pipeline-level SizeOptLevel parameter.

This commit adds version guards to use:
- getInlineParamsFromOptLevel(optLevel) for LLVM 23+
- getInlineParams(optLevel, SizeOptLevel) for LLVM ≤22

Fixes #3790

Co-authored-by: Aleksei Nurmukhametov <nurmukhametov@users.noreply.github.com>
2026-04-14 14:44:19 -07:00
Jérôme Richard 0480754ed3 Implement the hyperbolic functions sinh, cosh, tanh 2026-04-11 21:29:44 -07:00
Arina NeshlyaevaandClaude Opus 4.5 7af581e14b Fix #3779: Add LLVM 23.0 compatibility for IITDescriptor API changes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 21:06:17 -07:00
Jérôme Richard a6c207b2f7 Fix a (minor) cast in tests and a spelling mistake 2026-04-07 09:33:37 -07:00
Jérôme Richard 5c9f800782 Apply clang-format 2026-04-07 09:33:37 -07:00
Jérôme Richard 70967e70e4 Add tests for expm1 2026-04-07 09:33:37 -07:00
Jérôme Richard d10bae03f4 Implement the function expm1 2026-04-07 09:33:37 -07:00
Aleksei Nurmukhametov 5c4e7a86cc CI: Allow COLLABORATOR to trigger @claude jobs 2026-04-06 14:41:05 -07:00
Aleksei NurmukhametovandClaude Opus 4.6 499b6f283a Fix #2802: use poison instead of undef for masked load passthrough
When a function has dead varying code (e.g. `uint8 y = x[0]` where y is
unused), ISPC generates a masked load in the `some_on` path. After
optimization, the unused masked load gets reduced by InstCombine to a
select with the passthrough value:

  %res = select <8 x i1> %mask, <8 x i8> %x, <8 x i8> undef

This select flows into a phi node in the common return block:

  %rv = phi <8 x i8> [ %res, %loop ], [ %x, %entry ], [ %x, %some_on ]
  %ret = add <8 x i8> %rv, splat (i8 1)
  ret <8 x i8> %ret

LLVM cannot simplify `select(mask, x, undef)` to `x` because undef
semantics require each use to independently pick an arbitrary value,
so folding would change the possible outcomes. With the phi having
non-identical incoming values, SimplifyCFG cannot merge the blocks,
leaving the mask-checking control flow (vmovmskps/vtestps/cmp/jmp)
in the final assembly as dead weight.

Changing the passthrough from `undef` to `poison` fixes this because
`select(mask, x, poison)` legally simplifies to `x` as poison is
strictly more permissive. This makes all phi incoming values identical
(%x), allowing SimplifyCFG to collapse the three blocks into one and
eliminate the redundant branches entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 14:01:50 -07:00
Antoni Zwolski 3bdfe7a1d6 Add version guard for LLVM 23.0 IITDescriptor API change 2026-04-03 10:09:06 -07:00
dependabot[bot] 445680c1de ci: bump the ga-dependencies group with 2 updates
Bumps the ga-dependencies group with 2 updates: [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `dtolnay/rust-toolchain` from efa25f7f19611383d5b0ccf2d1c8914531636bf9 to 3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](https://github.com/dtolnay/rust-toolchain/compare/efa25f7f19611383d5b0ccf2d1c8914531636bf9...3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9)

Updates `github/codeql-action` from 4.34.1 to 4.35.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/38697555549f1db7851b81482ff19f1fa5c4fedc...c10b8064de6f491fea524254123dbe5e09572f13)

---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
  dependency-version: 3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
  dependency-type: direct:production
  dependency-group: ga-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.35.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-02 08:44:00 -07:00
Jérôme Richard a535769e8f Implement the function erfc (#3772) 2026-04-01 15:27:33 -07:00
Jérôme Richard 0d4f794ddf Implement single precision erf (#3769)
* Implement the function erf (WIP)

* Significantly improve the precision of the AS approx

* Fix NaNs issues, improve the precision of all implementations, and provide a real/tested error bound

* Significantly more precise fast-math-lib implementation

* Clang format

* Fix tests (exp wrongly called instead of erf)

* Fix the last year in copyright headers

* Force erf(x) to be exactly 1.0 for abs(x)>=4 in the default implementation

* Fix also the double-precision test (erf vs exp)
2026-03-30 21:25:20 +00:00
dependabot[bot] afe668893c ci: bump the ga-dependencies group with 3 updates
Bumps the ga-dependencies group with 3 updates: [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild), [nick-fields/retry](https://github.com/nick-fields/retry) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `microsoft/setup-msbuild` from 2.0.0 to 3.0.0
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce...30375c66a4eea26614e0d39710365f22f8b0af57)

Updates `nick-fields/retry` from 3.0.2 to 4.0.0
- [Release notes](https://github.com/nick-fields/retry/releases)
- [Commits](https://github.com/nick-fields/retry/compare/ce71cc2ab81d554ebbe88c79ab5975992d79ba08...ad984534de44a9489a53aefd81eb77f87c70dc60)

Updates `github/codeql-action` from 4.33.0 to 4.34.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b1bff81932f5cdfc8695c7752dcee935dcd061c8...38697555549f1db7851b81482ff19f1fa5c4fedc)

---
updated-dependencies:
- dependency-name: microsoft/setup-msbuild
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ga-dependencies
- dependency-name: nick-fields/retry
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ga-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.34.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-26 07:08:39 -07:00
claude[bot]andaneshlya e54ff9e990 Fix #3767: Update BranchInst API for LLVM 23.0
LLVM 23.0 deprecated llvm::BranchInst and split it into UncondBrInst
and CondBrInst. This commit updates all 4 call sites with version
guards to maintain backward compatibility with LLVM 18-22.

Changes:
- src/ctx.cpp: Updated 3 call sites (lines 235, 3493, 3509)
  - Unconditional branches now use UncondBrInst::Create
  - Conditional branch uses CondBrInst::Create with reordered arguments
- src/module.cpp: Updated 1 call site (line 2068)
  - Conditional branch uses CondBrInst::Create with reordered arguments
- Updated copyright year to 2026 in src/module.cpp

All changes are guarded with #if ISPC_LLVM_VERSION >= ISPC_LLVM_23_0
to preserve compatibility with earlier LLVM versions.

Co-authored-by: aneshlya <aneshlya@users.noreply.github.com>
2026-03-21 06:46:47 -07:00
dependabot[bot] a27c3660a3 ci: bump the ga-dependencies group with 2 updates
Bumps the ga-dependencies group with 2 updates: [softprops/action-gh-release](https://github.com/softprops/action-gh-release) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `softprops/action-gh-release` from 2.5.0 to 2.6.1
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/a06a81a03ee405af7f2048a818ed3f03bbf83c7b...153bb8e04406b158c6c84fc1615b65b24149a1fe)

Updates `github/codeql-action` from 4.32.0 to 4.33.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b20883b0cd1f46c72ae0ba6d1090936928f9fa30...b1bff81932f5cdfc8695c7752dcee935dcd061c8)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-18 20:41:06 -07:00
Antoni Zwolski 8bb56215dc ci: replace inline ISPC build steps with reusable workflow 2026-03-18 02:32:47 -07:00
Jérôme Richard 1921a43481 Make fast-math optimizations more aggressive (#3489)
* Make fast-math optimizations more aggressive

* Support the legacy fast-math mode and add 2 new ones (safe + unsafe)

* Better naming for fast-math modes (and remove a TODO)

* Fix the formatting and remove an unused old define

* Fix fast-math tests

* Re-enable reciprocal in the balanced mode and fix/improve tests

* Add a description of the fast-math modes in the help

* Fix tests (limitation to x86 arch + stable arch for all tests) and summary what they do

* Fix tests: regexp fix + split due to MacOS not supporting avx512spr required for native float16 support

* Disable FastMathPass in legacy mode

* Adapt notes about PPC64LE and removes the (now) unnecessary XFAIL

* Add some doc about fast-math modes and the rcp function + update the changelogs

* Clarification of the doc about fast-math modes

* Apply fast-math flags to more instructions (e.g. calls, select, phi, unary ops, etc.)
2026-03-18 04:20:53 +00:00
Antoni Zwolski 484c600892 Update Coverity to run on main and release branches 2026-03-17 15:09:02 -07:00
Trung Lê 2bd1224671 clean up generic target workarounds now that VSX targets exist 2026-03-16 11:27:18 -07:00
Trung Lê c65ebf84cb Skip round-double tests on PPC64 due to LLVM 19 v2f64 froundeven ISel bug 2026-03-16 11:27:18 -07:00
Trung Lê 455f565087 Skip round-float16-varying test on PPC64 due to missing half-precision support 2026-03-16 11:27:18 -07:00
Trung Lê b6d8d0d848 Add missing VSX case in ISAToString() 2026-03-16 11:27:18 -07:00
Trung Lê 0e049b02e7 Switch PPC64 CI from generic-i32x4 to vsx-i32x4
Now that we have dedicated VSX targets, use vsx-i32x4 for functional
tests instead of generic-i32x4, matching how ARM CI uses NEON targets.
2026-03-16 11:27:18 -07:00
Trung Lê 3377acd1d3 Add lit tests for VSX targets
New vsx-target.ispc tests all 6 targets plus the "vsx" alias by
checking vector width in LLVM IR output. Also add a vsx-i32x4 RUN
line to the existing ppc64le-vector-asm test.
2026-03-16 11:27:18 -07:00
Trung Lê e84e4a2d1f Add stub .ll files for VSX targets
Minimal stubs that only define WIDTH, MASK, and ISA macros — just
enough for the builtin system to register them. Actual intrinsic
implementations can be added later, following the same approach used
for NEON (commit 8af7dcf3).
2026-03-16 11:27:18 -07:00
Trung Lê df0443eed4 Teach the build system about VSX targets
Add PPC64_TARGETS list in CMakeLists.txt, define stdlib families for
the 6 VSX targets, handle vsx arch detection in bitcode2cpp.py and
CommonStdlibBuiltins.cmake.
2026-03-16 11:27:18 -07:00
Trung Lê 638eea39b8 Add VSX targets to builtin parent map
Map each VSX target to its corresponding generic parent so the
hierarchical builtin linking can resolve symbols through the chain.
2026-03-16 11:27:18 -07:00
Trung Lê a6b4bbf467 Wire up VSX ISA enum and target constructor properties
Hook up the new VSX targets in the compiler core: add VSX to the ISA
enum, define target constructor cases with vector width/alignment/mask
properties matching their generic parents, and add the necessary CPU
mapping, arch detection, and feature string logic.
2026-03-16 11:27:18 -07:00
Trung Lê af9812a264 Add VSX ISPCTarget enum values and string mappings
Add 6 new ISPCTarget enum values for PowerPC VSX targets: vsx_i8x16,
vsx_i8x32, vsx_i16x8, vsx_i16x16, vsx_i32x4, and vsx_i32x8. These
mirror NEON's target set with explicit data type naming.

Includes ParseISPCTarget entries (with "vsx" alias mapping to
vsx_i32x4), ISPCTargetToString cases, static_assert chain updates,
and the ISPCTargetIsVSX() helper function.
2026-03-16 11:27:18 -07:00
dependabot[bot] 37a5ec5406 ci: bump the ga-dependencies group with 2 updates
Bumps the ga-dependencies group with 2 updates: [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) and [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action).


Updates `docker/setup-buildx-action` from 3.12.0 to 4.0.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/8d2750c68a42422c14e847fe6c8ac0403b4cbd6f...4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd)

Updates `aquasecurity/trivy-action` from 0.34.0 to 0.35.0
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/c1824fd6edce30d7ab345a9989de00bbd46ef284...57a97c7e7821a5776cebc9bb87c984fa69cba8f1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ga-dependencies
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 15:09:46 +00:00
dependabot[bot] 8cc6b60d1e ci: bump the ga-dependencies group with 3 updates
Bumps the ga-dependencies group with 3 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact) and [actions/setup-node](https://github.com/actions/setup-node).


Updates `actions/upload-artifact` from 6.0.0 to 7.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/b7c566a772e6b6bfb58ed0dc250532a479d7789f...bbbca2ddaa5d8feaa63e36b76fdaad77386f024f)

Updates `actions/download-artifact` from 7.0.0 to 8.0.0
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/37930b1c2abaa49bbe596cd826c3c89aef350131...70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3)

Updates `actions/setup-node` from 6.2.0 to 6.3.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/6044e13b5dc448c55e2357c09f80417699197238...53b83947a5a98c8d113130e565377fae1a50d02f)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ga-dependencies
- dependency-name: actions/download-artifact
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ga-dependencies
- dependency-name: actions/setup-node
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-05 23:58:52 +00:00
azwolski 3eb04d77e1 Forward the FILE_CHECK_EXECUTABLE override to lit tests
FILE_CHECK_EXECUTABLE can be set at CMake configure time (e.g.,
-DFILE_CHECK_EXECUTABLE=FileCheck-20) to use a custom FileCheck binary.
Previously this value wasn’t passed to lit, so tests always invoked the default
FileCheck and failed if it wasn’t on the PATH.
2026-03-04 21:02:15 +00:00
Aleksei NurmukhametovandClaude Sonnet 4.6 35c8358f83 Claude: add git history check step to fix-gh-issue workflow
Add step 6 to the "Implementing a feature or fixing a bug" workflow in
CLAUDE.md instructing to check git history of changed files after the
fix is implemented, to verify no previously fixed bugs were
re-introduced. Documents git log --oneline, git log -L and git show
as useful commands for this purpose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 20:59:54 +00:00
Antoni Zwolski 7547018ca4 Update Rust toolchain action to use master with stable toolchain 2026-02-24 17:46:39 -08:00
Trung Lê b72df90271 Add Linux ppc64le (PowerPC64) architecture support using generic targets (#3735)
* Add Linux ppc64le (PowerPC64) architecture support using generic targets

Add ppc64le as a new architecture in ISPC, enabling compilation for
POWER8+ (POWER ISA 3.0) processors using the existing generic target
system (generic-i1x4 through generic-i64x4).

Key changes:
- Add Arch::ppc64le enum and parsing/serialization support
- Add CPU_PPC64LE_Generic device type with pwr8 baseline and +vsx features
- Initialize LLVM PowerPC backend when ISPC_PPC64_ENABLED is defined
- Generate ppc64le-linux-gnu triple for the target
- Auto-detect ppc64le host architecture and default to generic-i32x4
- Add PPC64_ENABLED CMake option (OFF by default) with powerpc LLVM component
- Add ppc64le support to builtin generation (GenerateBuiltins.cmake,
  GenericTargets.cmake, bitcode2cpp.py)
- Add PowerPC to LLVM_TARGETS_TO_BUILD in alloy.py and superbuild
- Add lit test infrastructure: PPC64_ENABLED feature flag, PPC64LE_HOST
  detection, and generic-target-ppc64le.ispc test
- Mark 5 tests UNSUPPORTED on PPC64LE_HOST due to known issues:
  gather/scatter assertion, LLVM selection failures, missing rcp stdlib,
  and ABI signext mismatch

Tested on Fedora 43 ppc64le (POWER8+) with LLVM 20: 425 tests passed,
267 unsupported, 3 expectedly failed, 0 failures.

* Add ppc64le to supported architectures in documentation

Update ispc.rst to list ppc64le in supported architectures and add
experimental PowerPC64 support entry to v1.31.0 release notes.

* Add ppc64le support to examples timing utility

Add __powerpc64__ to the architecture guard in timing.h so it uses
gettimeofday-based timing instead of x86 inline assembly (rdtsc/cpuid)
on PowerPC64 hosts.

* Add ppc64le support to example CMake build system

Add ppc64le architecture detection and generic target selection to the
example build system. On ppc64le, examples default to generic-i32x4
target. Also guard x86-specific -m32/-m64 compiler flags to only apply
on x86 architectures.

All 15 CPU examples build and pass on ppc64le.

* Fix generic-target build and ppc64le arch inference for cross-compilation

Fix missing build dependencies for the generic-target CMake OBJECT library:
- Add GENERATED property to generated CPP source files
- Add add_dependencies on generic-target-cpp and generic-stdlib-cpp targets
- Move configure_ispc_obj(generic-target) into add_ispc_slim() so include
  directories are set in both slim and composite binary paths

Fix lGetArchFromTarget to correctly infer ppc64le architecture when
cross-compiling with --cpu=ppc64le on non-PPC hosts. Previously the arch
inference was entirely host-guarded, causing it to fall through to x86_64.

* Address PR review: fix ppc64le triple, add test runner support and asm test

- Fix ppc64le LLVM triple to use canonical 'powerpc64le' prefix instead
  of 'ppc64le' in cmake/GenerateBuiltins.cmake
- Add ppc64le support to scripts/run_tests.py: target config, gcc_arch
  flags, and default target/arch detection for ppc64le hosts
- Add ppc64le-vector-asm.ispc lit test verifying PowerPC VSX vector
  instructions (xvaddsp, xvmulsp) are generated for generic targets

* Revert autoformatted changes

* Document reasons for ppc64le UNSUPPORTED test skips

Add explanatory comments to all lit tests marked UNSUPPORTED on ppc64le:
- stdlib-short-vec-funcs-3: LLVM 20 can't select froundeven for vectors
- stdlib-short-vec-funcs-6: LLVM 20 can't promote atan2/pow/fmod results
  Both are fixed in LLVM 21 (PR llvm/llvm-project#150597)
- fast_math_opt: generic target rcp uses fdiv, failing CHECK_NOFDIV
- num-limits: ABI mismatch for int8/int16 returns between ISPC and clang
- 2169: ISPC assertion in integer divide optimization for generic targets

* Make ppc64le LLVM bug test skips version-conditional

Use 'UNSUPPORTED: PPC64LE_HOST && !LLVM_21_0+' instead of unconditional
'UNSUPPORTED: PPC64LE_HOST' for tests that fail due to LLVM 20 PowerPC
backend bugs fixed in LLVM 21. This automatically re-enables the tests
when ISPC is built with LLVM 21+.

* s/UNSUPPORTED/XFAIL

* Add -mcpu

* Update docs

* Add PPC64 CI workflow with Ubuntu + QEMU for lit tests

* Fix check_isa to guard PPC64LE detection with endianness check

* Re-align with default target

* Revert all changes made to docs/ispc.rst

* Add functional tests to PPC64 CI workflow via QEMU

* Disable ispcrt build in PPC64 CI to avoid TBB dependency

* Install libtbb-dev instead of disabling ispcrt in PPC64 CI

* Disable X86 and ARM targets in PPC64 CI to avoid missing 32-bit headers

* Install gcc-multilib and re-enable all targets in PPC64 CI

* Install python3-dev for examples build in PPC64 CI

* Switch PPC64 CI to Ubuntu 25.10 with native LLVM 20 packages

* Fix LLVM tools package name to llvm-20-tools for Ubuntu 25.10

* Replace gcc-multilib with cross-compilation headers in PPC64 CI

Use libc6-dev-i386-cross and libc6-dev-armhf-cross instead of gcc-multilib
to provide 32-bit headers for builtin compilation. This avoids the package
conflict between gcc-multilib and gcc-powerpc64le-linux-gnu on Ubuntu 25.10.

* Add libstdc++-15-dev for host C++ linking in PPC64 CI

clang++ needs libstdc++-dev to link C++ programs on the host. Previously
gcc-multilib pulled this in as a dependency; now that we use cross packages
instead, we need to install it explicitly.

* Create FileCheck symlink for unversioned lookup in PPC64 CI

Ubuntu 25.10 installs FileCheck as FileCheck-20 (versioned), but ISPC's
CMake FindLLVM.cmake looks for the unversioned name. Create a symlink
to resolve this.

Tested locally: full build + lit tests pass in Ubuntu 25.10 Docker.

* Revert configure_ispc_obj(generic-target) move, no longer needed after #3739

* Fix PPC64 CI: build only PPC64 target, remove unnecessary cross-compilation packages

Disable ARM and x86 targets in the PPC64 CI workflow since they are
not needed and cause build failures due to missing cross-compilation
headers in the container. Also remove libc6-dev-i386-cross and
libc6-dev-armhf-cross packages that were only needed for those targets.

* Fix PPC64 CI: keep X86 enabled for host lit tests, remove build artifacts

Remove -DX86_ENABLED=OFF from the PPC64 CI cmake command since lit tests
use --target=host which detects x86 on the CI runner.

Remove set_source_files_properties and add_dependencies lines from
GenericTargets.cmake that were artifacts of the configure_ispc_obj move
reverted in c1a2b488.

* fix: Fix PPC64LE pipeline

* Add pipeline running on native runner

* Add sudo to apt-get install commands in workflow

* Consolidate pipelines

* Skip miscompiled float16 tests on ppc64le and fix native runner

- Add '// rule: skip on arch=ppc64le' to 54 float16/f16 functional tests
  that fail compilation on ppc64le
- Drop g++-multilib from native runner (unavailable on ppc64le)
- Add -DX86_ENABLED=OFF to native runner cmake to avoid x86 dependencies

* Refactor ppc64le arch inference out of lGetArchFromTarget

Revert lGetArchFromTarget to its original single-parameter signature and
move the cross-compilation arch fix-up for ppc64le to the call site.
This keeps the function focused on target-to-arch mapping and handles
the CPU-based override separately.

* Rename ppc64le CPU identifier to pwr8

Use 'pwr8' instead of 'ppc64le' as the CPU name for the generic PPC64LE
target, aligning the --cpu flag value with the actual LLVM CPU name that
was already being set internally.

* Skip float16 func tests on ppc64le due to missing fp16 support

* Install LLVM 19 packages for native ppc64le CI runner

* fix: clean up

* fix: install libclang-19-dev

* fix: s/generic/pwr8

* func-tests: skip round() varying float tests on ppc64le

LLVM PowerPC backend (POWER8) cannot lower @llvm.roundeven for vector
types (v4f32), which the generic builtin path uses for round(). Skip
these tests on ppc64le until a target-specific implementation is added.

* doc: clean up

* doc: move PowerPC support to new ISPC 1.31.0 section
2026-02-23 21:55:31 +00:00
dependabot[bot] c790edc266 ci: bump aquasecurity/trivy-action in the ga-dependencies group
Bumps the ga-dependencies group with 1 update: [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action).


Updates `aquasecurity/trivy-action` from 0.33.0 to 0.34.0
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/f9424c10c36e288d5fa79bd3dfd1aeb2d6eae808...c1824fd6edce30d7ab345a9989de00bbd46ef284)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.34.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 09:41:23 -08:00
Aleksei NurmukhametovandClaude Sonnet 4.6 12a81c7ad3 Fix #3748: Align varying bool<N> LLVMType with mask representation
The commit f80c6e0c changed I1VecToBoolVec to produce [N x <W x iMASK>]
for bool short-vector comparison results, intending to make varying bool<N>
consistent with scalar varying bool (which uses BoolVectorType = iMASK
internally). However it did not update lGetVectorLLVMType, which still
returned [N x <W x i8>] (storage type) for VectorType::LLVMType() on
varying bool<N>. This mismatch caused "Call parameter type does not match
function signature" when a comparison result was passed directly to a
function expecting bool<N>.

Fix: complete the original intent by removing the !base->IsUniformType()
exception in lGetVectorLLVMType so that LLVMType() for varying bool<N>
returns [N x <W x iMASK>] (consistent with I1VecToBoolVec), while
LLVMStorageType() continues to return [N x <W x i8>]. Update TypeCastExpr
to match: build the output array with LLVMType and use SwitchBoolToMaskType
for bool elements in both the vector-to-vector and scalar-to-vector paths.

This design is now fully symmetric: both scalar varying bool and varying
bool<N> use the target-specific mask type internally (e.g. i32 on AVX2,
i1 on AVX-512) and convert to i8 only at store/load/ABI boundaries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 09:01:04 -08:00
0ebf3899c6 Fix #3742: Make FMA instruction matching flexible in 2334_unroll test
LLVM trunk changed instruction selection for FMA operations in unrolled
loops, now consistently generating vfmadd231ps instead of mixing
vfmadd132ps and vfmadd231ps. All three FMA variants (132/213/231) are
semantically equivalent, differing only in register operand order.

Updated CHECK patterns to use vfmadd{{[0-9]+}}ps regex to match any
FMA variant, making the test robust to LLVM's internal codegen decisions
while still verifying the loop unrolling behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: aneshlya <aneshlya@users.noreply.github.com>
2026-02-18 10:28:36 -08:00
dependabot[bot] 003dfb40c2 ci: bump zizmorcore/zizmor-action in the ga-dependencies group
Bumps the ga-dependencies group with 1 update: [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `zizmorcore/zizmor-action` from 0.4.1 to 0.5.0
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/135698455da5c3b3e55f73f4419e481ab68cdd95...0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ga-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 13:52:25 -08:00
Ivan Kelarev dbdc693011 Prevent oversized data stores in blend operations 2026-02-11 09:45:18 -08:00
Ivan Kelarev 1502593050 Revert "Revert "Fix 3358: Support structures in lIsSafeToBlend""
This reverts commit 559b397216.
2026-02-11 09:45:18 -08:00
Aleksei Nurmukhametov 8a29d04b53 Remove unnecessary dependency of ispc-opt
ispc-opt runs optimization passes on LLVM IR and does not require the
bitcode libraries provided by the builtin target. Previously, it was
linked against builtin primarily to satisfy a target validation check in
the Target constructor that relies on the target registry.
2026-02-09 13:33:21 +00:00