Commit Graph
39 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 f92340c092 IR: Compute vrot's sine and cosine in one call
A new FSinCos op writes both from one argument reduction. arm64 and x64 get
both back from a single call, packed in one double; RISC-V and LoongArch make
the two calls.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 16:22:41 -06:00
Henrik RydgårdandClaude Opus 5.5 6b78138c08 VFPU: Compile vh2f in the IR, and call vfpu_h2f for it everywhere
vh2f always went to the interpreter in the IR. A new FHalfToFloat op
converts the lower or upper half of a word, and the native backends
call vfpu_h2f for it like FSin. The legacy arm64 JIT now makes the same
call instead of computing the conversion inline; vh2f is rare, and the
call is much less code.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 14:31:22 -06:00
Henrik RydgårdandClaude Opus 5.5 b832ceab83 IR: Add FExp2 and FLog2 for vexp2, vlog2 and vrexp2
These were always interpreted. They're now IR ops that the native
backends compile to calls to vfpu_exp2 and vfpu_log2, like FSin and
FAsin. vrexp2 is FNeg followed by FExp2, which is how vfpu_rexp2
computes it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 13:34:19 -06:00
Henrik RydgårdandClaude Opus 5.5 a2b10778be VFPU: vsqrt, vrsq, vrcp and vnrcp are exact in every backend
These went through the host's sqrt and division everywhere except the
interpreter's vrcp and vnrcp (vsqrt and vrsq there only behind
USE_VFPU_SQRT, now gone). They now always give the PSP's bits: the IR
gets FVSqrt (FSqrt stays the FPU's IEEE sqrt.s), and FRSqrt and FRecip,
which only the VFPU emits, become vfpu_rsqrt and vfpu_rcp; the IR
interpreter and the x64, arm64, RISC-V and LoongArch backends call them.
The old JITs call them directly, the ARM ones keeping the lanes in
callee-saved registers across the calls. cpu/vfpu/exact now passes on every core.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 12:24:42 -06:00
Henrik RydgårdandClaude Fable 5.1 2d14cad065 FPU: sqrt.s of a negative gives the PSP's positive NaN
x86 (SQRTSS and libm alike) returns 0xffc00000 for it, the PSP 0x7fc00000.
-0 stays -0 and a NaN input comes through as it is, so only a negative
input needs the sign cleared: a compare and an xor in the x64 JITs, a
branch in the interpreters. cpu/fpu/roundmode.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 14:25:41 -06:00
Henrik RydgårdandClaude Fable 5.1 7d69ba76f2 x64 IR JIT: fix vcmp EN/NN, NI and TR
EN/NN compared the source against an uninitialized temp, usually the
previous lane's all-ones mask (a NaN), so every lane came out as NaN. NI
used a less-than compare, which is false for a NaN. TR set the bit and
then replaced it with a garbage bit from the temp. Found by
cpu/vfpu/specials.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 14:10:22 -06:00
Henrik RydgårdandClaude Fable 5.1 b16cd9a734 VFPU: vsgn of a denormal is zero
In the interpreter, the IR interpreter, every backend's FSign and the x86
JIT's own vsgn. Recorded in cpu/vfpu/specials.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 14:10:22 -06:00
Henrik RydgårdandClaude Fable 5.1 5e5ecc5389 x64 IR JIT: A NaN in the second operand of vmin/vmax took the fast path
The NaN check compared src1 with itself, so only a NaN in src1 reached
the slow path with the hardware's integer-compare rule. A NaN in src2 went
to MINSS/MAXSS, which just return it. Compare src1 with src2, as the arm64
backend does. Caught by cpu/vfpu/minmax.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 12:49:06 -06:00
Unknown W. Brackets f1a9e39ce9 x86jit: Fix IR vcmp all bit. 2023-10-03 17:46:29 -07:00
Henrik Rydgård 51456980db Merge pull request #18121 from unknownbrackets/jit-ir-profiler
IR: Add mini native jit MIPS block profiler
2023-09-25 09:04:55 +02:00
Unknown W. Brackets 9b2fa46861 IR: Add mini native jit MIPS block profiler. 2023-09-24 23:04:29 -07:00
Unknown W. Brackets 05786f5719 x86jit: Correct spill on IR lane extract. 2023-09-24 19:06:06 -07:00
Henrik Rydgård 1c58617392 Merge pull request #18208 from unknownbrackets/x86-ir-float
x86jit: Speed up float to int conversions
2023-09-24 09:30:00 +02:00
Henrik Rydgård ac3139b8ee Merge pull request #18213 from unknownbrackets/x86-ir-fcmp
IR: Improve fcmp/vfpu compare jit
2023-09-24 09:29:14 +02:00
Unknown W. Brackets 6d41f15f0d x86jit: Implement FSign. 2023-09-23 22:08:17 -07:00
Unknown W. Brackets 24da5a3ba2 irjit: Small simplification to regcache. 2023-09-23 22:00:49 -07:00
Unknown W. Brackets 14e2e1ed62 x64jit: Optimize FCmpVfpuAggregate. 2023-09-23 14:31:46 -07:00
Unknown W. Brackets c5d896a9d7 x86jit: Speed up c.eq.s. 2023-09-23 14:31:18 -07:00
Unknown W. Brackets 1c81d47dd4 x86jit: Speed up float to int conversions. 2023-09-23 13:28:58 -07:00
Unknown W. Brackets 97d9a7f07f arm64jit: Implement FCmp. 2023-09-06 00:09:26 -07:00
Henrik Rydgård f6c1493373 Merge pull request #18048 from unknownbrackets/irjit-vec4
IR: Add a pass to keep things in vec4 more
2023-09-02 15:11:06 +02:00
Unknown W. Brackets becad54923 x86jit: Maintain Vec4 on FMov extract. 2023-09-01 22:35:59 -07:00
Unknown W. Brackets c5d0e1d0cc x86jit: Implement float to integer. 2023-09-01 22:31:25 -07:00
Unknown W. Brackets bcac804cc5 x86jit: Fix vsat0 saturate. 2023-08-30 23:07:57 -07:00
Unknown W. Brackets 181adde6f1 x86jit: Implement float saturates. 2023-08-28 23:11:46 -07:00
Unknown W. Brackets c4d13e522b x86jit: Use a literal pool to avoid rip checks. 2023-08-28 23:11:46 -07:00
Unknown W. Brackets eab05e32a7 x86jit: Implement FCvtScaledSW. 2023-08-28 23:11:46 -07:00
Unknown W. Brackets 2b6bd01417 x86jit: Optimize FMul. 2023-08-28 23:11:46 -07:00
Unknown W. Brackets 61a99b4bac x86jit: Implement trig/reciprocals. 2023-08-27 23:24:30 -07:00
Unknown W. Brackets 4b1c809886 x86jit: Implement a few more float ops, shuffle. 2023-08-27 23:24:30 -07:00
Unknown W. Brackets be4fe52796 x86jit: A few more float ops. 2023-08-25 00:01:03 -07:00
Unknown W. Brackets bfb8df8472 x86jit: Implement fneg/abs. 2023-08-25 00:01:02 -07:00
Unknown W. Brackets 2fbdc42a5c x86jit: Reduce code a bit in SETcc paths. 2023-08-25 00:00:35 -07:00
Unknown W. Brackets e2c6011906 x86jit: Implement VFPU Fcmp. 2023-08-23 22:17:55 -07:00
Unknown W. Brackets ef93b7547e x86jit: Add vmin/vmax. 2023-08-23 22:17:55 -07:00
Unknown W. Brackets 931c84f835 x86jit: Implement FCmp. 2023-08-23 22:17:55 -07:00
Unknown W. Brackets 11c40e6889 x86: Implement a few basic float/vec4 ops. 2023-08-22 10:39:46 +02:00
Unknown W. Brackets 521b63dd2b x86jit: Implement FMul. 2023-08-22 10:39:46 +02:00
Unknown W. Brackets 4e3f3860f9 x86jit: Stub out op categories to files. 2023-08-20 22:28:54 -07:00