Skip to content
  • Akira Hatanaka's avatar
    [mips] Fix definition of mfhi and mflo instructions to read from the whole · 16048332
    Akira Hatanaka authored
    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.
    
    I don't have a test case for this change that reliably reproduces the problem.
    
    llvm-svn: 192119
    16048332
Loading