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

Unified Diff: src/ia32/lithium-ia32.cc

Issue 7014033: Support conversion of clamped double values for pixel arrays in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index 4acbf7201799b93f429461a3d712fa89c3011671..ee4f5c66826a5a8ebe1ba50630e6ec58c17d7ac5 100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -1778,6 +1778,27 @@ LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
}
+LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
+ HValue* value = instr->value();
+ Representation input_rep = value->representation();
+ if (input_rep.IsDouble()) {
+ LOperand* reg = UseRegister(value);
+ return DefineAsRegister(new LClampDoubleToUint8(reg));
+ } else if (input_rep.IsInteger32()) {
+ LOperand* reg = UseFixed(value, eax);
+ return DefineFixed(new LClampIToUint8(reg), eax);
+ } else {
+ ASSERT(input_rep.IsTagged());
+ LOperand* reg = UseFixed(value, eax);
+ // Register allocator doesn't (yet) support allocation of double
+ // temps. Reserve xmm1 explicitly.
+ LOperand* temp = FixedTemp(xmm1);
+ LClampTaggedToUint8* result = new LClampTaggedToUint8(reg, temp);
+ return AssignEnvironment(DefineFixed(result, eax));
+ }
+}
+
+
LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
return new LReturn(UseFixed(instr->value(), eax));
}
@@ -1988,14 +2009,6 @@ LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement(
LOperand* external_pointer = UseRegister(instr->external_pointer());
LOperand* key = UseRegisterOrConstant(instr->key());
LOperand* temp = NULL;
-
- if (array_type == kExternalPixelArray) {
- // The generated code for pixel array stores requires that the clamped value
- // is in a byte register. eax is an arbitrary choice to satisfy this
- // requirement.
- temp = FixedTemp(eax);
- }
-
LOperand* val = NULL;
if (array_type == kExternalByteArray ||
array_type == kExternalUnsignedByteArray) {
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698