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

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

Issue 178583006: Introduce intrinsics for double values in Javascript. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: test Created 6 years, 9 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/a64/lithium-a64.cc ('k') | src/arm/lithium-arm.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 __ Bind(&is_heap_number); 2224 __ Bind(&is_heap_number);
2225 DoubleRegister dbl_scratch = double_scratch(); 2225 DoubleRegister dbl_scratch = double_scratch();
2226 DoubleRegister dbl_scratch2 = ToDoubleRegister(instr->temp2()); 2226 DoubleRegister dbl_scratch2 = ToDoubleRegister(instr->temp2());
2227 __ Ldr(dbl_scratch, FieldMemOperand(input, HeapNumber::kValueOffset)); 2227 __ Ldr(dbl_scratch, FieldMemOperand(input, HeapNumber::kValueOffset));
2228 __ ClampDoubleToUint8(result, dbl_scratch, dbl_scratch2); 2228 __ ClampDoubleToUint8(result, dbl_scratch, dbl_scratch2);
2229 2229
2230 __ Bind(&done); 2230 __ Bind(&done);
2231 } 2231 }
2232 2232
2233 2233
2234 void LCodeGen::DoDoubleBits(LDoubleBits* instr) {
2235 DoubleRegister value_reg = ToDoubleRegister(instr->value());
2236 Register result_reg = ToRegister(instr->result());
2237 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) {
2238 __ Fmov(result_reg, value_reg);
2239 __ Mov(result_reg, Operand(result_reg, LSR, 32));
2240 } else {
2241 __ Fmov(result_reg.W(), value_reg.S());
2242 }
2243 }
2244
2245
2246 void LCodeGen::DoConstructDouble(LConstructDouble* instr) {
2247 Register hi_reg = ToRegister(instr->hi());
2248 Register lo_reg = ToRegister(instr->lo());
2249 Register temp = ToRegister(instr->temp());
2250 DoubleRegister result_reg = ToDoubleRegister(instr->result());
2251
2252 __ And(temp, lo_reg, Operand(0xffffffff));
2253 __ Orr(temp, temp, Operand(hi_reg, LSL, 32));
2254 __ Fmov(result_reg, temp);
2255 }
2256
2257
2234 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { 2258 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
2235 Handle<String> class_name = instr->hydrogen()->class_name(); 2259 Handle<String> class_name = instr->hydrogen()->class_name();
2236 Label* true_label = instr->TrueLabel(chunk_); 2260 Label* true_label = instr->TrueLabel(chunk_);
2237 Label* false_label = instr->FalseLabel(chunk_); 2261 Label* false_label = instr->FalseLabel(chunk_);
2238 Register input = ToRegister(instr->value()); 2262 Register input = ToRegister(instr->value());
2239 Register scratch1 = ToRegister(instr->temp1()); 2263 Register scratch1 = ToRegister(instr->temp1());
2240 Register scratch2 = ToRegister(instr->temp2()); 2264 Register scratch2 = ToRegister(instr->temp2());
2241 2265
2242 __ JumpIfSmi(input, false_label); 2266 __ JumpIfSmi(input, false_label);
2243 2267
(...skipping 3429 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 __ Bind(&out_of_object); 5697 __ Bind(&out_of_object);
5674 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5698 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5675 // Index is equal to negated out of object property index plus 1. 5699 // Index is equal to negated out of object property index plus 1.
5676 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5700 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5677 __ Ldr(result, FieldMemOperand(result, 5701 __ Ldr(result, FieldMemOperand(result,
5678 FixedArray::kHeaderSize - kPointerSize)); 5702 FixedArray::kHeaderSize - kPointerSize));
5679 __ Bind(&done); 5703 __ Bind(&done);
5680 } 5704 }
5681 5705
5682 } } // namespace v8::internal 5706 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | src/arm/lithium-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698