| 20 | bool gsIsInterlaced = false; |
| 21 | |
| 22 | static __fi bool _add64_Overflow( s64 x, s64 y, s64 &ret ) |
| 23 | { |
| 24 | const s64 result = x + y; |
| 25 | |
| 26 | // Let's all give gigaherz a big round of applause for finding this gem, |
| 27 | // which apparently works, and generates compact/fast x86 code too (the |
| 28 | // other method below is like 5-10 times slower). |
| 29 | |
| 30 | if( ((~(x^y))&(x^result)) < 0 ) { |
| 31 | cpuException(0x30, cpuRegs.branch); // fixme: is 0x30 right for overflow?? |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | // the not-as-fast style! |
| 36 | //if( ((x >= 0) && (y >= 0) && (result < 0)) || |
| 37 | // ((x < 0) && (y < 0) && (result >= 0)) ) |
| 38 | // cpuException(0x30, cpuRegs.branch); |
| 39 | |
| 40 | ret = result; |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | static __fi bool _add32_Overflow( s32 x, s32 y, s64 &ret ) |
| 45 | { |
no test coverage detected