From 91f4ce12c5ff67da628138f9157d13c7e9e8ab2c Mon Sep 17 00:00:00 2001 From: Elad <18193363+elad335@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:49:55 +0200 Subject: [PATCH] SPU Analyzer: Add pure opcode tag --- rpcs3/Emu/Cell/SPUAnalyser.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rpcs3/Emu/Cell/SPUAnalyser.h b/rpcs3/Emu/Cell/SPUAnalyser.h index a6c788faad..1598551c7d 100644 --- a/rpcs3/Emu/Cell/SPUAnalyser.h +++ b/rpcs3/Emu/Cell/SPUAnalyser.h @@ -13,6 +13,7 @@ struct spu_itype static constexpr struct quadrop_tag{} _quadrop{}; // 4-op Instructions static constexpr struct xfloat_tag{} xfloat{}; // Instructions producing xfloat values static constexpr struct zregmod_tag{} zregmod{}; // Instructions not modifying any GPR + static constexpr struct pure_tag{} pure{}; // Instructions that always produce the same values as long as arguments are equal enum class type : unsigned char { @@ -301,6 +302,12 @@ struct spu_itype { return (value >= HEQ && value <= STQR) || (value >= BR && value <= BIHNZ); } + + // Test for instructions which always produce the same values as long as arguments and immediate values are equal + friend constexpr bool operator &(type value, pure_tag) + { + return (value >= ILH && value <= CLGTI); + } }; using spu_itype_t = spu_itype::type;