Skip to content

Commit 23dcd82

Browse files
committed
Remove superfluous MOVT in mbed_start_application/start_new_application
1 parent 3c14cb6 commit 23dcd82

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

platform/mbed_application.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ __asm static void start_new_application(void *sp, void *pc)
125125
void start_new_application(void *sp, void *pc)
126126
{
127127
__asm volatile (
128-
"movw r2, #0 \n" // Fail to compile "mov r2, #0" with ARMC6. Replace with movw/movt.
129-
"movt r2, #0 \n"
128+
"movw r2, #0 \n" // Fail to compile "mov r2, #0" with ARMC6. Replace with MOVW.
129+
// We needn't "movt r2, #0" immediately following because MOVW
130+
// will zero-extend the 16-bit immediate.
130131
"msr control, r2 \n" // Switch to main stack
131132
"mov sp, %0 \n"
132133
"msr primask, r2 \n" // Enable interrupts

0 commit comments

Comments
 (0)