Index: src/arm/macro-assembler-arm.cc |
=================================================================== |
--- src/arm/macro-assembler-arm.cc (revision 8362) |
+++ src/arm/macro-assembler-arm.cc (working copy) |
@@ -309,9 +309,9 @@ |
} |
-void MacroAssembler::Move(Register dst, Register src) { |
+void MacroAssembler::Move(Register dst, Register src, Condition cond) { |
if (!dst.is(src)) { |
- mov(dst, src); |
+ mov(dst, src, LeaveCC, cond); |
} |
} |
@@ -727,7 +727,24 @@ |
vmrs(fpscr_flags, cond); |
} |
+void MacroAssembler::Vmov(const DwVfpRegister dst, |
+ const double imm, |
+ const Condition cond) { |
+ ASSERT(CpuFeatures::IsEnabled(VFP3)); |
+ static const DoubleRepresentation minus_zero(-0.0); |
+ static const DoubleRepresentation zero(0.0); |
+ DoubleRepresentation value(imm); |
+ // Handle special values first. |
+ if (value.bits == zero.bits) { |
+ vmov(dst, kDoubleRegZero, cond); |
+ } else if (value.bits == minus_zero.bits) { |
+ vneg(dst, kDoubleRegZero, cond); |
+ } else { |
+ vmov(dst, imm, cond); |
+ } |
+} |
+ |
void MacroAssembler::EnterFrame(StackFrame::Type type) { |
// r0-r3: preserved |
stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); |
@@ -3084,7 +3101,7 @@ |
Label done; |
Label in_bounds; |
- vmov(temp_double_reg, 0.0); |
+ Vmov(temp_double_reg, 0.0); |
VFPCompareAndSetFlags(input_reg, temp_double_reg); |
b(gt, &above_zero); |
@@ -3094,7 +3111,7 @@ |
// Double value is >= 255, return 255. |
bind(&above_zero); |
- vmov(temp_double_reg, 255.0); |
+ Vmov(temp_double_reg, 255.0); |
VFPCompareAndSetFlags(input_reg, temp_double_reg); |
b(le, &in_bounds); |
mov(result_reg, Operand(255)); |
@@ -3102,7 +3119,7 @@ |
// In 0-255 range, round and truncate. |
bind(&in_bounds); |
- vmov(temp_double_reg, 0.5); |
+ Vmov(temp_double_reg, 0.5); |
vadd(temp_double_reg, input_reg, temp_double_reg); |
vcvt_u32_f64(s0, temp_double_reg); |
vmov(result_reg, s0); |