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

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

Issue 189823003: Reland "Introduce intrinsics for double values in Javascript." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 __ Bind(&is_heap_number); 2222 __ Bind(&is_heap_number);
2223 DoubleRegister dbl_scratch = double_scratch(); 2223 DoubleRegister dbl_scratch = double_scratch();
2224 DoubleRegister dbl_scratch2 = ToDoubleRegister(instr->temp2()); 2224 DoubleRegister dbl_scratch2 = ToDoubleRegister(instr->temp2());
2225 __ Ldr(dbl_scratch, FieldMemOperand(input, HeapNumber::kValueOffset)); 2225 __ Ldr(dbl_scratch, FieldMemOperand(input, HeapNumber::kValueOffset));
2226 __ ClampDoubleToUint8(result, dbl_scratch, dbl_scratch2); 2226 __ ClampDoubleToUint8(result, dbl_scratch, dbl_scratch2);
2227 2227
2228 __ Bind(&done); 2228 __ Bind(&done);
2229 } 2229 }
2230 2230
2231 2231
2232 void LCodeGen::DoDoubleBits(LDoubleBits* instr) {
2233 DoubleRegister value_reg = ToDoubleRegister(instr->value());
2234 Register result_reg = ToRegister(instr->result());
2235 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) {
2236 __ Fmov(result_reg, value_reg);
2237 __ Mov(result_reg, Operand(result_reg, LSR, 32));
2238 } else {
2239 __ Fmov(result_reg.W(), value_reg.S());
2240 }
2241 }
2242
2243
2244 void LCodeGen::DoConstructDouble(LConstructDouble* instr) {
2245 Register hi_reg = ToRegister(instr->hi());
2246 Register lo_reg = ToRegister(instr->lo());
2247 Register temp = ToRegister(instr->temp());
2248 DoubleRegister result_reg = ToDoubleRegister(instr->result());
2249
2250 __ And(temp, lo_reg, Operand(0xffffffff));
2251 __ Orr(temp, temp, Operand(hi_reg, LSL, 32));
2252 __ Fmov(result_reg, temp);
2253 }
2254
2255
2232 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { 2256 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
2233 Handle<String> class_name = instr->hydrogen()->class_name(); 2257 Handle<String> class_name = instr->hydrogen()->class_name();
2234 Label* true_label = instr->TrueLabel(chunk_); 2258 Label* true_label = instr->TrueLabel(chunk_);
2235 Label* false_label = instr->FalseLabel(chunk_); 2259 Label* false_label = instr->FalseLabel(chunk_);
2236 Register input = ToRegister(instr->value()); 2260 Register input = ToRegister(instr->value());
2237 Register scratch1 = ToRegister(instr->temp1()); 2261 Register scratch1 = ToRegister(instr->temp1());
2238 Register scratch2 = ToRegister(instr->temp2()); 2262 Register scratch2 = ToRegister(instr->temp2());
2239 2263
2240 __ JumpIfSmi(input, false_label); 2264 __ JumpIfSmi(input, false_label);
2241 2265
(...skipping 3560 matching lines...) Expand 10 before | Expand all | Expand 10 after
5802 __ Bind(&out_of_object); 5826 __ Bind(&out_of_object);
5803 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5827 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5804 // Index is equal to negated out of object property index plus 1. 5828 // Index is equal to negated out of object property index plus 1.
5805 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5829 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5806 __ Ldr(result, FieldMemOperand(result, 5830 __ Ldr(result, FieldMemOperand(result,
5807 FixedArray::kHeaderSize - kPointerSize)); 5831 FixedArray::kHeaderSize - kPointerSize));
5808 __ Bind(&done); 5832 __ Bind(&done);
5809 } 5833 }
5810 5834
5811 } } // namespace v8::internal 5835 } } // 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