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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 12177012: Small improvement in x64 assembler (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 10 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
« src/x64/assembler-x64.cc ('K') | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after
2904 jmp(&done, Label::kNear); 2904 jmp(&done, Label::kNear);
2905 bind(&conv_failure); 2905 bind(&conv_failure);
2906 Set(result_reg, 0); 2906 Set(result_reg, 0);
2907 ucomisd(input_reg, temp_xmm_reg); 2907 ucomisd(input_reg, temp_xmm_reg);
2908 j(below, &done, Label::kNear); 2908 j(below, &done, Label::kNear);
2909 Set(result_reg, 255); 2909 Set(result_reg, 255);
2910 bind(&done); 2910 bind(&done);
2911 } 2911 }
2912 2912
2913 2913
2914 static double kUint32Bias =
2915 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1;
2916
2917
2918 void MacroAssembler::LoadUint32(XMMRegister dst, 2914 void MacroAssembler::LoadUint32(XMMRegister dst,
2919 Register src, 2915 Register src,
2920 XMMRegister scratch) { 2916 XMMRegister scratch) {
2921 Label done; 2917 if (FLAG_debug_code) {
2922 cmpl(src, Immediate(0)); 2918 cmpq(src, Immediate(0xffffffff));
2923 movq(kScratchRegister, 2919 Assert(below_equal, "input GPR is expected to have upper32 cleared");
2924 reinterpret_cast<int64_t>(&kUint32Bias), 2920 }
2925 RelocInfo::NONE64); 2921 cvtqsi2sd(dst, src);
Yang 2013/02/06 10:28:59 The uses of this indicate that the input is indeed
2926 movsd(scratch, Operand(kScratchRegister, 0));
2927 cvtlsi2sd(dst, src);
2928 j(not_sign, &done, Label::kNear);
2929 addsd(dst, scratch);
2930 bind(&done);
2931 } 2922 }
2932 2923
2933 2924
2934 void MacroAssembler::LoadInstanceDescriptors(Register map, 2925 void MacroAssembler::LoadInstanceDescriptors(Register map,
2935 Register descriptors) { 2926 Register descriptors) {
2936 movq(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); 2927 movq(descriptors, FieldOperand(map, Map::kDescriptorsOffset));
2937 } 2928 }
2938 2929
2939 2930
2940 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { 2931 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) {
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
4624 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), 4615 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize),
4625 Heap::kAllocationSiteInfoMapRootIndex); 4616 Heap::kAllocationSiteInfoMapRootIndex);
4626 j(equal, allocation_info_present); 4617 j(equal, allocation_info_present);
4627 bind(&no_info_available); 4618 bind(&no_info_available);
4628 } 4619 }
4629 4620
4630 4621
4631 } } // namespace v8::internal 4622 } } // namespace v8::internal
4632 4623
4633 #endif // V8_TARGET_ARCH_X64 4624 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/x64/assembler-x64.cc ('K') | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698