diff --git a/src/xenia/cpu/compiler/passes/context_promotion_pass.cc b/src/xenia/cpu/compiler/passes/context_promotion_pass.cc index f5cc368db..969c1a03a 100644 --- a/src/xenia/cpu/compiler/passes/context_promotion_pass.cc +++ b/src/xenia/cpu/compiler/passes/context_promotion_pass.cc @@ -105,7 +105,7 @@ void ContextPromotionPass::PromoteBlock(Block* block) { // Volatile instruction - requires all context values be flushed. validity.reset(); } else if (i->opcode == &OPCODE_LOAD_CONTEXT_info) { - size_t offset = i->src1.offset; + const size_t offset = i->src1.offset; if (validity.test(static_cast(offset))) { // Legit previous value, reuse. Value* previous_value = context_values_[offset]; @@ -113,15 +113,19 @@ void ContextPromotionPass::PromoteBlock(Block* block) { i->set_src1(previous_value); } else { // Store the loaded value into the table. - context_values_[offset] = i->dest; - validity.set(static_cast(offset)); + if (i->dest->type != TypeName::VEC128_TYPE) { + context_values_[offset] = i->dest; + validity.set(static_cast(offset)); + } } } else if (i->opcode == &OPCODE_STORE_CONTEXT_info) { - size_t offset = i->src1.offset; + const size_t offset = i->src1.offset; Value* value = i->src2.value; - // Store value into the table for later. - context_values_[offset] = value; - validity.set(static_cast(offset)); + if (value->type != TypeName::VEC128_TYPE) { + // Store value into the table for later. + context_values_[offset] = value; + validity.set(static_cast(offset)); + } } i = next; } @@ -140,13 +144,16 @@ void ContextPromotionPass::RemoveDeadStoresBlock(Block* block) { // Volatile instruction - requires all context values be flushed. validity.reset(); } else if (i->opcode == &OPCODE_STORE_CONTEXT_info) { - size_t offset = i->src1.offset; - if (!validity.test(static_cast(offset))) { - // Offset not yet written, mark and continue. - validity.set(static_cast(offset)); - } else { - // Already written to. Remove this store. - i->UnlinkAndNOP(); + const size_t offset = i->src1.offset; + const Value* value = i->src2.value; + if (value->type != TypeName::VEC128_TYPE) { + if (!validity.test(static_cast(offset))) { + // Offset not yet written, mark and continue. + validity.set(static_cast(offset)); + } else { + // Already written to. Remove this store. + i->UnlinkAndNOP(); + } } } i = prev;