aco: fix 64-bit p_extract_vector on 32-bit p_create_vector
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 14 Oct 2019 18:27:52 +0000 (19:27 +0100)
committerRhys Perry <pendingchaos02@gmail.com>
Tue, 22 Oct 2019 18:52:29 +0000 (18:52 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/amd/compiler/aco_optimizer.cpp

index 501e48162be848a8f486ca75015858217669ab96..4a287336d0d5a8872d3cecc1c1e21fdc151ceff2 100644 (file)
@@ -765,7 +765,8 @@ void label_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
       if (!ctx.info[instr->operands[0].tempId()].is_vec())
          break;
       Instruction* vec = ctx.info[instr->operands[0].tempId()].instr;
-      if (vec->definitions[0].getTemp().size() == vec->operands.size()) { /* TODO: what about 64bit or other combinations? */
+      if (vec->definitions[0].getTemp().size() == vec->operands.size() && /* TODO: what about 64bit or other combinations? */
+          vec->operands[0].size() == instr->definitions[0].size()) {
 
          /* convert this extract into a mov instruction */
          Operand vec_op = vec->operands[instr->operands[1].constantValue()];