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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 6910021: Cleanup: use xorps to zero out an xmm register on ia32 too. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 9 years, 7 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/assembler-ia32.cc ('k') | src/ia32/disasm-ia32.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2873 // Load xmm2 with -0.5. 2873 // Load xmm2 with -0.5.
2874 __ mov(ecx, Immediate(0xBF000000)); 2874 __ mov(ecx, Immediate(0xBF000000));
2875 __ movd(xmm2, Operand(ecx)); 2875 __ movd(xmm2, Operand(ecx));
2876 __ cvtss2sd(xmm2, xmm2); 2876 __ cvtss2sd(xmm2, xmm2);
2877 // xmm2 now has -0.5. 2877 // xmm2 now has -0.5.
2878 __ ucomisd(xmm2, xmm1); 2878 __ ucomisd(xmm2, xmm1);
2879 __ j(not_equal, &not_minus_half); 2879 __ j(not_equal, &not_minus_half);
2880 2880
2881 // Calculates reciprocal of square root. 2881 // Calculates reciprocal of square root.
2882 // sqrtsd returns -0 when input is -0. ECMA spec requires +0. 2882 // sqrtsd returns -0 when input is -0. ECMA spec requires +0.
2883 __ xorpd(xmm1, xmm1); 2883 __ xorps(xmm1, xmm1);
2884 __ addsd(xmm1, xmm0); 2884 __ addsd(xmm1, xmm0);
2885 __ sqrtsd(xmm1, xmm1); 2885 __ sqrtsd(xmm1, xmm1);
2886 __ divsd(xmm3, xmm1); 2886 __ divsd(xmm3, xmm1);
2887 __ movsd(xmm1, xmm3); 2887 __ movsd(xmm1, xmm3);
2888 __ jmp(&allocate_return); 2888 __ jmp(&allocate_return);
2889 2889
2890 // Test for 0.5. 2890 // Test for 0.5.
2891 __ bind(&not_minus_half); 2891 __ bind(&not_minus_half);
2892 // Load xmm2 with 0.5. 2892 // Load xmm2 with 0.5.
2893 // Since xmm3 is 1 and xmm2 is -0.5 this is simply xmm2 + xmm3. 2893 // Since xmm3 is 1 and xmm2 is -0.5 this is simply xmm2 + xmm3.
2894 __ addsd(xmm2, xmm3); 2894 __ addsd(xmm2, xmm3);
2895 // xmm2 now has 0.5. 2895 // xmm2 now has 0.5.
2896 __ ucomisd(xmm2, xmm1); 2896 __ ucomisd(xmm2, xmm1);
2897 __ j(not_equal, &call_runtime); 2897 __ j(not_equal, &call_runtime);
2898 // Calculates square root. 2898 // Calculates square root.
2899 // sqrtsd returns -0 when input is -0. ECMA spec requires +0. 2899 // sqrtsd returns -0 when input is -0. ECMA spec requires +0.
2900 __ xorpd(xmm1, xmm1); 2900 __ xorps(xmm1, xmm1);
2901 __ addsd(xmm1, xmm0); 2901 __ addsd(xmm1, xmm0);
2902 __ sqrtsd(xmm1, xmm1); 2902 __ sqrtsd(xmm1, xmm1);
2903 2903
2904 __ bind(&allocate_return); 2904 __ bind(&allocate_return);
2905 __ AllocateHeapNumber(ecx, eax, edx, &call_runtime); 2905 __ AllocateHeapNumber(ecx, eax, edx, &call_runtime);
2906 __ movdbl(FieldOperand(ecx, HeapNumber::kValueOffset), xmm1); 2906 __ movdbl(FieldOperand(ecx, HeapNumber::kValueOffset), xmm1);
2907 __ mov(eax, ecx); 2907 __ mov(eax, ecx);
2908 __ ret(2 * kPointerSize); 2908 __ ret(2 * kPointerSize);
2909 2909
2910 __ bind(&call_runtime); 2910 __ bind(&call_runtime);
(...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
5857 // Do a tail call to the rewritten stub. 5857 // Do a tail call to the rewritten stub.
5858 __ jmp(Operand(edi)); 5858 __ jmp(Operand(edi));
5859 } 5859 }
5860 5860
5861 5861
5862 #undef __ 5862 #undef __
5863 5863
5864 } } // namespace v8::internal 5864 } } // namespace v8::internal
5865 5865
5866 #endif // V8_TARGET_ARCH_IA32 5866 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698