@@ -465,7 +465,7 @@ impl Func {
465
465
let mut fixed = vec ! [ ] ;
466
466
for _ in 0 ..u. int_in_range ( 0 ..=operands. len ( ) - 1 ) ? {
467
467
// Pick an operand and make it a fixed reg.
468
- let fixed_reg = PReg :: new ( u. int_in_range ( 0 ..=30 ) ?, RegClass :: Int ) ;
468
+ let fixed_reg = PReg :: new ( u. int_in_range ( 0 ..=63 ) ?, RegClass :: Int ) ;
469
469
if fixed. contains ( & fixed_reg) {
470
470
break ;
471
471
}
@@ -582,15 +582,18 @@ impl std::fmt::Debug for Func {
582
582
}
583
583
584
584
pub fn machine_env ( ) -> MachineEnv {
585
- // Reg 31 is the scratch reg.
586
- let regs: Vec < PReg > = ( 0 ..31 ) . map ( |i| PReg :: new ( i, RegClass :: Int ) ) . collect ( ) ;
587
- let preferred_regs_by_class: [ Vec < PReg > ; 2 ] = [ regs. iter ( ) . cloned ( ) . take ( 24 ) . collect ( ) , vec ! [ ] ] ;
588
- let non_preferred_regs_by_class: [ Vec < PReg > ; 2 ] =
589
- [ regs. iter ( ) . cloned ( ) . skip ( 24 ) . collect ( ) , vec ! [ ] ] ;
590
- let scratch_by_class: [ PReg ; 2 ] = [ PReg :: new ( 31 , RegClass :: Int ) , PReg :: new ( 0 , RegClass :: Float ) ] ;
585
+ // Reg 63 is the scratch reg.
586
+ fn regs ( r : std:: ops:: Range < usize > ) -> Vec < PReg > {
587
+ r. map ( |i| PReg :: new ( i, RegClass :: Int ) ) . collect ( )
588
+ }
589
+ let preferred_regs_by_class: [ Vec < PReg > ; 2 ] = [ regs ( 0 ..24 ) , vec ! [ ] ] ;
590
+ let non_preferred_regs_by_class: [ Vec < PReg > ; 2 ] = [ regs ( 24 ..32 ) , vec ! [ ] ] ;
591
+ let scratch_by_class: [ PReg ; 2 ] = [ PReg :: new ( 63 , RegClass :: Int ) , PReg :: new ( 0 , RegClass :: Float ) ] ;
592
+ let fixed_stack_slots = regs ( 32 ..63 ) ;
591
593
MachineEnv {
592
594
preferred_regs_by_class,
593
595
non_preferred_regs_by_class,
594
596
scratch_by_class,
597
+ fixed_stack_slots,
595
598
}
596
599
}
0 commit comments