Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Unified Diff: src/mips64/simulator-mips64.cc

Issue 1785923011: MIPS64: Followup 'MIPS64: Use BOVC/BNVC for overflow checking on r6.' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/simulator-mips64.cc
diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc
index efaf02d5af25c5ac0484c00b96085d0e406a84f3..9519865c8231eab71bcc54840827e82537b702fe 100644
--- a/src/mips64/simulator-mips64.cc
+++ b/src/mips64/simulator-mips64.cc
@@ -24,11 +24,8 @@
namespace v8 {
namespace internal {
-// Utils functions.
-bool HaveSameSign(int64_t a, int64_t b) {
- return ((a ^ b) >= 0);
-}
-
+// Util functions.
+inline bool HaveSameSign(int64_t a, int64_t b) { return ((a ^ b) >= 0); }
uint32_t get_fcsr_condition_bit(uint32_t cc) {
if (cc == 0) {
@@ -4329,10 +4326,8 @@ void Simulator::DecodeTypeImmediate(Instruction* instr) {
case POP10: // BOVC, BEQZALC, BEQC / ADDI (pre-r6)
if (kArchVariant == kMips64r6) {
if (rs_reg >= rt_reg) { // BOVC
- if (HaveSameSign(rs, rt)) {
- int64_t sum = rs + rt;
- BranchCompactHelper(sum < INT32_MIN || sum > INT32_MAX, 16);
- }
+ bool condition = !is_int32(rs) || !is_int32(rt) || !is_int32(rs + rt);
+ BranchCompactHelper(condition, 16);
} else {
if (rs_reg == 0) { // BEQZALC
BranchAndLinkCompactHelper(rt == 0, 16);
@@ -4358,12 +4353,8 @@ void Simulator::DecodeTypeImmediate(Instruction* instr) {
case POP30: // BNVC, BNEZALC, BNEC / DADDI (pre-r6)
if (kArchVariant == kMips64r6) {
if (rs_reg >= rt_reg) { // BNVC
- if (!HaveSameSign(rs, rt) || rs == 0 || rt == 0) {
- BranchCompactHelper(true, 16);
- } else {
- int64_t sum = rs + rt;
- BranchCompactHelper(sum >= INT32_MIN && sum <= INT32_MAX, 16);
- }
+ bool condition = is_int32(rs) && is_int32(rt) && is_int32(rs + rt);
+ BranchCompactHelper(condition, 16);
} else {
if (rs_reg == 0) { // BNEZALC
BranchAndLinkCompactHelper(rt != 0, 16);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698