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

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 11190049: Improve ClampDoubleToUint8 on ia32/x64 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 2 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 | « no previous file | src/ia32/macro-assembler-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 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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 LCheckMaps* result = new(zone()) LCheckMaps(value); 1772 LCheckMaps* result = new(zone()) LCheckMaps(value);
1773 return AssignEnvironment(result); 1773 return AssignEnvironment(result);
1774 } 1774 }
1775 1775
1776 1776
1777 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { 1777 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
1778 HValue* value = instr->value(); 1778 HValue* value = instr->value();
1779 Representation input_rep = value->representation(); 1779 Representation input_rep = value->representation();
1780 if (input_rep.IsDouble()) { 1780 if (input_rep.IsDouble()) {
1781 LOperand* reg = UseRegister(value); 1781 LOperand* reg = UseRegister(value);
1782 return DefineAsRegister(new(zone()) LClampDToUint8(reg)); 1782 return DefineFixed(new(zone()) LClampDToUint8(reg), eax);
Yang 2012/10/19 09:29:45 I assume that you have to use EAX because SETcc ne
1783 } else if (input_rep.IsInteger32()) { 1783 } else if (input_rep.IsInteger32()) {
1784 LOperand* reg = UseFixed(value, eax); 1784 LOperand* reg = UseFixed(value, eax);
1785 return DefineFixed(new(zone()) LClampIToUint8(reg), eax); 1785 return DefineFixed(new(zone()) LClampIToUint8(reg), eax);
1786 } else { 1786 } else {
1787 ASSERT(input_rep.IsTagged()); 1787 ASSERT(input_rep.IsTagged());
1788 LOperand* reg = UseFixed(value, eax); 1788 LOperand* reg = UseFixed(value, eax);
1789 // Register allocator doesn't (yet) support allocation of double 1789 // Register allocator doesn't (yet) support allocation of double
1790 // temps. Reserve xmm1 explicitly. 1790 // temps. Reserve xmm1 explicitly.
1791 LOperand* temp = FixedTemp(xmm1); 1791 LOperand* temp = FixedTemp(xmm1);
1792 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp); 1792 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp);
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2431 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2432 LOperand* object = UseRegister(instr->object()); 2432 LOperand* object = UseRegister(instr->object());
2433 LOperand* index = UseTempRegister(instr->index()); 2433 LOperand* index = UseTempRegister(instr->index());
2434 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2434 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2435 } 2435 }
2436 2436
2437 2437
2438 } } // namespace v8::internal 2438 } } // namespace v8::internal
2439 2439
2440 #endif // V8_TARGET_ARCH_IA32 2440 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698