From: Petar Jovanovic Date: Fri, 27 Oct 2017 13:10:37 +0000 (+0200) Subject: mips: add support for MSA regs in Memcheck X-Git-Tag: VALGRIND_3_14_0~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4686886774a770acedd80951ebd71a8f834b8f30;p=thirdparty%2Fvalgrind.git mips: add support for MSA regs in Memcheck Add support for MSA registers in Memcheck. Contributed by: Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic. Related BZ issue - #382563. --- diff --git a/memcheck/mc_machine.c b/memcheck/mc_machine.c index 1d57e0c3e0..2f2afada44 100644 --- a/memcheck/mc_machine.c +++ b/memcheck/mc_machine.c @@ -1162,6 +1162,39 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB ) if (o == GOF(LLaddr) && sz == 4) return -1; /* slot unused */ if (o == GOF(LLdata) && sz == 4) return -1; /* slot unused */ + if (o >= GOF(w0) && o+sz <= GOF(w0) + SZB(w0)) return GOF(w0); + if (o >= GOF(w1) && o+sz <= GOF(w1) + SZB(w1)) return GOF(w1); + if (o >= GOF(w2) && o+sz <= GOF(w2) + SZB(w2)) return GOF(w2); + if (o >= GOF(w3) && o+sz <= GOF(w3) + SZB(w3)) return GOF(w3); + if (o >= GOF(w4) && o+sz <= GOF(w4) + SZB(w4)) return GOF(w4); + if (o >= GOF(w5) && o+sz <= GOF(w5) + SZB(w5)) return GOF(w5); + if (o >= GOF(w6) && o+sz <= GOF(w6) + SZB(w6)) return GOF(w6); + if (o >= GOF(w7) && o+sz <= GOF(w7) + SZB(w7)) return GOF(w7); + if (o >= GOF(w8) && o+sz <= GOF(w8) + SZB(w8)) return GOF(w8); + if (o >= GOF(w9) && o+sz <= GOF(w9) + SZB(w9)) return GOF(w9); + if (o >= GOF(w10) && o+sz <= GOF(w10) + SZB(w10)) return GOF(w10); + if (o >= GOF(w11) && o+sz <= GOF(w11) + SZB(w11)) return GOF(w11); + if (o >= GOF(w12) && o+sz <= GOF(w12) + SZB(w12)) return GOF(w12); + if (o >= GOF(w13) && o+sz <= GOF(w13) + SZB(w13)) return GOF(w13); + if (o >= GOF(w14) && o+sz <= GOF(w14) + SZB(w14)) return GOF(w14); + if (o >= GOF(w15) && o+sz <= GOF(w15) + SZB(w15)) return GOF(w15); + if (o >= GOF(w16) && o+sz <= GOF(w16) + SZB(w16)) return GOF(w16); + if (o >= GOF(w17) && o+sz <= GOF(w17) + SZB(w17)) return GOF(w17); + if (o >= GOF(w18) && o+sz <= GOF(w18) + SZB(w18)) return GOF(w18); + if (o >= GOF(w19) && o+sz <= GOF(w19) + SZB(w19)) return GOF(w19); + if (o >= GOF(w20) && o+sz <= GOF(w20) + SZB(w20)) return GOF(w20); + if (o >= GOF(w21) && o+sz <= GOF(w21) + SZB(w21)) return GOF(w21); + if (o >= GOF(w22) && o+sz <= GOF(w22) + SZB(w22)) return GOF(w22); + if (o >= GOF(w23) && o+sz <= GOF(w23) + SZB(w23)) return GOF(w23); + if (o >= GOF(w24) && o+sz <= GOF(w24) + SZB(w24)) return GOF(w24); + if (o >= GOF(w25) && o+sz <= GOF(w25) + SZB(w25)) return GOF(w25); + if (o >= GOF(w26) && o+sz <= GOF(w26) + SZB(w26)) return GOF(w26); + if (o >= GOF(w27) && o+sz <= GOF(w27) + SZB(w27)) return GOF(w27); + if (o >= GOF(w28) && o+sz <= GOF(w28) + SZB(w28)) return GOF(w28); + if (o >= GOF(w29) && o+sz <= GOF(w29) + SZB(w29)) return GOF(w29); + if (o >= GOF(w30) && o+sz <= GOF(w30) + SZB(w30)) return GOF(w30); + if (o >= GOF(w31) && o+sz <= GOF(w31) + SZB(w31)) return GOF(w31); + VG_(printf)("MC_(get_otrack_shadow_offset)(mips)(off=%d,sz=%d)\n", offset,szB); tl_assert(0); @@ -1244,6 +1277,39 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB ) if (o == GOF(LLaddr) && sz == 8) return -1; /* slot unused */ if (o == GOF(LLdata) && sz == 8) return -1; /* slot unused */ + if (o >= GOF(w0) && o+sz <= GOF(w0) + SZB(w0)) return GOF(w0); + if (o >= GOF(w1) && o+sz <= GOF(w1) + SZB(w1)) return GOF(w1); + if (o >= GOF(w2) && o+sz <= GOF(w2) + SZB(w2)) return GOF(w2); + if (o >= GOF(w3) && o+sz <= GOF(w3) + SZB(w3)) return GOF(w3); + if (o >= GOF(w4) && o+sz <= GOF(w4) + SZB(w4)) return GOF(w4); + if (o >= GOF(w5) && o+sz <= GOF(w5) + SZB(w5)) return GOF(w5); + if (o >= GOF(w6) && o+sz <= GOF(w6) + SZB(w6)) return GOF(w6); + if (o >= GOF(w7) && o+sz <= GOF(w7) + SZB(w7)) return GOF(w7); + if (o >= GOF(w8) && o+sz <= GOF(w8) + SZB(w8)) return GOF(w8); + if (o >= GOF(w9) && o+sz <= GOF(w9) + SZB(w9)) return GOF(w9); + if (o >= GOF(w10) && o+sz <= GOF(w10) + SZB(w10)) return GOF(w10); + if (o >= GOF(w11) && o+sz <= GOF(w11) + SZB(w11)) return GOF(w11); + if (o >= GOF(w12) && o+sz <= GOF(w12) + SZB(w12)) return GOF(w12); + if (o >= GOF(w13) && o+sz <= GOF(w13) + SZB(w13)) return GOF(w13); + if (o >= GOF(w14) && o+sz <= GOF(w14) + SZB(w14)) return GOF(w14); + if (o >= GOF(w15) && o+sz <= GOF(w15) + SZB(w15)) return GOF(w15); + if (o >= GOF(w16) && o+sz <= GOF(w16) + SZB(w16)) return GOF(w16); + if (o >= GOF(w17) && o+sz <= GOF(w17) + SZB(w17)) return GOF(w17); + if (o >= GOF(w18) && o+sz <= GOF(w18) + SZB(w18)) return GOF(w18); + if (o >= GOF(w19) && o+sz <= GOF(w19) + SZB(w19)) return GOF(w19); + if (o >= GOF(w20) && o+sz <= GOF(w20) + SZB(w20)) return GOF(w20); + if (o >= GOF(w21) && o+sz <= GOF(w21) + SZB(w21)) return GOF(w21); + if (o >= GOF(w22) && o+sz <= GOF(w22) + SZB(w22)) return GOF(w22); + if (o >= GOF(w23) && o+sz <= GOF(w23) + SZB(w23)) return GOF(w23); + if (o >= GOF(w24) && o+sz <= GOF(w24) + SZB(w24)) return GOF(w24); + if (o >= GOF(w25) && o+sz <= GOF(w25) + SZB(w25)) return GOF(w25); + if (o >= GOF(w26) && o+sz <= GOF(w26) + SZB(w26)) return GOF(w26); + if (o >= GOF(w27) && o+sz <= GOF(w27) + SZB(w27)) return GOF(w27); + if (o >= GOF(w28) && o+sz <= GOF(w28) + SZB(w28)) return GOF(w28); + if (o >= GOF(w29) && o+sz <= GOF(w29) + SZB(w29)) return GOF(w29); + if (o >= GOF(w30) && o+sz <= GOF(w30) + SZB(w30)) return GOF(w30); + if (o >= GOF(w31) && o+sz <= GOF(w31) + SZB(w31)) return GOF(w31); + VG_(printf)("MC_(get_otrack_shadow_offset)(mips)(off=%d,sz=%d)\n", offset,szB); tl_assert(0);