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

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

Issue 6874007: Implement hardfloat calling convention in macro assembler and simulator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor edits. 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
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 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 __ vmul(left, left, right); 1334 __ vmul(left, left, right);
1335 break; 1335 break;
1336 case Token::DIV: 1336 case Token::DIV:
1337 __ vdiv(left, left, right); 1337 __ vdiv(left, left, right);
1338 break; 1338 break;
1339 case Token::MOD: { 1339 case Token::MOD: {
1340 // Save r0-r3 on the stack. 1340 // Save r0-r3 on the stack.
1341 __ stm(db_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); 1341 __ stm(db_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit());
1342 1342
1343 __ PrepareCallCFunction(4, scratch0()); 1343 __ PrepareCallCFunction(4, scratch0());
1344 __ vmov(r0, r1, left); 1344 __ SetCallCDoubleArguments(left, right);
1345 __ vmov(r2, r3, right);
1346 __ CallCFunction( 1345 __ CallCFunction(
1347 ExternalReference::double_fp_operation(Token::MOD, isolate()), 4); 1346 ExternalReference::double_fp_operation(Token::MOD, isolate()), 4);
1348 // Move the result in the double result register. 1347 // Move the result in the double result register.
1349 __ GetCFunctionDoubleResult(ToDoubleRegister(instr->result())); 1348 __ GetCFunctionDoubleResult(ToDoubleRegister(instr->result()));
1350 1349
1351 // Restore r0-r3. 1350 // Restore r0-r3.
1352 __ ldm(ia_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); 1351 __ ldm(ia_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit());
1353 break; 1352 break;
1354 } 1353 }
1355 default: 1354 default:
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2955 2954
2956 void LCodeGen::DoPower(LPower* instr) { 2955 void LCodeGen::DoPower(LPower* instr) {
2957 LOperand* left = instr->InputAt(0); 2956 LOperand* left = instr->InputAt(0);
2958 LOperand* right = instr->InputAt(1); 2957 LOperand* right = instr->InputAt(1);
2959 Register scratch = scratch0(); 2958 Register scratch = scratch0();
2960 DoubleRegister result_reg = ToDoubleRegister(instr->result()); 2959 DoubleRegister result_reg = ToDoubleRegister(instr->result());
2961 Representation exponent_type = instr->hydrogen()->right()->representation(); 2960 Representation exponent_type = instr->hydrogen()->right()->representation();
2962 if (exponent_type.IsDouble()) { 2961 if (exponent_type.IsDouble()) {
2963 // Prepare arguments and call C function. 2962 // Prepare arguments and call C function.
2964 __ PrepareCallCFunction(4, scratch); 2963 __ PrepareCallCFunction(4, scratch);
2965 __ vmov(r0, r1, ToDoubleRegister(left)); 2964 __ SetCallCDoubleArguments(ToDoubleRegister(left),
2966 __ vmov(r2, r3, ToDoubleRegister(right)); 2965 ToDoubleRegister(right));
2967 __ CallCFunction( 2966 __ CallCFunction(
2968 ExternalReference::power_double_double_function(isolate()), 4); 2967 ExternalReference::power_double_double_function(isolate()), 4);
2969 } else if (exponent_type.IsInteger32()) { 2968 } else if (exponent_type.IsInteger32()) {
2970 ASSERT(ToRegister(right).is(r0)); 2969 ASSERT(ToRegister(right).is(r0));
2971 // Prepare arguments and call C function. 2970 // Prepare arguments and call C function.
2972 __ PrepareCallCFunction(4, scratch); 2971 __ PrepareCallCFunction(3, scratch);
2973 __ mov(r2, ToRegister(right)); 2972 __ SetCallCDoubleArguments(ToDoubleRegister(left), ToRegister(right));
2974 __ vmov(r0, r1, ToDoubleRegister(left));
2975 __ CallCFunction( 2973 __ CallCFunction(
2976 ExternalReference::power_double_int_function(isolate()), 4); 2974 ExternalReference::power_double_int_function(isolate()), 3);
2977 } else { 2975 } else {
2978 ASSERT(exponent_type.IsTagged()); 2976 ASSERT(exponent_type.IsTagged());
2979 ASSERT(instr->hydrogen()->left()->representation().IsDouble()); 2977 ASSERT(instr->hydrogen()->left()->representation().IsDouble());
2980 2978
2981 Register right_reg = ToRegister(right); 2979 Register right_reg = ToRegister(right);
2982 2980
2983 // Check for smi on the right hand side. 2981 // Check for smi on the right hand side.
2984 Label non_smi, call; 2982 Label non_smi, call;
2985 __ JumpIfNotSmi(right_reg, &non_smi); 2983 __ JumpIfNotSmi(right_reg, &non_smi);
2986 2984
(...skipping 10 matching lines...) Expand all
2997 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); 2995 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
2998 __ cmp(scratch, Operand(ip)); 2996 __ cmp(scratch, Operand(ip));
2999 DeoptimizeIf(ne, instr->environment()); 2997 DeoptimizeIf(ne, instr->environment());
3000 int32_t value_offset = HeapNumber::kValueOffset - kHeapObjectTag; 2998 int32_t value_offset = HeapNumber::kValueOffset - kHeapObjectTag;
3001 __ add(scratch, right_reg, Operand(value_offset)); 2999 __ add(scratch, right_reg, Operand(value_offset));
3002 __ vldr(result_reg, scratch, 0); 3000 __ vldr(result_reg, scratch, 0);
3003 3001
3004 // Prepare arguments and call C function. 3002 // Prepare arguments and call C function.
3005 __ bind(&call); 3003 __ bind(&call);
3006 __ PrepareCallCFunction(4, scratch); 3004 __ PrepareCallCFunction(4, scratch);
3007 __ vmov(r0, r1, ToDoubleRegister(left)); 3005 __ SetCallCDoubleArguments(ToDoubleRegister(left), result_reg);
3008 __ vmov(r2, r3, result_reg);
3009 __ CallCFunction( 3006 __ CallCFunction(
3010 ExternalReference::power_double_double_function(isolate()), 4); 3007 ExternalReference::power_double_double_function(isolate()), 4);
3011 } 3008 }
3012 // Store the result in the result register. 3009 // Store the result in the result register.
3013 __ GetCFunctionDoubleResult(result_reg); 3010 __ GetCFunctionDoubleResult(result_reg);
3014 } 3011 }
3015 3012
3016 3013
3017 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { 3014 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) {
3018 ASSERT(ToDoubleRegister(instr->result()).is(d2)); 3015 ASSERT(ToDoubleRegister(instr->result()).is(d2));
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 ASSERT(!environment->HasBeenRegistered()); 4279 ASSERT(!environment->HasBeenRegistered());
4283 RegisterEnvironmentForDeoptimization(environment); 4280 RegisterEnvironmentForDeoptimization(environment);
4284 ASSERT(osr_pc_offset_ == -1); 4281 ASSERT(osr_pc_offset_ == -1);
4285 osr_pc_offset_ = masm()->pc_offset(); 4282 osr_pc_offset_ = masm()->pc_offset();
4286 } 4283 }
4287 4284
4288 4285
4289 #undef __ 4286 #undef __
4290 4287
4291 } } // namespace v8::internal 4288 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698