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

Unified Diff: test/cctest/types-fuzz.h

Issue 1303863002: [simd] Introduce SIMD types (as classes) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/types-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/types-fuzz.h
diff --git a/test/cctest/types-fuzz.h b/test/cctest/types-fuzz.h
index 60f054a66e99bbe067a21a6b8882829d0b87d628..98280a918d2eecb9394742d505813c82244f01db 100644
--- a/test/cctest/types-fuzz.h
+++ b/test/cctest/types-fuzz.h
@@ -39,7 +39,7 @@ template<class Type, class TypeHandle, class Region>
class Types {
public:
Types(Region* region, Isolate* isolate, v8::base::RandomNumberGenerator* rng)
- : region_(region), rng_(rng) {
+ : region_(region), isolate_(isolate), rng_(rng) {
#define DECLARE_TYPE(name, value) \
name = Type::name(region); \
types.push_back(name);
@@ -304,6 +304,21 @@ class Types {
}
return type;
}
+ case 8: { // simd
+ static const int num_simd_types =
+ #define COUNT_SIMD_TYPE(NAME, Name, name, lane_count, lane_type) +1
+ SIMD128_TYPES(COUNT_SIMD_TYPE)
+ #undef COUNT_SIMD_TYPE
+ ;
+ TypeHandle (*simd_constructors[num_simd_types])(Isolate*, Region*) = {
+ #define COUNT_SIMD_TYPE(NAME, Name, name, lane_count, lane_type) \
+ &Type::Name,
+ SIMD128_TYPES(COUNT_SIMD_TYPE)
+ #undef COUNT_SIMD_TYPE
+ };
+ return simd_constructors[rng_->NextInt(num_simd_types)](
+ isolate_, region_);
+ }
default: { // union
int n = rng_->NextInt(10);
TypeHandle type = None;
@@ -321,6 +336,7 @@ class Types {
private:
Region* region_;
+ Isolate* isolate_;
v8::base::RandomNumberGenerator* rng_;
};
« no previous file with comments | « src/types-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698