FEX-Emu / FEX-Emu/FEX

{v,}ptest can be made more efficient with SVE

Open
#4,213 0 comments 0 reactions 0 assignees View on GitHub
JIT Performance
Dominant language
C++
Stars
8k
Forks
351
Avg merge
12h 31m
Merged PRs (30d)
102

Description

{v,}ptest is a bit of a weird family of instructions because it sets ZF and CF depending on if the full mask, or negated mask is all zeroes respectively. This is a bit of a faff with ASIMD since it doesn't match semantically, and AVX just adds even more instructions to it.

With SVE they added the new `CMP` instructions which set both a predicate register and the NZCV flags. This can reduce the number of instructions that {v,}ptest requires by quite a bit.

Likely worth implementing.

Contributor guide

Open the contributing guide

Research direction

The issue names {v,}ptest and the SVE CMP instructions but no files or tests. Start by locating the existing {v,}ptest translation and related SVE instruction handling, then compare their ZF and CF behavior with the stated semantics. Done means the implementation uses the SVE instructions where appropriate and preserves the required flags.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.