Chromium Code Reviews| Index: src/arm/macro-assembler-arm.cc | 
| =================================================================== | 
| --- src/arm/macro-assembler-arm.cc (revision 6244) | 
| +++ src/arm/macro-assembler-arm.cc (working copy) | 
| @@ -519,13 +519,71 @@ | 
| } | 
| -void MacroAssembler::ClearFPSCRBits(uint32_t bits_to_clear, Register scratch) { | 
| - vmrs(scratch); | 
| - bic(scratch, scratch, Operand(bits_to_clear)); | 
| - vmsr(scratch); | 
| +void MacroAssembler::ClearFPSCRBits(const uint32_t bits_to_clear, | 
| + const Register scratch, | 
| + const Condition cond) { | 
| + vmrs(scratch, cond); | 
| + bic(scratch, scratch, Operand(bits_to_clear), LeaveCC, cond); | 
| + vmsr(scratch, cond); | 
| } | 
| +void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1, | 
| 
 
Rodolph Perfetta
2011/01/10 14:59:36
If the flags are cleared the intent is to read the
 
Søren Thygesen Gjesse
2011/01/11 12:41:52
Done.
 
 | 
| + const DwVfpRegister src2, | 
| + const Register scratch, | 
| + const Condition cond) { | 
| + // Clear the Invalid cumulative exception flags if a scratch register is | 
| + // supplied. | 
| + if (!scratch.is(no_reg)) { | 
| + ClearFPSCRBits(kVFPInvalidExceptionBit, scratch, cond); | 
| + } | 
| + | 
| + // Compare and move FPSCR flags to the normal condition flags. | 
| + vcmp(src1, src2, cond); | 
| + vmrs(pc, cond); | 
| +} | 
| + | 
| +void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1, | 
| 
 
Rodolph Perfetta
2011/01/10 14:59:36
Ditto.
 
Søren Thygesen Gjesse
2011/01/11 12:41:52
Done.
 
 | 
| + const double src2, | 
| + const Register scratch, | 
| + const Condition cond) { | 
| + // Clear the Invalid cumulative exception flags if a scratch register is | 
| + // supplied. | 
| + if (!scratch.is(no_reg)) { | 
| + ClearFPSCRBits(kVFPInvalidExceptionBit, scratch, cond); | 
| + } | 
| + | 
| + // Compare and move FPSCR flags to the normal condition flags. | 
| + vcmp(src1, src2, cond); | 
| + vmrs(pc, cond); | 
| +} | 
| + | 
| + | 
| +void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1, | 
| + const DwVfpRegister src2, | 
| + const Register fpscr_flags, | 
| + const Condition cond) { | 
| + // Clear the Invalid cumulative exception flags (use fpscr_flags as scratch). | 
| + ClearFPSCRBits(kVFPInvalidExceptionBit, fpscr_flags); | 
| + | 
| + // Compare and load FPSCR. | 
| + vcmp(src1, src2, cond); | 
| + vmrs(fpscr_flags); | 
| +} | 
| + | 
| +void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1, | 
| + const double src2, | 
| + const Register fpscr_flags, | 
| + const Condition cond) { | 
| + // Clear the Invalid cumulative exception flags (use fpscr_flags as scratch). | 
| + ClearFPSCRBits(kVFPInvalidExceptionBit, fpscr_flags); | 
| + | 
| + // Compare and load FPSCR. | 
| + vcmp(src1, src2, cond); | 
| + vmrs(fpscr_flags); | 
| +} | 
| + | 
| + | 
| void MacroAssembler::EnterFrame(StackFrame::Type type) { | 
| // r0-r3: preserved | 
| stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); |