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

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

Issue 2313863003: [arm] Improve Float(32|64)(Max|Min). (Closed)
Patch Set: Created 4 years, 3 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 | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.h
diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h
index 2f1b3c2cae9c83a7c1ce28f4ff44851523196925..0986fe8222b7f8e25951122af213f2fa4ac06b85 100644
--- a/src/arm/macro-assembler-arm.h
+++ b/src/arm/macro-assembler-arm.h
@@ -170,8 +170,8 @@ class MacroAssembler: public Assembler {
mov(dst, src, sbit, cond);
}
}
- void Move(SwVfpRegister dst, SwVfpRegister src);
- void Move(DwVfpRegister dst, DwVfpRegister src);
+ void Move(SwVfpRegister dst, SwVfpRegister src, Condition cond = al);
+ void Move(DwVfpRegister dst, DwVfpRegister src, Condition cond = al);
void Load(Register dst, const MemOperand& src, Representation r);
void Store(Register src, const MemOperand& dst, Representation r);
@@ -1082,6 +1082,32 @@ class MacroAssembler: public Assembler {
// values to location, restoring [d0..(d15|d31)].
void RestoreFPRegs(Register location, Register scratch);
+ // Perform a floating-point min or max operation with the
+ // (IEEE-754-compatible) semantics of ARM64's fmin/fmax. Some cases, typically
+ // NaNs or +/-0.0, are expected to be rare and are handled in out-of-line
+ // code. The specific behaviour depends on supported instructions.
+ //
+ // These functions assume (and assert) that !left.is(right). It is permitted
+ // for the result to alias either input register.
+ void FloatMax(SwVfpRegister result, SwVfpRegister left, SwVfpRegister right,
+ Label* out_of_line);
+ void FloatMin(SwVfpRegister result, SwVfpRegister left, SwVfpRegister right,
+ Label* out_of_line);
+ void FloatMax(DwVfpRegister result, DwVfpRegister left, DwVfpRegister right,
+ Label* out_of_line);
+ void FloatMin(DwVfpRegister result, DwVfpRegister left, DwVfpRegister right,
+ Label* out_of_line);
+
+ // Generate out-of-line cases for the macros above.
+ void FloatMaxOutOfLine(SwVfpRegister result, SwVfpRegister left,
+ SwVfpRegister right);
+ void FloatMinOutOfLine(SwVfpRegister result, SwVfpRegister left,
+ SwVfpRegister right);
+ void FloatMaxOutOfLine(DwVfpRegister result, DwVfpRegister left,
+ DwVfpRegister right);
+ void FloatMinOutOfLine(DwVfpRegister result, DwVfpRegister left,
+ DwVfpRegister right);
+
// ---------------------------------------------------------------------------
// Runtime calls
@@ -1513,6 +1539,16 @@ class MacroAssembler: public Assembler {
MemOperand SafepointRegisterSlot(Register reg);
MemOperand SafepointRegistersAndDoublesSlot(Register reg);
+ // Implementation helpers for FloatMin and FloatMax.
+ template <typename T>
+ void FloatMaxHelper(T result, T left, T right, Label* out_of_line);
+ template <typename T>
+ void FloatMinHelper(T result, T left, T right, Label* out_of_line);
+ template <typename T>
+ void FloatMaxOutOfLineHelper(T result, T left, T right);
+ template <typename T>
+ void FloatMinOutOfLineHelper(T result, T left, T right);
+
bool generating_stub_;
bool has_frame_;
// This handle will be patched with the code object on installation.
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698