Skip to content

php-in-php: nextafter() JIT via NextafterJitHelper PHP — drop libc LLVM bridge (#1492) #15062

Closed

Description

@PurHur

Category

php-in-php · shrink JIT LLVM

Problem

ext/standard/nextafter.php JIT call() lowers operands then invokes libc nextafter via lookupFunction('nextafter'). VM path already uses VmMath::nextafter() PHP.

php-src reference

  • ext/standard/math.c — PHP_FUNCTION(nextafter)

Repro

wc -l ext/standard/nextafter.php
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter nextafter
'

Scope

Path Work
ext/standard/NextafterJitHelper.php SSOT wrapper around VmMath::nextafter
lib/JIT/Builtin/MathNextafter.php thin JitVmHelperLink bridge
ext/standard/nextafter.php route call() through bridge not libc

Done when

  • JIT/AOT nextafter() uses compiled PHP helper
  • nextafter_basic_jit.phpt green
  • PR lists LLVM/libc lines removed

Refs #9241, #1492

Activity

  1. added
    enhancementNew feature or request
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 2, 2026
  2. PurHur commented on Jul 2, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — batch (issues #15062, #15063) — starting with #15062 (nextafter JIT bridge).

  3. PurHur commented on Jul 2, 2026

    @PurHur
    OwnerAuthor

    Merged via PR #15065.

    Verification:

    • vendor/bin/phpunit --filter NextafterRuntimeShrinkTest — OK (3 tests)
    • vendor/bin/phpunit --filter nextafter — OK (5 tests)
    • make bootstrap-selfhost-vm-driver-execute-probe — OK
    • Removed libc lookupFunction('nextafter') from JIT path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions