Repository navigation
[recompiler] Emit the A64 SIMD pairwise, across and MUL ops from Sail - #2489
Merged
Merged
Conversation
A field the clause pins is known when sailgen runs, so an if on it keeps one branch: MUL's clause fixes U at 0, and its element loop no longer holds PMUL's polynomial product. Change-Id: I7d2db64d0eb722a0747c7c75d9335c62e948cc4b Signed-off-by: AO55 <AO55@reden-emu.dev>
Elements 2e and 2e + 1 of Vm:Vn are lanes of both registers picked by a mask made when the recompiler runs, as ir_vec.c's unzip does; the 256-bit concatenation is never made. Change-Id: I178d68c5c2f7da921419c0b883ab13c6ca213d18 Signed-off-by: AO55 <AO55@reden-emu.dev>
A loop from 1 that folds each element into a local starting at element 0 is llvm.vector.reduce of every lane, and Reduce of ReduceOp_ADD the same, as ir_vec.c's across() builds them. Change-Id: If22bcfb3afa11b6b8a1365366de6c804e50184a9 Signed-off-by: AO55 <AO55@reden-emu.dev>
MUL, ADDP, SMAXP, SMINP, UMAXP, UMINP, ADDV, SADDLV, UADDLV, SMAXV, SMINV, UMAXV and UMINV on vectors come from their Sail, with the IR ir_vec.c built for them. Change-Id: I7a179c16687550523a14f0cf3d0ec27ac748416f Signed-off-by: AO55 <AO55@reden-emu.dev>
Contributor
Author
|
From Aogo: |
|
Builds of df1a75a, kept until 2027-02-16:
Amberlith v1.0.0: 923 passed, 0 failed, 2 skipped, 0 crashed: every case of the baseline passes |
Reduce is not lowered by name: sailgen reads that Reduce__1 gives one element as it is and else adds what it gives for each half, the elements' sum, and emits the same llvm.vector.reduce.add. Any other function that calls itself is refused. Change-Id: I0d0035d0c90e6c2de9861c77d7288b10855d56d2 Signed-off-by: AF52 <AF52@reden-emu.dev>
DraChimeraVee
force-pushed
the
dravee/recompiler/sail-a64-simd-2
branch
from
November 20, 2026 10:18
c0aea3d to
422774c
Compare
DraChimeraVee
marked this pull request as ready for review
November 20, 2026 12:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The A64 SIMD ops #2468 left written by hand, the pairwise ones, the integer reductions across lanes and MUL, come from their Sail, every choice made by the generator and none in the code it emits.
ifon them keeps one branch when sailgen runs. MUL's clause fixes U at 0, so its element loop no longer reaches PMUL's polynomial product loop. The other ops' IR is the same as before (llvm_sail_ir's report, word by word).Vm:Vn(ADDP, SMAXP, SMINP, UMAXP, UMINP) is a shufflevector of the two registers' lanes, its mask made when the recompiler runs, as ir_vec.c's unzip; the 256-bit concatenation is never made.llvm.vector.reduceover every lane; the start is proved to be element 0 on the Sail's tree, else the loop stays a loop.Reduceis read from its Sail's recursion, not lowered by name (Liz: "Derived from recursion so runtime doesn't pay cost, only generator"): sailgen reads on the tree thatReduce__1gives one element as it is and else calls itself on each half of its bits, walks what joins the two results with the op the decode fixed, and their+is the samellvm.vector.reduce.addof the lanes. A floating-point op, whose result depends on the order, and any other function that calls itself are refused with the name and the line.Testing, on 422774c (c0aea3d before the rebase, the same patches and generated emitters):
sailgen_lanespairs=lanes fold=lanes start=loop fixed=lanes free=loop besides [recompiler] Emit the A64 SIMD integer ops from the Sail as vectors #2468's three,sailgen_halvessum=reduce, and the sixsailgen_refused_halves_*: the halves joined by another op, a value that is not their sum or is it under a condition alone, the same half twice, a base that is not the element, a register written where they are joined.+equal to the lanes' sum in lane order, modulo the element's size, for every shape up to 128 bits: by SAT on the slices of 64 bits and of 128 by 32, as a ring identity on the lanes for 16 of 8 bits and 8 of 16.sailgen_lanesfails when an accumulator's start is not checked; and seven of the reading of the recursion each fail theirsailgen_halvesorsailgen_refused_halves_*test.