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

Unified Diff: src/compiler/machine-operator.h

Issue 1919513002: [turbofan] Introduce TruncateTaggedToWord32 simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
Index: src/compiler/machine-operator.h
diff --git a/src/compiler/machine-operator.h b/src/compiler/machine-operator.h
index d8861e0c5e49a16f3961aa4f6bc928f4cdb44c77..eed5e782fcf0f77418352f3d570503ef848e6a8f 100644
--- a/src/compiler/machine-operator.h
+++ b/src/compiler/machine-operator.h
@@ -32,22 +32,6 @@ class OptionalOperator final {
const Operator* const op_;
};
-
-// Supported float64 to int32 truncation modes.
-enum class TruncationMode : uint8_t {
- kJavaScript, // ES6 section 7.1.5
- kRoundToZero // Round towards zero. Implementation defined for NaN and ovf.
-};
-
-V8_INLINE size_t hash_value(TruncationMode mode) {
- return static_cast<uint8_t>(mode);
-}
-
-std::ostream& operator<<(std::ostream&, TruncationMode);
-
-TruncationMode TruncationModeOf(Operator const*);
-
-
// Supported write barrier modes.
enum WriteBarrierKind {
kNoWriteBarrier,
@@ -223,6 +207,9 @@ class MachineOperatorBuilder final : public ZoneObject {
// This operator reinterprets the bits of a word as tagged pointer.
const Operator* BitcastWordToTagged();
+ // JavaScript float64 to int32/uint32 truncation.
+ const Operator* TruncateFloat64ToWord32();
+
// These operators change the representation of numbers while preserving the
// value of the number. Narrowing operators assume the input is representable
// in the target type and are *not* defined for other inputs.
@@ -246,8 +233,8 @@ class MachineOperatorBuilder final : public ZoneObject {
// These operators truncate or round numbers, both changing the representation
// of the number and mapping multiple input values onto the same output value.
const Operator* TruncateFloat64ToFloat32();
- const Operator* TruncateFloat64ToInt32(TruncationMode);
const Operator* TruncateInt64ToInt32();
+ const Operator* RoundFloat64ToInt32();
const Operator* RoundInt32ToFloat32();
const Operator* RoundInt64ToFloat32();
const Operator* RoundInt64ToFloat64();

Powered by Google App Engine
This is Rietveld 408576698