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

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

Issue 2045943002: [compiler] [wasm] Introduce Word32/64ReverseBytes as TF Optional Opcode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: implement machops tests Created 4 years, 5 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 e9045d114499ef3e45b9dba8e439105ecfe4a688..b8aa9600cb37def13eecf3c23739f5dd2c32933e 100644
--- a/src/compiler/machine-operator.h
+++ b/src/compiler/machine-operator.h
@@ -121,13 +121,16 @@ class MachineOperatorBuilder final : public ZoneObject {
kWord64ReverseBits = 1u << 21,
kFloat32Neg = 1u << 22,
kFloat64Neg = 1u << 23,
- kAllOptionalOps =
- kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min |
- kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp |
- kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate |
- kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven |
- kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt |
- kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg | kFloat64Neg
+ kWord32ReverseBytes = 1u << 24,
+ kWord64ReverseBytes = 1u << 25,
+ kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min |
+ kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp |
+ kFloat64RoundUp | kFloat32RoundTruncate |
+ kFloat64RoundTruncate | kFloat64RoundTiesAway |
+ kFloat32RoundTiesEven | kFloat64RoundTiesEven |
+ kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt |
+ kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg |
+ kFloat64Neg | kWord32ReverseBytes | kWord64ReverseBytes
};
typedef base::Flags<Flag, unsigned> Flags;
@@ -217,6 +220,8 @@ class MachineOperatorBuilder final : public ZoneObject {
const OptionalOperator Word64Popcnt();
const OptionalOperator Word32ReverseBits();
const OptionalOperator Word64ReverseBits();
+ const OptionalOperator Word32ReverseBytes();
+ const OptionalOperator Word64ReverseBytes();
bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; }
const Operator* Word64And();
@@ -636,6 +641,18 @@ class MachineOperatorBuilder final : public ZoneObject {
alignment);
}
+ bool ReverseBytesSupported(size_t size_in_bytes) {
ahaas 2016/07/28 14:12:59 Could this function not just be a helper function
john.yan 2016/07/28 18:03:50 Sure.
+ switch (size_in_bytes) {
+ case 4:
+ return Word32ReverseBytes().IsSupported();
+ case 8:
+ return Word64ReverseBytes().IsSupported();
+ default:
+ break;
ahaas 2016/07/28 14:12:59 Do you expect that the default case is ever reache
john.yan 2016/07/28 18:03:50 No, I expect it to return false (unsupported).
+ }
+ return false;
+ }
+
// Pseudo operators that translate to 32/64-bit operators depending on the
// word-size of the target machine assumed by this builder.
#define PSEUDO_OP_LIST(V) \

Powered by Google App Engine
This is Rietveld 408576698