@@ -84,8 +84,8 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
8484 } else {
8585 VecALUOp :: UQAddScalar
8686 } ;
87- let va = ctx. tmp ( RegClass :: V128 , I128 ) ;
88- let vb = ctx. tmp ( RegClass :: V128 , I128 ) ;
87+ let va = ctx. alloc_tmp ( RegClass :: V128 , I128 ) ;
88+ let vb = ctx. alloc_tmp ( RegClass :: V128 , I128 ) ;
8989 let ra = input_to_reg ( ctx, inputs[ 0 ] , narrow_mode) ;
9090 let rb = input_to_reg ( ctx, inputs[ 1 ] , narrow_mode) ;
9191 let rd = output_to_reg ( ctx, outputs[ 0 ] ) ;
@@ -115,8 +115,8 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
115115 } else {
116116 VecALUOp :: UQSubScalar
117117 } ;
118- let va = ctx. tmp ( RegClass :: V128 , I128 ) ;
119- let vb = ctx. tmp ( RegClass :: V128 , I128 ) ;
118+ let va = ctx. alloc_tmp ( RegClass :: V128 , I128 ) ;
119+ let vb = ctx. alloc_tmp ( RegClass :: V128 , I128 ) ;
120120 let ra = input_to_reg ( ctx, inputs[ 0 ] , narrow_mode) ;
121121 let rb = input_to_reg ( ctx, inputs[ 1 ] , narrow_mode) ;
122122 let rd = output_to_reg ( ctx, outputs[ 0 ] ) ;
@@ -498,7 +498,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
498498 // ignored (because of the implicit masking done by the instruction),
499499 // so this is equivalent to negating the input.
500500 let alu_op = choose_32_64 ( ty, ALUOp :: Sub32 , ALUOp :: Sub64 ) ;
501- let tmp = ctx. tmp ( RegClass :: I64 , ty) ;
501+ let tmp = ctx. alloc_tmp ( RegClass :: I64 , ty) ;
502502 ctx. emit ( Inst :: AluRRR {
503503 alu_op,
504504 rd : tmp,
@@ -521,7 +521,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
521521 // Really ty_bits_size - rn, but the upper bits of the result are
522522 // ignored (because of the implicit masking done by the instruction),
523523 // so this is equivalent to negating the input.
524- let tmp = ctx. tmp ( RegClass :: I64 , I32 ) ;
524+ let tmp = ctx. alloc_tmp ( RegClass :: I64 , I32 ) ;
525525 ctx. emit ( Inst :: AluRRR {
526526 alu_op : ALUOp :: Sub32 ,
527527 rd : tmp,
@@ -534,7 +534,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
534534 } ;
535535
536536 // Explicitly mask the rotation count.
537- let tmp_masked_rm = ctx. tmp ( RegClass :: I64 , I32 ) ;
537+ let tmp_masked_rm = ctx. alloc_tmp ( RegClass :: I64 , I32 ) ;
538538 ctx. emit ( Inst :: AluRRImmLogic {
539539 alu_op : ALUOp :: And32 ,
540540 rd : tmp_masked_rm,
@@ -543,8 +543,8 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
543543 } ) ;
544544 let tmp_masked_rm = tmp_masked_rm. to_reg ( ) ;
545545
546- let tmp1 = ctx. tmp ( RegClass :: I64 , I32 ) ;
547- let tmp2 = ctx. tmp ( RegClass :: I64 , I32 ) ;
546+ let tmp1 = ctx. alloc_tmp ( RegClass :: I64 , I32 ) ;
547+ let tmp2 = ctx. alloc_tmp ( RegClass :: I64 , I32 ) ;
548548 ctx. emit ( Inst :: AluRRImm12 {
549549 alu_op : ALUOp :: Sub32 ,
550550 rd : tmp1,
@@ -583,7 +583,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
583583 }
584584 immshift. imm &= ty_bits_size - 1 ;
585585
586- let tmp1 = ctx. tmp ( RegClass :: I64 , I32 ) ;
586+ let tmp1 = ctx. alloc_tmp ( RegClass :: I64 , I32 ) ;
587587 ctx. emit ( Inst :: AluRRImmShift {
588588 alu_op : ALUOp :: Lsr32 ,
589589 rd : tmp1,
@@ -688,7 +688,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
688688 // and fix the sequence below to work properly for this.
689689 let narrow_mode = NarrowValueMode :: ZeroExtend64 ;
690690 let rn = input_to_reg ( ctx, inputs[ 0 ] , narrow_mode) ;
691- let tmp = ctx. tmp ( RegClass :: I64 , I64 ) ;
691+ let tmp = ctx. alloc_tmp ( RegClass :: I64 , I64 ) ;
692692
693693 // If this is a 32-bit Popcnt, use Lsr32 to clear the top 32 bits of the register, then
694694 // the rest of the code is identical to the 64-bit version.
@@ -997,7 +997,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
997997 }
998998
999999 Opcode :: Bitselect => {
1000- let tmp = ctx. tmp ( RegClass :: I64 , I64 ) ;
1000+ let tmp = ctx. alloc_tmp ( RegClass :: I64 , I64 ) ;
10011001 let rd = output_to_reg ( ctx, outputs[ 0 ] ) ;
10021002 let rcond = input_to_reg ( ctx, inputs[ 0 ] , NarrowValueMode :: None ) ;
10031003 let rn = input_to_reg ( ctx, inputs[ 1 ] , NarrowValueMode :: None ) ;
@@ -1475,8 +1475,8 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
14751475 let rn = input_to_reg ( ctx, inputs[ 0 ] , NarrowValueMode :: None ) ;
14761476 let rm = input_to_reg ( ctx, inputs[ 1 ] , NarrowValueMode :: None ) ;
14771477 let rd = output_to_reg ( ctx, outputs[ 0 ] ) ;
1478- let tmp1 = ctx. tmp ( RegClass :: I64 , I64 ) ;
1479- let tmp2 = ctx. tmp ( RegClass :: I64 , I64 ) ;
1478+ let tmp1 = ctx. alloc_tmp ( RegClass :: I64 , I64 ) ;
1479+ let tmp2 = ctx. alloc_tmp ( RegClass :: I64 , I64 ) ;
14801480 ctx. emit ( Inst :: MovFromVec64 { rd : tmp1, rn : rn } ) ;
14811481 ctx. emit ( Inst :: MovFromVec64 { rd : tmp2, rn : rm } ) ;
14821482 let imml = if bits == 32 {
@@ -1546,7 +1546,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
15461546 let trap_info = ( ctx. srcloc ( insn) , TrapCode :: BadConversionToInteger ) ;
15471547 ctx. emit ( Inst :: Udf { trap_info } ) ;
15481548
1549- let tmp = ctx. tmp ( RegClass :: V128 , I128 ) ;
1549+ let tmp = ctx. alloc_tmp ( RegClass :: V128 , I128 ) ;
15501550
15511551 // Check that the input is in range, with "truncate towards zero" semantics. This means
15521552 // we allow values that are slightly out of range:
@@ -1712,8 +1712,8 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
17121712 _ => unreachable ! ( ) ,
17131713 } ;
17141714
1715- let rtmp1 = ctx. tmp ( RegClass :: V128 , in_ty) ;
1716- let rtmp2 = ctx. tmp ( RegClass :: V128 , in_ty) ;
1715+ let rtmp1 = ctx. alloc_tmp ( RegClass :: V128 , in_ty) ;
1716+ let rtmp2 = ctx. alloc_tmp ( RegClass :: V128 , in_ty) ;
17171717
17181718 if in_bits == 32 {
17191719 ctx. emit ( Inst :: LoadFpuConst32 {
@@ -2072,7 +2072,9 @@ pub(crate) fn lower_branch<C: LowerCtx<I = Inst>>(
20722072 Opcode :: BrTable => {
20732073 // Expand `br_table index, default, JT` to:
20742074 //
2075- // (emit island with guard jump if needed)
2075+ // emit_island // this forces an island at this point
2076+ // // if the jumptable would push us past
2077+ // // the deadline
20762078 // subs idx, #jt_size
20772079 // b.hs default
20782080 // adr vTmp1, PC+16
@@ -2096,8 +2098,8 @@ pub(crate) fn lower_branch<C: LowerCtx<I = Inst>>(
20962098 NarrowValueMode :: ZeroExtend32 ,
20972099 ) ;
20982100
2099- let rtmp1 = ctx. tmp ( RegClass :: I64 , I32 ) ;
2100- let rtmp2 = ctx. tmp ( RegClass :: I64 , I32 ) ;
2101+ let rtmp1 = ctx. alloc_tmp ( RegClass :: I64 , I32 ) ;
2102+ let rtmp2 = ctx. alloc_tmp ( RegClass :: I64 , I32 ) ;
21012103
21022104 // Bounds-check and branch to default.
21032105 if let Some ( imm12) = Imm12 :: maybe_from_u64 ( jt_size as u64 ) {
0 commit comments