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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 2809012: Change hash computation for transcendental cache to use arithmetic... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 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/ia32/codegen-ia32.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 8159 matching lines...) Expand 10 before | Expand all | Expand 10 after
8170 __ j(not_equal, &runtime_call); 8170 __ j(not_equal, &runtime_call);
8171 // Input is a HeapNumber. Push it on the FPU stack and load its 8171 // Input is a HeapNumber. Push it on the FPU stack and load its
8172 // bits into rbx. 8172 // bits into rbx.
8173 __ fld_d(FieldOperand(rax, HeapNumber::kValueOffset)); 8173 __ fld_d(FieldOperand(rax, HeapNumber::kValueOffset));
8174 __ movq(rbx, FieldOperand(rax, HeapNumber::kValueOffset)); 8174 __ movq(rbx, FieldOperand(rax, HeapNumber::kValueOffset));
8175 __ movq(rdx, rbx); 8175 __ movq(rdx, rbx);
8176 __ bind(&loaded); 8176 __ bind(&loaded);
8177 // ST[0] == double value 8177 // ST[0] == double value
8178 // rbx = bits of double value. 8178 // rbx = bits of double value.
8179 // rdx = also bits of double value. 8179 // rdx = also bits of double value.
8180 // Compute hash (h is 32 bits, bits are 64): 8180 // Compute hash (h is 32 bits, bits are 64 and the shifts are arithmetic):
8181 // h = h0 = bits ^ (bits >> 32); 8181 // h = h0 = bits ^ (bits >> 32);
8182 // h ^= h >> 16; 8182 // h ^= h >> 16;
8183 // h ^= h >> 8; 8183 // h ^= h >> 8;
8184 // h = h & (cacheSize - 1); 8184 // h = h & (cacheSize - 1);
8185 // or h = (h0 ^ (h0 >> 8) ^ (h0 >> 16) ^ (h0 >> 24)) & (cacheSize - 1) 8185 // or h = (h0 ^ (h0 >> 8) ^ (h0 >> 16) ^ (h0 >> 24)) & (cacheSize - 1)
8186 __ sar(rdx, Immediate(32)); 8186 __ sar(rdx, Immediate(32));
8187 __ xorl(rdx, rbx); 8187 __ xorl(rdx, rbx);
8188 __ movl(rcx, rdx); 8188 __ movl(rcx, rdx);
8189 __ movl(rax, rdx); 8189 __ movl(rax, rdx);
8190 __ movl(rdi, rdx); 8190 __ movl(rdi, rdx);
8191 __ shrl(rdx, Immediate(8)); 8191 __ sarl(rdx, Immediate(8));
8192 __ shrl(rcx, Immediate(16)); 8192 __ sarl(rcx, Immediate(16));
8193 __ shrl(rax, Immediate(24)); 8193 __ sarl(rax, Immediate(24));
8194 __ xorl(rcx, rdx); 8194 __ xorl(rcx, rdx);
8195 __ xorl(rax, rdi); 8195 __ xorl(rax, rdi);
8196 __ xorl(rcx, rax); 8196 __ xorl(rcx, rax);
8197 ASSERT(IsPowerOf2(TranscendentalCache::kCacheSize)); 8197 ASSERT(IsPowerOf2(TranscendentalCache::kCacheSize));
8198 __ andl(rcx, Immediate(TranscendentalCache::kCacheSize - 1)); 8198 __ andl(rcx, Immediate(TranscendentalCache::kCacheSize - 1));
8199 8199
8200 // ST[0] == double value. 8200 // ST[0] == double value.
8201 // rbx = bits of double value. 8201 // rbx = bits of double value.
8202 // rcx = TranscendentalCache::hash(double value). 8202 // rcx = TranscendentalCache::hash(double value).
8203 __ movq(rax, ExternalReference::transcendental_cache_array_address()); 8203 __ movq(rax, ExternalReference::transcendental_cache_array_address());
(...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after
11944 } 11944 }
11945 11945
11946 #endif 11946 #endif
11947 11947
11948 11948
11949 #undef __ 11949 #undef __
11950 11950
11951 } } // namespace v8::internal 11951 } } // namespace v8::internal
11952 11952
11953 #endif // V8_TARGET_ARCH_X64 11953 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698