• Jeffrey Lee's avatar
    Prefer CPS over MSR for PSR manipulation. Use UDIV/SDIV for general-purpose... · 377852c3
    Jeffrey Lee authored
    Prefer CPS over MSR for PSR manipulation. Use UDIV/SDIV for general-purpose division, and UMULL for /10.
    
    Detail:
      s/k_body:
      - _kernel_irqs_off and _kernel_irqs_on now use CPS for disabling/enabling IRQs as opposed to MSR. Apart from being shorter code sequences, it's generally a faster instruction.
      - __rt_udiv and __rt_sdiv (and aliases) now use the UDIV and SDIV instructions if building for ARMv7VE
      - __rt_udiv10 and __rt_sdiv10 (and aliases) now use UMULL to multiply by 1/10 when building for targets with long multiply support, as this is faster than the old method. UDIV/SDIV can be fast too, but only for small numbers, making UMULL the best for the general case.
    Admin:
      Tested on Cortex-A15
      Prototyping of division routines on assorted CPUs shows that UDIV/SDIV is generally between 20% and 400% faster than the old routine (Cortex-A7, Cortex-A53), or up to 1300% faster on Cortex-A15 (the CPU does not like the old routine!)
      Division by 10 is now about 20% faster across all appropriate CPUs
    
    
    Version 5.89. Tagged as 'RISC_OSLib-5_89'
    377852c3
k_body 114 KB