From 289075d0521f916d4b776eea6fd7434b401ccc45 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 9 Jun 2014 21:29:15 -0700 Subject: [PATCH] Constant D3DCOLOR UNPACK. Could optimize earlier. --- src/alloy/backend/x64/x64_sequences.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/alloy/backend/x64/x64_sequences.cc b/src/alloy/backend/x64/x64_sequences.cc index 8c8a2ed00..143257b6e 100644 --- a/src/alloy/backend/x64/x64_sequences.cc +++ b/src/alloy/backend/x64/x64_sequences.cc @@ -4716,6 +4716,10 @@ EMITTER(UNPACK, MATCH(I, V128<>>)) { // dest.f4[1] = (float)((src >> 8) & 0xFF) * (1.0f / 255.0f); // dest.f4[2] = (float)(src & 0xFF) * (1.0f / 255.0f); // dest.f4[3] = (float)((src >> 24) & 0xFF) * (1.0f / 255.0f); + if (i.src1.is_constant) { + e.vpxor(i.dest, i.dest); + return; + } // src = ZZYYXXWW // unpack to 000000ZZ,000000YY,000000XX,000000WW