+ instr.reset(bld.sopp(inv, -1, 7));
+ emit_instruction(ctx, out, instr.get());
+ }
+
+ /* create the new PC and stash SCC in the LSB */
+ instr.reset(bld.sop1(aco_opcode::s_getpc_b64, branch->definitions[0]).instr);
+ emit_instruction(ctx, out, instr.get());
+
+ instr.reset(bld.sop2(aco_opcode::s_addc_u32, def_tmp_lo, op_tmp_lo, Operand(0u)).instr);
+ instr->operands[1].setFixed(PhysReg{255}); /* this operand has to be a literal */
+ emit_instruction(ctx, out, instr.get());
+ branch->pass_flags = out.size();
+
+ instr.reset(bld.sop2(aco_opcode::s_addc_u32, def_tmp_hi, op_tmp_hi, Operand(backwards ? UINT32_MAX : 0u)).instr);
+ emit_instruction(ctx, out, instr.get());
+
+ /* restore SCC and clear the LSB of the new PC */
+ instr.reset(bld.sopc(aco_opcode::s_bitcmp1_b32, def_tmp_lo, op_tmp_lo, Operand(0u)).instr);
+ emit_instruction(ctx, out, instr.get());
+ instr.reset(bld.sop1(aco_opcode::s_bitset0_b32, def_tmp_lo, Operand(0u)).instr);
+ emit_instruction(ctx, out, instr.get());
+
+ /* create the s_setpc_b64 to jump */
+ instr.reset(bld.sop1(aco_opcode::s_setpc_b64, Operand(branch->definitions[0].physReg(), s2)).instr);
+ emit_instruction(ctx, out, instr.get());