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

Unified Diff: test/cctest/test-heap.cc

Issue 1294513004: [simd.js] Update to spec version 0.8.2. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Latest SIMD.js Spec. Created 5 years, 4 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: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 1c09752b726e4a2cfe32ff36b698086edc60b78c..14c6e659be087e7e8dc0ac3ff1a27db6f88fe8d8 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -286,7 +286,7 @@ TEST(SimdObjects) {
}
// Int32x4
{
- int32_t lanes[4] = {-1, 0, 1, 2};
+ int32_t lanes[4] = {1, 2, 3, 4};
Handle<Int32x4> value = factory->NewInt32x4(lanes);
CHECK(value->IsInt32x4());
@@ -295,12 +295,26 @@ TEST(SimdObjects) {
#ifdef OBJECT_PRINT
std::ostringstream os;
value->Int32x4Print(os);
- CHECK_EQ("-1, 0, 1, 2", os.str());
+ CHECK_EQ("1, 2, 3, 4", os.str());
+#endif // OBJECT_PRINT
+ }
+ // Uint32x4
+ {
+ uint32_t lanes[4] = {1, 2, 3, 4};
+
+ Handle<Uint32x4> value = factory->NewUint32x4(lanes);
+ CHECK(value->IsUint32x4());
+ CheckSimdValue<Uint32x4, uint32_t, 4>(*value, lanes, 3);
+
+#ifdef OBJECT_PRINT
+ std::ostringstream os;
+ value->Uint32x4Print(os);
+ CHECK_EQ("1, 2, 3, 4", os.str());
#endif // OBJECT_PRINT
}
// Bool32x4
{
- bool lanes[4] = {true, true, true, false};
+ bool lanes[4] = {true, false, true, false};
Handle<Bool32x4> value = factory->NewBool32x4(lanes);
CHECK(value->IsBool32x4());
@@ -309,12 +323,12 @@ TEST(SimdObjects) {
#ifdef OBJECT_PRINT
std::ostringstream os;
value->Bool32x4Print(os);
- CHECK_EQ("true, true, true, false", os.str());
+ CHECK_EQ("true, false, true, false", os.str());
#endif // OBJECT_PRINT
}
// Int16x8
{
- int16_t lanes[8] = {-1, 0, 1, 2, 3, 4, 5, -32768};
+ int16_t lanes[8] = {1, 2, 3, 4, 5, 6, 7, 8};
Handle<Int16x8> value = factory->NewInt16x8(lanes);
CHECK(value->IsInt16x8());
@@ -323,12 +337,26 @@ TEST(SimdObjects) {
#ifdef OBJECT_PRINT
std::ostringstream os;
value->Int16x8Print(os);
- CHECK_EQ("-1, 0, 1, 2, 3, 4, 5, -32768", os.str());
+ CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8", os.str());
+#endif // OBJECT_PRINT
+ }
+ // Uint16x8
+ {
+ uint16_t lanes[8] = {1, 2, 3, 4, 5, 6, 7, 8};
+
+ Handle<Uint16x8> value = factory->NewUint16x8(lanes);
+ CHECK(value->IsUint16x8());
+ CheckSimdValue<Uint16x8, uint16_t, 8>(*value, lanes, 32767);
+
+#ifdef OBJECT_PRINT
+ std::ostringstream os;
+ value->Uint16x8Print(os);
+ CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8", os.str());
#endif // OBJECT_PRINT
}
// Bool16x8
{
- bool lanes[8] = {true, true, true, true, true, true, true, false};
+ bool lanes[8] = {true, false, true, false, true, false, true, false};
Handle<Bool16x8> value = factory->NewBool16x8(lanes);
CHECK(value->IsBool16x8());
@@ -337,12 +365,12 @@ TEST(SimdObjects) {
#ifdef OBJECT_PRINT
std::ostringstream os;
value->Bool16x8Print(os);
- CHECK_EQ("true, true, true, true, true, true, true, false", os.str());
+ CHECK_EQ("true, false, true, false, true, false, true, false", os.str());
#endif // OBJECT_PRINT
}
// Int8x16
{
- int8_t lanes[16] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -128};
+ int8_t lanes[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
Handle<Int8x16> value = factory->NewInt8x16(lanes);
CHECK(value->IsInt8x16());
@@ -351,14 +379,27 @@ TEST(SimdObjects) {
#ifdef OBJECT_PRINT
std::ostringstream os;
value->Int8x16Print(os);
- CHECK_EQ("-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -128",
- os.str());
+ CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16", os.str());
+#endif // OBJECT_PRINT
+ }
+ // Uint8x16
+ {
+ uint8_t lanes[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
+
+ Handle<Uint8x16> value = factory->NewUint8x16(lanes);
+ CHECK(value->IsUint8x16());
+ CheckSimdValue<Uint8x16, uint8_t, 16>(*value, lanes, 127);
+
+#ifdef OBJECT_PRINT
+ std::ostringstream os;
+ value->Uint8x16Print(os);
+ CHECK_EQ("1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16", os.str());
#endif // OBJECT_PRINT
}
// Bool8x16
{
- bool lanes[16] = {true, true, true, true, true, true, true, false,
- true, true, true, true, true, true, true, false};
+ bool lanes[16] = {true, false, true, false, true, false, true, false,
+ true, false, true, false, true, false, true, false};
Handle<Bool8x16> value = factory->NewBool8x16(lanes);
CHECK(value->IsBool8x16());
@@ -368,8 +409,8 @@ TEST(SimdObjects) {
std::ostringstream os;
value->Bool8x16Print(os);
CHECK_EQ(
- "true, true, true, true, true, true, true, false, true, true, true, "
- "true, true, true, true, false",
+ "true, false, true, false, true, false, true, false, true, false, "
+ "true, false, true, false, true, false",
os.str());
#endif // OBJECT_PRINT
}
« no previous file with comments | « test/cctest/cctest.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | test/simdjs/testcfg.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698