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

Side by Side Diff: src/x64/lithium-codegen-x64.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/x64/disasm-x64.cc ('k') | src/x64/lithium-x64.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 5036 matching lines...) Expand 10 before | Expand all | Expand 10 after
5047 5047
5048 // smi 5048 // smi
5049 __ bind(&is_smi); 5049 __ bind(&is_smi);
5050 __ SmiToInteger32(input_reg, input_reg); 5050 __ SmiToInteger32(input_reg, input_reg);
5051 __ ClampUint8(input_reg); 5051 __ ClampUint8(input_reg);
5052 5052
5053 __ bind(&done); 5053 __ bind(&done);
5054 } 5054 }
5055 5055
5056 5056
5057 void LCodeGen::DoDoubleBits(LDoubleBits* instr) {
5058 XMMRegister value_reg = ToDoubleRegister(instr->value());
5059 Register result_reg = ToRegister(instr->result());
5060 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) {
5061 __ movq(result_reg, value_reg);
5062 __ shr(result_reg, Immediate(32));
5063 } else {
5064 __ movd(result_reg, value_reg);
5065 }
5066 }
5067
5068
5069 void LCodeGen::DoConstructDouble(LConstructDouble* instr) {
5070 Register hi_reg = ToRegister(instr->hi());
5071 Register lo_reg = ToRegister(instr->lo());
5072 XMMRegister result_reg = ToDoubleRegister(instr->result());
5073 XMMRegister xmm_scratch = double_scratch0();
5074 __ movd(result_reg, hi_reg);
5075 __ psllq(result_reg, 32);
5076 __ movd(xmm_scratch, lo_reg);
5077 __ orps(result_reg, xmm_scratch);
5078 }
5079
5080
5057 void LCodeGen::DoAllocate(LAllocate* instr) { 5081 void LCodeGen::DoAllocate(LAllocate* instr) {
5058 class DeferredAllocate V8_FINAL : public LDeferredCode { 5082 class DeferredAllocate V8_FINAL : public LDeferredCode {
5059 public: 5083 public:
5060 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) 5084 DeferredAllocate(LCodeGen* codegen, LAllocate* instr)
5061 : LDeferredCode(codegen), instr_(instr) { } 5085 : LDeferredCode(codegen), instr_(instr) { }
5062 virtual void Generate() V8_OVERRIDE { 5086 virtual void Generate() V8_OVERRIDE {
5063 codegen()->DoDeferredAllocate(instr_); 5087 codegen()->DoDeferredAllocate(instr_);
5064 } 5088 }
5065 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 5089 virtual LInstruction* instr() V8_OVERRIDE { return instr_; }
5066 private: 5090 private:
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
5587 FixedArray::kHeaderSize - kPointerSize)); 5611 FixedArray::kHeaderSize - kPointerSize));
5588 __ bind(&done); 5612 __ bind(&done);
5589 } 5613 }
5590 5614
5591 5615
5592 #undef __ 5616 #undef __
5593 5617
5594 } } // namespace v8::internal 5618 } } // namespace v8::internal
5595 5619
5596 #endif // V8_TARGET_ARCH_X64 5620 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/disasm-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698