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

Side by Side Diff: src/runtime/runtime-simd.cc

Issue 1273353003: [simd.js] Single SIMD128_VALUE_TYPE for all Simd128Values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix slow check failures. REBASE. 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 unified diff | Download patch
« no previous file with comments | « src/objects-printer.cc ('k') | src/type-info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/base/macros.h" 8 #include "src/base/macros.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 149
150 RUNTIME_FUNCTION(Runtime_SimdEquals) { 150 RUNTIME_FUNCTION(Runtime_SimdEquals) {
151 HandleScope scope(isolate); 151 HandleScope scope(isolate);
152 DCHECK(args.length() == 2); 152 DCHECK(args.length() == 2);
153 CONVERT_ARG_HANDLE_CHECKED(Simd128Value, a, 0); 153 CONVERT_ARG_HANDLE_CHECKED(Simd128Value, a, 0);
154 bool result = false; 154 bool result = false;
155 // args[1] is of unknown type. 155 // args[1] is of unknown type.
156 if (args[1]->IsSimd128Value()) { 156 if (args[1]->IsSimd128Value()) {
157 Simd128Value* b = Simd128Value::cast(args[1]); 157 Simd128Value* b = Simd128Value::cast(args[1]);
158 if (a->map()->instance_type() == b->map()->instance_type()) { 158 if (a->map() == b->map()) {
159 if (a->IsFloat32x4()) { 159 if (a->IsFloat32x4()) {
160 result = Equals(Float32x4::cast(*a), Float32x4::cast(b)); 160 result = Equals(Float32x4::cast(*a), Float32x4::cast(b));
161 } else { 161 } else {
162 result = a->BitwiseEquals(b); 162 result = a->BitwiseEquals(b);
163 } 163 }
164 } 164 }
165 } 165 }
166 return Smi::FromInt(result ? EQUAL : NOT_EQUAL); 166 return Smi::FromInt(result ? EQUAL : NOT_EQUAL);
167 } 167 }
168 168
169 169
170 RUNTIME_FUNCTION(Runtime_SimdSameValue) { 170 RUNTIME_FUNCTION(Runtime_SimdSameValue) {
171 HandleScope scope(isolate); 171 HandleScope scope(isolate);
172 DCHECK(args.length() == 2); 172 DCHECK(args.length() == 2);
173 CONVERT_ARG_HANDLE_CHECKED(Simd128Value, a, 0); 173 CONVERT_ARG_HANDLE_CHECKED(Simd128Value, a, 0);
174 bool result = false; 174 bool result = false;
175 // args[1] is of unknown type. 175 // args[1] is of unknown type.
176 if (args[1]->IsSimd128Value()) { 176 if (args[1]->IsSimd128Value()) {
177 Simd128Value* b = Simd128Value::cast(args[1]); 177 Simd128Value* b = Simd128Value::cast(args[1]);
178 if (a->map()->instance_type() == b->map()->instance_type()) { 178 if (a->map() == b->map()) {
179 if (a->IsFloat32x4()) { 179 if (a->IsFloat32x4()) {
180 result = Float32x4::cast(*a)->SameValue(Float32x4::cast(b)); 180 result = Float32x4::cast(*a)->SameValue(Float32x4::cast(b));
181 } else { 181 } else {
182 result = a->BitwiseEquals(b); 182 result = a->BitwiseEquals(b);
183 } 183 }
184 } 184 }
185 } 185 }
186 return isolate->heap()->ToBoolean(result); 186 return isolate->heap()->ToBoolean(result);
187 } 187 }
188 188
189 189
190 RUNTIME_FUNCTION(Runtime_SimdSameValueZero) { 190 RUNTIME_FUNCTION(Runtime_SimdSameValueZero) {
191 HandleScope scope(isolate); 191 HandleScope scope(isolate);
192 DCHECK(args.length() == 2); 192 DCHECK(args.length() == 2);
193 CONVERT_ARG_HANDLE_CHECKED(Simd128Value, a, 0); 193 CONVERT_ARG_HANDLE_CHECKED(Simd128Value, a, 0);
194 bool result = false; 194 bool result = false;
195 // args[1] is of unknown type. 195 // args[1] is of unknown type.
196 if (args[1]->IsSimd128Value()) { 196 if (args[1]->IsSimd128Value()) {
197 Simd128Value* b = Simd128Value::cast(args[1]); 197 Simd128Value* b = Simd128Value::cast(args[1]);
198 if (a->map()->instance_type() == b->map()->instance_type()) { 198 if (a->map() == b->map()) {
199 if (a->IsFloat32x4()) { 199 if (a->IsFloat32x4()) {
200 result = Float32x4::cast(*a)->SameValueZero(Float32x4::cast(b)); 200 result = Float32x4::cast(*a)->SameValueZero(Float32x4::cast(b));
201 } else { 201 } else {
202 result = a->BitwiseEquals(b); 202 result = a->BitwiseEquals(b);
203 } 203 }
204 } 204 }
205 } 205 }
206 return isolate->heap()->ToBoolean(result); 206 return isolate->heap()->ToBoolean(result);
207 } 207 }
208 208
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 830
831 RUNTIME_FUNCTION(Runtime_Int8x16UnsignedExtractLane) { 831 RUNTIME_FUNCTION(Runtime_Int8x16UnsignedExtractLane) {
832 HandleScope scope(isolate); 832 HandleScope scope(isolate);
833 DCHECK(args.length() == 2); 833 DCHECK(args.length() == 2);
834 CONVERT_ARG_HANDLE_CHECKED(Int8x16, a, 0); 834 CONVERT_ARG_HANDLE_CHECKED(Int8x16, a, 0);
835 CONVERT_SIMD_LANE_ARG_CHECKED(lane, 1, 16); 835 CONVERT_SIMD_LANE_ARG_CHECKED(lane, 1, 16);
836 return *isolate->factory()->NewNumber(bit_cast<uint8_t>(a->get_lane(lane))); 836 return *isolate->factory()->NewNumber(bit_cast<uint8_t>(a->get_lane(lane)));
837 } 837 }
838 } // namespace internal 838 } // namespace internal
839 } // namespace v8 839 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698