Backport r192119 to fix Clang/MIPS reads from whole accumulator instead of HI/LO
commit 243702b9 Author: Akira Hatanaka <ahatanaka@mips.com> Date: Mon Oct 7 18:49:46 2013 +0000 [mips] Fix definition of mfhi and mflo instructions to read from the whole accumulator instead of its sub-registers, $hi and $lo. We need this change to prevent a mflo following a mtlo from reading an unpredictable/undefined value, as shown in the following example: mult $6, $7 // result of $6 * $7 is written to $lo and $hi. mflo $2 // read lower 32-bit result from $lo. mtlo $4 // write to $lo. the content of $hi becomes unpredictable. mfhi $3 // read higher 32-bit from $hi, which has an unpredictable value. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20131007/190249.html Change-Id: I1052bb9b8fa575d29df8e27d9cd837adc57d1189
Loading
Please sign in to comment