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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ 5 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_
6 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ 6 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/frames.h" 10 #include "src/frames.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // Register move. May do nothing if the registers are identical. 163 // Register move. May do nothing if the registers are identical.
164 void Move(Register dst, Smi* smi) { mov(dst, Operand(smi)); } 164 void Move(Register dst, Smi* smi) { mov(dst, Operand(smi)); }
165 void Move(Register dst, Handle<Object> value); 165 void Move(Register dst, Handle<Object> value);
166 void Move(Register dst, Register src, Condition cond = al); 166 void Move(Register dst, Register src, Condition cond = al);
167 void Move(Register dst, const Operand& src, SBit sbit = LeaveCC, 167 void Move(Register dst, const Operand& src, SBit sbit = LeaveCC,
168 Condition cond = al) { 168 Condition cond = al) {
169 if (!src.is_reg() || !src.rm().is(dst) || sbit != LeaveCC) { 169 if (!src.is_reg() || !src.rm().is(dst) || sbit != LeaveCC) {
170 mov(dst, src, sbit, cond); 170 mov(dst, src, sbit, cond);
171 } 171 }
172 } 172 }
173 void Move(SwVfpRegister dst, SwVfpRegister src); 173 void Move(SwVfpRegister dst, SwVfpRegister src, Condition cond = al);
174 void Move(DwVfpRegister dst, DwVfpRegister src); 174 void Move(DwVfpRegister dst, DwVfpRegister src, Condition cond = al);
175 175
176 void Load(Register dst, const MemOperand& src, Representation r); 176 void Load(Register dst, const MemOperand& src, Representation r);
177 void Store(Register src, const MemOperand& dst, Representation r); 177 void Store(Register src, const MemOperand& dst, Representation r);
178 178
179 // Load an object from the root table. 179 // Load an object from the root table.
180 void LoadRoot(Register destination, 180 void LoadRoot(Register destination,
181 Heap::RootListIndex index, 181 Heap::RootListIndex index,
182 Condition cond = al); 182 Condition cond = al);
183 // Store an object to the root table. 183 // Store an object to the root table.
184 void StoreRoot(Register source, 184 void StoreRoot(Register source,
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 void CheckFor32DRegs(Register scratch); 1075 void CheckFor32DRegs(Register scratch);
1076 1076
1077 // Does a runtime check for 16/32 FP registers. Either way, pushes 32 double 1077 // Does a runtime check for 16/32 FP registers. Either way, pushes 32 double
1078 // values to location, saving [d0..(d15|d31)]. 1078 // values to location, saving [d0..(d15|d31)].
1079 void SaveFPRegs(Register location, Register scratch); 1079 void SaveFPRegs(Register location, Register scratch);
1080 1080
1081 // Does a runtime check for 16/32 FP registers. Either way, pops 32 double 1081 // Does a runtime check for 16/32 FP registers. Either way, pops 32 double
1082 // values to location, restoring [d0..(d15|d31)]. 1082 // values to location, restoring [d0..(d15|d31)].
1083 void RestoreFPRegs(Register location, Register scratch); 1083 void RestoreFPRegs(Register location, Register scratch);
1084 1084
1085 // Perform a floating-point min or max operation with the
1086 // (IEEE-754-compatible) semantics of ARM64's fmin/fmax. Some cases, typically
1087 // NaNs or +/-0.0, are expected to be rare and are handled in out-of-line
1088 // code. The specific behaviour depends on supported instructions.
1089 //
1090 // These functions assume (and assert) that !left.is(right). It is permitted
1091 // for the result to alias either input register.
1092 void FloatMax(SwVfpRegister result, SwVfpRegister left, SwVfpRegister right,
1093 Label* out_of_line);
1094 void FloatMin(SwVfpRegister result, SwVfpRegister left, SwVfpRegister right,
1095 Label* out_of_line);
1096 void FloatMax(DwVfpRegister result, DwVfpRegister left, DwVfpRegister right,
1097 Label* out_of_line);
1098 void FloatMin(DwVfpRegister result, DwVfpRegister left, DwVfpRegister right,
1099 Label* out_of_line);
1100
1101 // Generate out-of-line cases for the macros above.
1102 void FloatMaxOutOfLine(SwVfpRegister result, SwVfpRegister left,
1103 SwVfpRegister right);
1104 void FloatMinOutOfLine(SwVfpRegister result, SwVfpRegister left,
1105 SwVfpRegister right);
1106 void FloatMaxOutOfLine(DwVfpRegister result, DwVfpRegister left,
1107 DwVfpRegister right);
1108 void FloatMinOutOfLine(DwVfpRegister result, DwVfpRegister left,
1109 DwVfpRegister right);
1110
1085 // --------------------------------------------------------------------------- 1111 // ---------------------------------------------------------------------------
1086 // Runtime calls 1112 // Runtime calls
1087 1113
1088 // Call a code stub. 1114 // Call a code stub.
1089 void CallStub(CodeStub* stub, 1115 void CallStub(CodeStub* stub,
1090 TypeFeedbackId ast_id = TypeFeedbackId::None(), 1116 TypeFeedbackId ast_id = TypeFeedbackId::None(),
1091 Condition cond = al); 1117 Condition cond = al);
1092 1118
1093 // Call a code stub. 1119 // Call a code stub.
1094 void TailCallStub(CodeStub* stub, Condition cond = al); 1120 void TailCallStub(CodeStub* stub, Condition cond = al);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 // the position of the first bit. Leaves addr_reg unchanged. 1532 // the position of the first bit. Leaves addr_reg unchanged.
1507 inline void GetMarkBits(Register addr_reg, 1533 inline void GetMarkBits(Register addr_reg,
1508 Register bitmap_reg, 1534 Register bitmap_reg,
1509 Register mask_reg); 1535 Register mask_reg);
1510 1536
1511 // Compute memory operands for safepoint stack slots. 1537 // Compute memory operands for safepoint stack slots.
1512 static int SafepointRegisterStackIndex(int reg_code); 1538 static int SafepointRegisterStackIndex(int reg_code);
1513 MemOperand SafepointRegisterSlot(Register reg); 1539 MemOperand SafepointRegisterSlot(Register reg);
1514 MemOperand SafepointRegistersAndDoublesSlot(Register reg); 1540 MemOperand SafepointRegistersAndDoublesSlot(Register reg);
1515 1541
1542 // Implementation helpers for FloatMin and FloatMax.
1543 template <typename T>
1544 void FloatMaxHelper(T result, T left, T right, Label* out_of_line);
1545 template <typename T>
1546 void FloatMinHelper(T result, T left, T right, Label* out_of_line);
1547 template <typename T>
1548 void FloatMaxOutOfLineHelper(T result, T left, T right);
1549 template <typename T>
1550 void FloatMinOutOfLineHelper(T result, T left, T right);
1551
1516 bool generating_stub_; 1552 bool generating_stub_;
1517 bool has_frame_; 1553 bool has_frame_;
1518 // This handle will be patched with the code object on installation. 1554 // This handle will be patched with the code object on installation.
1519 Handle<Object> code_object_; 1555 Handle<Object> code_object_;
1520 1556
1521 // Needs access to SafepointRegisterStackIndex for compiled frame 1557 // Needs access to SafepointRegisterStackIndex for compiled frame
1522 // traversal. 1558 // traversal.
1523 friend class StandardFrame; 1559 friend class StandardFrame;
1524 }; 1560 };
1525 1561
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 inline MemOperand NativeContextMemOperand() { 1608 inline MemOperand NativeContextMemOperand() {
1573 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); 1609 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
1574 } 1610 }
1575 1611
1576 #define ACCESS_MASM(masm) masm-> 1612 #define ACCESS_MASM(masm) masm->
1577 1613
1578 } // namespace internal 1614 } // namespace internal
1579 } // namespace v8 1615 } // namespace v8
1580 1616
1581 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ 1617 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_
OLDNEW
« 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