From ba5aa0c83b60ea14d5923da397b7ec192dd1be68 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 3 Nov 2024 17:13:12 +0100 Subject: [ARM64_DYNAREC] Fixed an issue with native flags and opcode using C Helper that use flags, like rcr and rcl --- src/dynarec/arm64/dynarec_arm64_functions.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/dynarec/arm64/dynarec_arm64_functions.c b/src/dynarec/arm64/dynarec_arm64_functions.c index 84e959ce..1400f977 100644 --- a/src/dynarec/arm64/dynarec_arm64_functions.c +++ b/src/dynarec/arm64/dynarec_arm64_functions.c @@ -871,17 +871,17 @@ static uint8_t getNativeFlagsUsed(dynarec_arm_t* dyn, int start, uint8_t flags) // check if there is a callret barrier if(dyn->insts[ninst].x64.has_callret) return 0; + // check if flags are used, but not the natives ones + if(ninst!=start && dyn->insts[ninst].x64.use_flags) { + if((flag2native(dyn->insts[ninst].x64.use_flags)&~(dyn->insts[ninst].use_nat_flags))&used_flags) + return 0; + } // check if flags are still needed if(!(flag2native(dyn->insts[ninst].x64.need_after)&flags)) return used_flags; // check if flags are destroyed, cancel the use then if(dyn->insts[ninst].nat_flags_op && (start!=ninst)) return 0; - // check if flags are used, but not the natives ones - if(dyn->insts[ninst].x64.use_flags) { - if(flag2native(dyn->insts[ninst].x64.use_flags)&used_flags) - return 0; - } // check if flags are generated without native option if((start!=ninst) && dyn->insts[ninst].x64.gen_flags && (flag2native(dyn->insts[ninst].x64.gen_flags&dyn->insts[ninst].x64.need_after)&used_flags)) { if(used_flags&~flag2native(dyn->insts[ninst].x64.gen_flags&dyn->insts[ninst].x64.need_after)) -- cgit 1.4.1