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

Unified Diff: src/runtime/runtime-simd.cc

Issue 1298603002: [runtime] Unify and fix the strict equality comparison. (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
Index: src/runtime/runtime-simd.cc
diff --git a/src/runtime/runtime-simd.cc b/src/runtime/runtime-simd.cc
index bcf356702c5c09c1c494eba4c68dbece95cd03a7..ad337eaf159912d5298bc5de723f6e54b38c269e 100644
--- a/src/runtime/runtime-simd.cc
+++ b/src/runtime/runtime-simd.cc
@@ -48,14 +48,6 @@ int8_t ConvertNumber<int8_t>(double number) {
}
-bool Equals(Float32x4* a, Float32x4* b) {
- for (int i = 0; i < 4; i++) {
- if (a->get_lane(i) != b->get_lane(i)) return false;
- }
- return true;
-}
-
-
// TODO(bbudge): Make this consistent with SIMD instruction results.
inline float RecipApprox(float a) { return 1.0f / a; }
@@ -148,22 +140,11 @@ RUNTIME_FUNCTION(Runtime_SimdToObject) {
RUNTIME_FUNCTION(Runtime_SimdEquals) {
- HandleScope scope(isolate);
- DCHECK(args.length() == 2);
- CONVERT_ARG_HANDLE_CHECKED(Simd128Value, a, 0);
- bool result = false;
- // args[1] is of unknown type.
- if (args[1]->IsSimd128Value()) {
- Simd128Value* b = Simd128Value::cast(args[1]);
- if (a->map() == b->map()) {
- if (a->IsFloat32x4()) {
- result = Equals(Float32x4::cast(*a), Float32x4::cast(b));
- } else {
- result = a->BitwiseEquals(b);
- }
- }
- }
- return Smi::FromInt(result ? EQUAL : NOT_EQUAL);
+ SealHandleScope scope(isolate);
+ DCHECK_EQ(2, args.length());
+ CONVERT_ARG_CHECKED(Simd128Value, x, 0);
+ CONVERT_ARG_CHECKED(Simd128Value, y, 1);
+ return Smi::FromInt(x->Equals(y) ? EQUAL : NOT_EQUAL);
}
« src/api.cc ('K') | « src/runtime/runtime-object.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698