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

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 6117003: ARM: Add instruction VFPCompareAndSetFlags to macro assembler (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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
« src/arm/code-stubs-arm.cc ('K') | « src/arm/macro-assembler-arm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« src/arm/code-stubs-arm.cc ('K') | « src/arm/macro-assembler-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698