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

Unified Diff: src/objects-printer.cc

Issue 2695653005: Revert of Remove SIMD.js from V8. (Closed)
Patch Set: Created 3 years, 10 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 | « src/objects-inl.h ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 7272ee54ac262d7bdbbd479dd7e1b1f121d13f48..928cc06990da68e1e8f62a571d5bd196d6dad184 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -73,6 +73,9 @@
os << "<mutable ";
HeapNumber::cast(this)->HeapNumberPrint(os);
os << ">\n";
+ break;
+ case SIMD128_VALUE_TYPE:
+ Simd128Value::cast(this)->Simd128ValuePrint(os);
break;
case FIXED_DOUBLE_ARRAY_TYPE:
FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os);
@@ -249,6 +252,59 @@
break;
}
}
+
+
+void Simd128Value::Simd128ValuePrint(std::ostream& os) { // NOLINT
+#define PRINT_SIMD128_VALUE(TYPE, Type, type, lane_count, lane_type) \
+ if (Is##Type()) return Type::cast(this)->Type##Print(os);
+ SIMD128_TYPES(PRINT_SIMD128_VALUE)
+#undef PRINT_SIMD128_VALUE
+ UNREACHABLE();
+}
+
+
+void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT
+ char arr[100];
+ Vector<char> buffer(arr, arraysize(arr));
+ os << std::string(DoubleToCString(get_lane(0), buffer)) << ", "
+ << std::string(DoubleToCString(get_lane(1), buffer)) << ", "
+ << std::string(DoubleToCString(get_lane(2), buffer)) << ", "
+ << std::string(DoubleToCString(get_lane(3), buffer));
+}
+
+
+#define SIMD128_INT_PRINT_FUNCTION(type, lane_count) \
+ void type::type##Print(std::ostream& os) { \
+ char arr[100]; \
+ Vector<char> buffer(arr, arraysize(arr)); \
+ os << std::string(IntToCString(get_lane(0), buffer)); \
+ for (int i = 1; i < lane_count; i++) { \
+ os << ", " << std::string(IntToCString(get_lane(i), buffer)); \
+ } \
+ }
+SIMD128_INT_PRINT_FUNCTION(Int32x4, 4)
+SIMD128_INT_PRINT_FUNCTION(Uint32x4, 4)
+SIMD128_INT_PRINT_FUNCTION(Int16x8, 8)
+SIMD128_INT_PRINT_FUNCTION(Uint16x8, 8)
+SIMD128_INT_PRINT_FUNCTION(Int8x16, 16)
+SIMD128_INT_PRINT_FUNCTION(Uint8x16, 16)
+#undef SIMD128_INT_PRINT_FUNCTION
+
+
+#define SIMD128_BOOL_PRINT_FUNCTION(type, lane_count) \
+ void type::type##Print(std::ostream& os) { \
+ char arr[100]; \
+ Vector<char> buffer(arr, arraysize(arr)); \
+ os << std::string(get_lane(0) ? "true" : "false"); \
+ for (int i = 1; i < lane_count; i++) { \
+ os << ", " << std::string(get_lane(i) ? "true" : "false"); \
+ } \
+ }
+SIMD128_BOOL_PRINT_FUNCTION(Bool32x4, 4)
+SIMD128_BOOL_PRINT_FUNCTION(Bool16x8, 8)
+SIMD128_BOOL_PRINT_FUNCTION(Bool8x16, 16)
+#undef SIMD128_BOOL_PRINT_FUNCTION
+
void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT
os << "byte array, data starts at " << GetDataStartAddress();
« no previous file with comments | « src/objects-inl.h ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698