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

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

Issue 190383002: Handle non-power-of-2 divisors in division-like operations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased 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/macro-assembler-a64.h ('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 4914 matching lines...) Expand 10 before | Expand all | Expand 10 after
4925 if (!initialized) { 4925 if (!initialized) {
4926 PatchingAssembler patcher(old, length); 4926 PatchingAssembler patcher(old, length);
4927 MacroAssembler::EmitCodeAgeSequence(&patcher, NULL); 4927 MacroAssembler::EmitCodeAgeSequence(&patcher, NULL);
4928 initialized = true; 4928 initialized = true;
4929 } 4929 }
4930 return memcmp(sequence, old, kCodeAgeStubEntryOffset) == 0; 4930 return memcmp(sequence, old, kCodeAgeStubEntryOffset) == 0;
4931 } 4931 }
4932 #endif 4932 #endif
4933 4933
4934 4934
4935 void MacroAssembler::FlooringDiv(Register result,
4936 Register dividend,
4937 int32_t divisor) {
4938 Register tmp = WTmp0();
4939 ASSERT(!AreAliased(dividend, result, tmp));
4940 MultiplierAndShift ms(divisor);
4941 Mov(tmp, Operand(ms.multiplier()));
4942 Smull(result.X(), dividend, tmp);
4943 Mov(result.X(), Operand(result.X(), ASR, 32));
4944 if (divisor > 0 && ms.multiplier() < 0) {
4945 Add(result, result, Operand(dividend));
4946 }
4947 if (divisor < 0 && ms.multiplier() > 0) {
4948 Sub(result, result, Operand(dividend));
4949 }
4950 if (ms.shift() > 0) Mov(result, Operand(result, ASR, ms.shift()));
4951 Add(result, result, Operand(dividend, LSR, 31));
4952 }
4953
4954
4935 #undef __ 4955 #undef __
4936 #define __ masm-> 4956 #define __ masm->
4937 4957
4938 4958
4939 void InlineSmiCheckInfo::Emit(MacroAssembler* masm, const Register& reg, 4959 void InlineSmiCheckInfo::Emit(MacroAssembler* masm, const Register& reg,
4940 const Label* smi_check) { 4960 const Label* smi_check) {
4941 Assembler::BlockPoolsScope scope(masm); 4961 Assembler::BlockPoolsScope scope(masm);
4942 if (reg.IsValid()) { 4962 if (reg.IsValid()) {
4943 ASSERT(smi_check->is_bound()); 4963 ASSERT(smi_check->is_bound());
4944 ASSERT(reg.Is64Bits()); 4964 ASSERT(reg.Is64Bits());
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4977 } 4997 }
4978 } 4998 }
4979 4999
4980 5000
4981 #undef __ 5001 #undef __
4982 5002
4983 5003
4984 } } // namespace v8::internal 5004 } } // namespace v8::internal
4985 5005
4986 #endif // V8_TARGET_ARCH_A64 5006 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « src/a64/macro-assembler-a64.h ('k') | src/arm/lithium-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698