From: Petar Jovanovic Date: Sat, 21 Sep 2013 01:47:18 +0000 (+0000) Subject: mips32: protect mips32r2 instructions with a flag X-Git-Tag: svn/VALGRIND_3_9_0^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91db9578ec8309eb9ff5866132950352661ddf19;p=thirdparty%2Fvalgrind.git mips32: protect mips32r2 instructions with a flag Regression issue that came when mips_dirtyhelper_calculate_FCSR was added. Inline assembly with MIPS32r2 instructions needs to be protected by flags that disable it for non-MIPS32r2 platforms such as some Broadcom boards. Fixes the issue: Bugzilla 325124. git-svn-id: svn://svn.valgrind.org/vex/trunk@2773 --- diff --git a/VEX/priv/guest_mips_helpers.c b/VEX/priv/guest_mips_helpers.c index df19d5f70e..c166b4dd81 100644 --- a/VEX/priv/guest_mips_helpers.c +++ b/VEX/priv/guest_mips_helpers.c @@ -1155,63 +1155,65 @@ extern UInt mips_dirtyhelper_calculate_FCSR ( void* gs, UInt fs, flt_op inst ) case CEILWD: ASM_VOLATILE_ROUND(fs, ceil.w.d) break; - case CEILLS: - ASM_VOLATILE_ROUND(fs, ceil.l.s) - break; - case CEILLD: - ASM_VOLATILE_ROUND(fs, ceil.l.d) - break; - case ROUNDLS: - ASM_VOLATILE_ROUND(fs, round.l.s) - break; - case ROUNDLD: - ASM_VOLATILE_ROUND(fs, round.l.d) - break; - case TRUNCLS: - ASM_VOLATILE_ROUND(fs, trunc.l.s) - break; - case TRUNCLD: - ASM_VOLATILE_ROUND(fs, trunc.l.d) - break; case CVTDS: ASM_VOLATILE_ROUND(fs, cvt.d.s) break; case CVTDW: ASM_VOLATILE_ROUND(fs, cvt.d.w) break; - case CVTDL: - ASM_VOLATILE_ROUND(fs, cvt.d.l) - break; case CVTSW: ASM_VOLATILE_ROUND(fs, cvt.s.w) break; case CVTSD: ASM_VOLATILE_ROUND(fs, cvt.s.d) break; - case CVTSL: - ASM_VOLATILE_ROUND(fs, cvt.s.l) - break; case CVTWS: ASM_VOLATILE_ROUND(fs, cvt.w.s) break; case CVTWD: ASM_VOLATILE_ROUND(fs, cvt.w.d) break; + case ROUNDWS: + ASM_VOLATILE_ROUND(fs, round.w.s) + break; +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) + case CEILLS: + ASM_VOLATILE_ROUND(fs, ceil.l.s) + break; + case CEILLD: + ASM_VOLATILE_ROUND(fs, ceil.l.d) + break; + case CVTDL: + ASM_VOLATILE_ROUND(fs, cvt.d.l) + break; case CVTLS: ASM_VOLATILE_ROUND(fs, cvt.l.s) break; case CVTLD: ASM_VOLATILE_ROUND(fs, cvt.l.d) break; + case CVTSL: + ASM_VOLATILE_ROUND(fs, cvt.s.l) + break; case FLOORLS: ASM_VOLATILE_ROUND(fs, floor.l.s) break; case FLOORLD: ASM_VOLATILE_ROUND(fs, floor.l.d) break; - case ROUNDWS: - ASM_VOLATILE_ROUND(fs, round.w.s) + case ROUNDLS: + ASM_VOLATILE_ROUND(fs, round.l.s) break; + case ROUNDLD: + ASM_VOLATILE_ROUND(fs, round.l.d) + break; + case TRUNCLS: + ASM_VOLATILE_ROUND(fs, trunc.l.s) + break; + case TRUNCLD: + ASM_VOLATILE_ROUND(fs, trunc.l.d) + break; +#endif default: vassert(0); break;