From: Harsh Prateek Bora Date: Thu, 10 Oct 2024 05:47:39 +0000 (+0530) Subject: target/ppc: combine multiple ail checks into one X-Git-Tag: v9.2.0-rc0~22^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8bbf0cff8c19f69825a055a8d2a9aa049d23fb85;p=thirdparty%2Fqemu.git target/ppc: combine multiple ail checks into one ppc_excp_apply_ail has multiple if-checks for ail which is un-necessary. Combine them as appropriate. Reviewed-by: Nicholas Piggin Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 2806afd9bda..70daa5076aa 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -324,10 +324,7 @@ static void ppc_excp_apply_ail(PowerPCCPU *cpu, int excp, target_ulong msr, } ail = (env->spr[SPR_LPCR] & LPCR_AIL) >> LPCR_AIL_SHIFT; - if (ail == 0) { - return; - } - if (ail == 1) { + if (ail == 0 || ail == 1) { /* AIL=1 is reserved, treat it like AIL=0 */ return; } @@ -351,10 +348,7 @@ static void ppc_excp_apply_ail(PowerPCCPU *cpu, int excp, target_ulong msr, } else { ail = (env->spr[SPR_LPCR] & LPCR_AIL) >> LPCR_AIL_SHIFT; } - if (ail == 0) { - return; - } - if (ail == 1 || ail == 2) { + if (ail == 0 || ail == 1 || ail == 2) { /* AIL=1 and AIL=2 are reserved, treat them like AIL=0 */ return; }