This commit also includes BranchF refactoring in macro-assembler.
TEST=mozilla/ecma/TypeConversion/9.2.js
BUG=
Review URL: https://codereview.chromium.org/
12505004
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13849
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
// ----- Emulated conditions.
// On MIPS we use this enum to abstract from conditionnal branch instructions.
-// the 'U' prefix is used to specify unsigned comparisons.
+// The 'U' prefix is used to specify unsigned comparisons.
+// Oppposite conditions must be paired as odd/even numbers
+// because 'NegateCondition' function flips LSB to negate condition.
enum Condition {
// Any value < 0 is considered no_condition.
kNoCondition = -1,
greater_equal = 13,
less_equal = 14,
greater = 15,
+ ueq = 16, // Unordered or Equal.
+ nue = 17, // Not (Unordered or Equal).
- cc_always = 16,
+ cc_always = 18,
// Aliases.
carry = Uless,
CpuFeatureScope scope(masm(), FPU);
DoubleRegister reg = ToDoubleRegister(instr->value());
// Test the double value. Zero and NaN are false.
- EmitBranchF(true_block, false_block, ne, reg, kDoubleRegZero);
+ EmitBranchF(true_block, false_block, nue, reg, kDoubleRegZero);
} else {
ASSERT(r.IsTagged());
Register reg = ToRegister(instr->value());
// have been handled by the caller.
// Unsigned conditions are treated as their signed counterpart.
switch (cc) {
- case Uless:
- case less:
+ case lt:
c(OLT, D, cmp1, cmp2);
bc1t(target);
break;
- case Ugreater:
- case greater:
+ case gt:
c(ULE, D, cmp1, cmp2);
bc1f(target);
break;
- case Ugreater_equal:
- case greater_equal:
+ case ge:
c(ULT, D, cmp1, cmp2);
bc1f(target);
break;
- case Uless_equal:
- case less_equal:
+ case le:
c(OLE, D, cmp1, cmp2);
bc1t(target);
break;
c(EQ, D, cmp1, cmp2);
bc1t(target);
break;
+ case ueq:
+ c(UEQ, D, cmp1, cmp2);
+ bc1t(target);
+ break;
case ne:
c(EQ, D, cmp1, cmp2);
bc1f(target);
break;
+ case nue:
+ c(UEQ, D, cmp1, cmp2);
+ bc1f(target);
+ break;
default:
CHECK(0);
};