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

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

Issue 189963005: Revert "Handle non-power-of-2 divisors in division-like operations", "A64 tweaks for division-like … (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/x64/macro-assembler-x64.h ('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 4961 matching lines...) Expand 10 before | Expand all | Expand 10 after
4972 and_(scratch1, Immediate(Map::kElementsKindMask)); 4972 and_(scratch1, Immediate(Map::kElementsKindMask));
4973 shr(scratch1, Immediate(Map::kElementsKindShift)); 4973 shr(scratch1, Immediate(Map::kElementsKindShift));
4974 cmpq(scratch1, Immediate(DICTIONARY_ELEMENTS)); 4974 cmpq(scratch1, Immediate(DICTIONARY_ELEMENTS));
4975 j(equal, found); 4975 j(equal, found);
4976 movp(current, FieldOperand(current, Map::kPrototypeOffset)); 4976 movp(current, FieldOperand(current, Map::kPrototypeOffset));
4977 CompareRoot(current, Heap::kNullValueRootIndex); 4977 CompareRoot(current, Heap::kNullValueRootIndex);
4978 j(not_equal, &loop_again); 4978 j(not_equal, &loop_again);
4979 } 4979 }
4980 4980
4981 4981
4982 void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) {
4983 ASSERT(!dividend.is(rax));
4984 ASSERT(!dividend.is(rdx));
4985 MultiplierAndShift ms(divisor);
4986 movl(rax, Immediate(ms.multiplier()));
4987 imull(dividend);
4988 if (divisor > 0 && ms.multiplier() < 0) addl(rdx, dividend);
4989 if (divisor < 0 && ms.multiplier() > 0) subl(rdx, dividend);
4990 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift()));
4991 movl(rax, dividend);
4992 shrl(rax, Immediate(31));
4993 addl(rdx, rax);
4994 }
4995
4996
4997 } } // namespace v8::internal 4982 } } // namespace v8::internal
4998 4983
4999 #endif // V8_TARGET_ARCH_X64 4984 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698