diff options
author | 2020-03-18 08:45:16 +0000 | |
---|---|---|
committer | 2020-03-18 08:45:16 +0000 | |
commit | 6a0432a038addf78cfe2fc7ab958b171b2134377 (patch) | |
tree | 4b7f8571181a386e8c4aa865a4e0c0adb4c4d5ff /src/lib.rs | |
parent | 12f11d29afabfb0149a660589f59bb8ba0f02161 (diff) | |
parent | 9c5740592e652b2f612b90478cb8f2431c6ccb4d (diff) | |
download | cortex-m-6a0432a038addf78cfe2fc7ab958b171b2134377.tar.gz cortex-m-6a0432a038addf78cfe2fc7ab958b171b2134377.tar.zst cortex-m-6a0432a038addf78cfe2fc7ab958b171b2134377.zip |
Merge #202
202: Prevent unnecessary bounds check in SCB::{get_priority, set_priority} r=therealprof a=qwerty19106
SystemHandler.index() gives true index for SCB.shpr array.
But now it produce unnecessary bounds check. For example, SCB::set_priority:
```
48: sym.cortex_m::peripheral::scb::__impl_cortex_m::peripheral::SCB_::set_priority::h622cd21bcc3321be ();
0x08000376 push {r7, lr}
0x08000378 mov r7, sp
0x0800037a bl cortex_m::peripheral::scb::SystemHandler::index::hdaf1a31aa5a6a8c5 ; sym.cortex_m::peripheral::scb::SystemHandler::index::hdaf1a31aa5a6a8c5
0x0800037e subs r0, 4
0x08000380 uxtb r0, r0
0x08000382 cmp r0, 0xb ; 11
0x08000384 itttt ls
0x08000386 movw r1, 0xed18
0x0800038a movt r1, 0xe000
0x0800038e movs r2, 0xff
0x08000390 strb r2, [r0, r1]
0x08000392 it ls
0x08000394 pop {r7, pc}
0x08000396 movw r2, 0x1dc0
0x0800039a movs r1, 0xc
0x0800039c movt r2, 0x800
0x080003a0 bl core::panicking::panic_bounds_check::h5181f47ae17a04a5 ; sym.core::panicking::panic_bounds_check::h5181f47ae17a04a5
0x080003a4 trap
```
This PR fix it.
Co-authored-by: Роман Кривенков <qwerty19106@gmail.com>
Diffstat (limited to 'src/lib.rs')
0 files changed, 0 insertions, 0 deletions