From 5378fee1c36a8d7730812a2eb41c0580ce496de6 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi Date: Tue, 14 Jun 2022 16:04:24 +0300 Subject: [PATCH] SPUAnalyzer.h: Add missing category check functions (#12222) Some instructions were moved into integer category. --- rpcs3/Emu/Cell/SPUAnalyser.h | 50 ++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/Cell/SPUAnalyser.h b/rpcs3/Emu/Cell/SPUAnalyser.h index fa322c242b..e3381f6e75 100644 --- a/rpcs3/Emu/Cell/SPUAnalyser.h +++ b/rpcs3/Emu/Cell/SPUAnalyser.h @@ -68,19 +68,10 @@ struct spu_itype STQA, STQR, // memory_tag last - CBD, // constant_tag first - CBX, - CHD, - CHX, - CWD, - CWX, - CDD, - CDX, - ILH, + ILH, // constant_tag_first ILHU, IL, ILA, - IOHL, FSMBI, // constant_tag last AH, // integer_tag first @@ -107,6 +98,14 @@ struct spu_itype MPYHHA, MPYHHU, MPYHHAU, + CBD, + CHD, + CWD, + CDD, + CBX, + CHX, + CWX, + CDX, CLZ, CNTB, FSMB, @@ -130,6 +129,7 @@ struct spu_itype ORC, ORBI, ORHI, + IOHL, ORI, ORX, XOR, @@ -263,6 +263,36 @@ struct spu_itype { return value >= FMA && value <= FRDS; } + + // Test for memory instruction + friend constexpr bool operator &(type value, memory_tag) + { + return value >= LQD && value <= STQR; + } + + // Test for compare instruction + friend constexpr bool operator &(type value, compare_tag) + { + return value >= CEQB && value <= CLGTI; + } + + // Test for integer instruction + friend constexpr bool operator &(type value, integer_tag) + { + return value >= AH && value <= SHUFB; + } + + // Test for shift or rotate instruction + friend constexpr bool operator &(type value, shiftrot_tag) + { + return value >= SHLH && value <= ROTMAI; + } + + // Test for constant loading instruction + friend constexpr bool operator &(type value, constant_tag) + { + return value >= CBD && value <= FSMBI; + } }; struct spu_iflag