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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 6879009: Support Float64Arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm/stub-cache-arm.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2472 LLoadKeyedSpecializedArrayElement* instr) { 2472 LLoadKeyedSpecializedArrayElement* instr) {
2473 Register external_pointer = ToRegister(instr->external_pointer()); 2473 Register external_pointer = ToRegister(instr->external_pointer());
2474 Register key = ToRegister(instr->key()); 2474 Register key = ToRegister(instr->key());
2475 ExternalArrayType array_type = instr->array_type(); 2475 ExternalArrayType array_type = instr->array_type();
2476 if (array_type == kExternalFloatArray) { 2476 if (array_type == kExternalFloatArray) {
2477 CpuFeatures::Scope scope(VFP3); 2477 CpuFeatures::Scope scope(VFP3);
2478 DwVfpRegister result(ToDoubleRegister(instr->result())); 2478 DwVfpRegister result(ToDoubleRegister(instr->result()));
2479 __ add(scratch0(), external_pointer, Operand(key, LSL, 2)); 2479 __ add(scratch0(), external_pointer, Operand(key, LSL, 2));
2480 __ vldr(result.low(), scratch0(), 0); 2480 __ vldr(result.low(), scratch0(), 0);
2481 __ vcvt_f64_f32(result, result.low()); 2481 __ vcvt_f64_f32(result, result.low());
2482 } else if (array_type == kExternalDoubleArray) {
2483 CpuFeatures::Scope scope(VFP3);
2484 DwVfpRegister result(ToDoubleRegister(instr->result()));
2485 __ add(scratch0(), external_pointer, Operand(key, LSL, 3));
2486 __ vldr(result, scratch0(), 0);
2482 } else { 2487 } else {
2483 Register result(ToRegister(instr->result())); 2488 Register result(ToRegister(instr->result()));
2484 switch (array_type) { 2489 switch (array_type) {
2485 case kExternalByteArray: 2490 case kExternalByteArray:
2486 __ ldrsb(result, MemOperand(external_pointer, key)); 2491 __ ldrsb(result, MemOperand(external_pointer, key));
2487 break; 2492 break;
2488 case kExternalUnsignedByteArray: 2493 case kExternalUnsignedByteArray:
2489 case kExternalPixelArray: 2494 case kExternalPixelArray:
2490 __ ldrb(result, MemOperand(external_pointer, key)); 2495 __ ldrb(result, MemOperand(external_pointer, key));
2491 break; 2496 break;
2492 case kExternalShortArray: 2497 case kExternalShortArray:
2493 __ ldrsh(result, MemOperand(external_pointer, key, LSL, 1)); 2498 __ ldrsh(result, MemOperand(external_pointer, key, LSL, 1));
2494 break; 2499 break;
2495 case kExternalUnsignedShortArray: 2500 case kExternalUnsignedShortArray:
2496 __ ldrh(result, MemOperand(external_pointer, key, LSL, 1)); 2501 __ ldrh(result, MemOperand(external_pointer, key, LSL, 1));
2497 break; 2502 break;
2498 case kExternalIntArray: 2503 case kExternalIntArray:
2499 __ ldr(result, MemOperand(external_pointer, key, LSL, 2)); 2504 __ ldr(result, MemOperand(external_pointer, key, LSL, 2));
2500 break; 2505 break;
2501 case kExternalUnsignedIntArray: 2506 case kExternalUnsignedIntArray:
2502 __ ldr(result, MemOperand(external_pointer, key, LSL, 2)); 2507 __ ldr(result, MemOperand(external_pointer, key, LSL, 2));
2503 __ cmp(result, Operand(0x80000000)); 2508 __ cmp(result, Operand(0x80000000));
2504 // TODO(danno): we could be more clever here, perhaps having a special 2509 // TODO(danno): we could be more clever here, perhaps having a special
2505 // version of the stub that detects if the overflow case actually 2510 // version of the stub that detects if the overflow case actually
2506 // happens, and generate code that returns a double rather than int. 2511 // happens, and generate code that returns a double rather than int.
2507 DeoptimizeIf(cs, instr->environment()); 2512 DeoptimizeIf(cs, instr->environment());
2508 break; 2513 break;
2509 case kExternalFloatArray: 2514 case kExternalFloatArray:
2515 case kExternalDoubleArray:
2510 UNREACHABLE(); 2516 UNREACHABLE();
2511 break; 2517 break;
2512 } 2518 }
2513 } 2519 }
2514 } 2520 }
2515 2521
2516 2522
2517 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 2523 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2518 ASSERT(ToRegister(instr->object()).is(r1)); 2524 ASSERT(ToRegister(instr->object()).is(r1));
2519 ASSERT(ToRegister(instr->key()).is(r0)); 2525 ASSERT(ToRegister(instr->key()).is(r0));
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3225 } 3231 }
3226 } 3232 }
3227 3233
3228 3234
3229 void LCodeGen::DoStoreKeyedSpecializedArrayElement( 3235 void LCodeGen::DoStoreKeyedSpecializedArrayElement(
3230 LStoreKeyedSpecializedArrayElement* instr) { 3236 LStoreKeyedSpecializedArrayElement* instr) {
3231 3237
3232 Register external_pointer = ToRegister(instr->external_pointer()); 3238 Register external_pointer = ToRegister(instr->external_pointer());
3233 Register key = ToRegister(instr->key()); 3239 Register key = ToRegister(instr->key());
3234 ExternalArrayType array_type = instr->array_type(); 3240 ExternalArrayType array_type = instr->array_type();
3241
3235 if (array_type == kExternalFloatArray) { 3242 if (array_type == kExternalFloatArray) {
3236 CpuFeatures::Scope scope(VFP3); 3243 CpuFeatures::Scope scope(VFP3);
3237 DwVfpRegister value(ToDoubleRegister(instr->value())); 3244 DwVfpRegister value(ToDoubleRegister(instr->value()));
3238 __ add(scratch0(), external_pointer, Operand(key, LSL, 2)); 3245 __ add(scratch0(), external_pointer, Operand(key, LSL, 2));
3239 __ vcvt_f32_f64(double_scratch0().low(), value); 3246 __ vcvt_f32_f64(double_scratch0().low(), value);
3240 __ vstr(double_scratch0().low(), scratch0(), 0); 3247 __ vstr(double_scratch0().low(), scratch0(), 0);
3248 } else if (array_type == kExternalDoubleArray) {
3249 CpuFeatures::Scope scope(VFP3);
3250 DwVfpRegister value(ToDoubleRegister(instr->value()));
3251 __ add(scratch0(), external_pointer, Operand(key, LSL, 3));
3252 __ vstr(value, scratch0(), 0);
3241 } else { 3253 } else {
3242 Register value(ToRegister(instr->value())); 3254 Register value(ToRegister(instr->value()));
3243 switch (array_type) { 3255 switch (array_type) {
3244 case kExternalPixelArray: 3256 case kExternalPixelArray:
3245 // Clamp the value to [0..255]. 3257 // Clamp the value to [0..255].
3246 __ Usat(value, 8, Operand(value)); 3258 __ Usat(value, 8, Operand(value));
3247 __ strb(value, MemOperand(external_pointer, key)); 3259 __ strb(value, MemOperand(external_pointer, key));
3248 break; 3260 break;
3249 case kExternalByteArray: 3261 case kExternalByteArray:
3250 case kExternalUnsignedByteArray: 3262 case kExternalUnsignedByteArray:
3251 __ strb(value, MemOperand(external_pointer, key)); 3263 __ strb(value, MemOperand(external_pointer, key));
3252 break; 3264 break;
3253 case kExternalShortArray: 3265 case kExternalShortArray:
3254 case kExternalUnsignedShortArray: 3266 case kExternalUnsignedShortArray:
3255 __ strh(value, MemOperand(external_pointer, key, LSL, 1)); 3267 __ strh(value, MemOperand(external_pointer, key, LSL, 1));
3256 break; 3268 break;
3257 case kExternalIntArray: 3269 case kExternalIntArray:
3258 case kExternalUnsignedIntArray: 3270 case kExternalUnsignedIntArray:
3259 __ str(value, MemOperand(external_pointer, key, LSL, 2)); 3271 __ str(value, MemOperand(external_pointer, key, LSL, 2));
3260 break; 3272 break;
3261 case kExternalFloatArray: 3273 case kExternalFloatArray:
3274 case kExternalDoubleArray:
3262 UNREACHABLE(); 3275 UNREACHABLE();
3263 break; 3276 break;
3264 } 3277 }
3265 } 3278 }
3266 } 3279 }
3267 3280
3268 3281
3269 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 3282 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
3270 ASSERT(ToRegister(instr->object()).is(r2)); 3283 ASSERT(ToRegister(instr->object()).is(r2));
3271 ASSERT(ToRegister(instr->key()).is(r1)); 3284 ASSERT(ToRegister(instr->key()).is(r1));
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
4269 ASSERT(!environment->HasBeenRegistered()); 4282 ASSERT(!environment->HasBeenRegistered());
4270 RegisterEnvironmentForDeoptimization(environment); 4283 RegisterEnvironmentForDeoptimization(environment);
4271 ASSERT(osr_pc_offset_ == -1); 4284 ASSERT(osr_pc_offset_ == -1);
4272 osr_pc_offset_ = masm()->pc_offset(); 4285 osr_pc_offset_ = masm()->pc_offset();
4273 } 4286 }
4274 4287
4275 4288
4276 #undef __ 4289 #undef __
4277 4290
4278 } } // namespace v8::internal 4291 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698