diff --git a/src/rp2_common/pico_divider/divider.S b/src/rp2_common/pico_divider/divider.S index 234c1a4..ba42662 100644 --- a/src/rp2_common/pico_divider/divider.S +++ b/src/rp2_common/pico_divider/divider.S @@ -103,7 +103,7 @@ regular_func div_s32s32 regular_func divmod_s32s32 #if !PICO_DIVIDER_DISABLE_INTERRUPTS // to support IRQ usage (or context switch) we must save/restore divider state around call if state is dirty - ldr r2, =(SIO_BASE) + ldr r2, =SIO_BASE ldr r3, [r2, #SIO_DIV_CSR_OFFSET] lsrs r3, #SIO_DIV_CSR_DIRTY_SHIFT_FOR_CARRY bcs divmod_s32s32_savestate @@ -114,7 +114,7 @@ regular_func divmod_s32s32_unsafe // are the hardware_divider functions that can be used instead anyway regular_func divmod_s32s32_unsafe // to avoid worrying about IRQs (or context switches), simply disable interrupts around call - ldr r2, =(SIO_BASE) + ldr r2, =SIO_BASE mrs r3, PRIMASK cpsid i #endif /* !PICO_DIVIDER_DISABLE_INTERRUPTS */ @@ -167,7 +167,7 @@ wrapper_func __aeabi_uidiv wrapper_func __aeabi_uidivmod #if !PICO_DIVIDER_DISABLE_INTERRUPTS // to support IRQ usage (or context switch) we must save/restore divider state around call if state is dirty - ldr r2, =(SIO_BASE) + ldr r2, =SIO_BASE ldr r3, [r2, #SIO_DIV_CSR_OFFSET] lsrs r3, #SIO_DIV_CSR_DIRTY_SHIFT_FOR_CARRY bcs divmod_u32u32_savestate @@ -178,7 +178,7 @@ regular_func divmod_u32u32_unsafe // are the hardware_divider functions that can be used instead anyway regular_func divmod_u32u32_unsafe // to avoid worrying about IRQs (or context switches), simply disable interrupts around call - ldr r2, =(SIO_BASE) + ldr r2, =SIO_BASE mrs r3, PRIMASK cpsid i #endif /* !PICO_DIVIDER_DISABLE_INTERRUPTS */ @@ -227,7 +227,7 @@ regular_func divmod_s64s64 #if !PICO_DIVIDER_DISABLE_INTERRUPTS // to support IRQ usage (or context switch) we must save/restore divider state around call if state is dirty mov ip, r2 - ldr r2, =(SIO_BASE) + ldr r2, =SIO_BASE ldr r2, [r2, #SIO_DIV_CSR_OFFSET] lsrs r2, #SIO_DIV_CSR_DIRTY_SHIFT_FOR_CARRY mov r2, ip @@ -255,7 +255,7 @@ regular_func divmod_u64u64 #if !PICO_DIVIDER_DISABLE_INTERRUPTS // to support IRQ usage (or context switch) we must save/restore divider state around call if state is dirty mov ip, r2 - ldr r2, =(SIO_BASE) + ldr r2, =SIO_BASE ldr r2, [r2, #SIO_DIV_CSR_OFFSET] lsrs r2, #SIO_DIV_CSR_DIRTY_SHIFT_FOR_CARRY mov r2, ip @@ -278,7 +278,7 @@ regular_func divmod_u64u64_savestate .macro dneg lo,hi mvns \hi,\hi - rsbs \lo,#0 + negs \lo,\lo bne l\@_1 adds \hi,#1 l\@_1: @@ -352,7 +352,7 @@ regular_func divmod_u64u64_unsafe cmp r2,#0 beq 2f @ x==0? mov r12,r7 - ldr r7,=#SIO_BASE + ldr r7,=SIO_BASE str r0,[r7,#SIO_DIV_UDIVIDEND_OFFSET] str r2,[r7,#SIO_DIV_UDIVISOR_OFFSET] movs r1,#0 @@ -367,7 +367,7 @@ regular_func divmod_u64u64_unsafe cmp r0,#0 @ y==0? beq 3f @ then pass 0 to __aeabi_ldiv0 udiv0: - ldr r0,=#0xffffffff + ldr r0,=0xffffffff movs r1,r0 @ pass 2^64-1 to __aeabi_ldiv0 3: push {r14} @@ -402,7 +402,7 @@ y64: cmp r2,#0 beq udiv0 @ x==0? exit as with y!=0 case above push {r7} - ldr r7,=#SIO_BASE + ldr r7,=SIO_BASE str r1,[r7,#SIO_DIV_UDIVIDEND_OFFSET] str r2,[r7,#SIO_DIV_UDIVISOR_OFFSET] wait_div 4 @@ -464,9 +464,9 @@ y64_x32: lsrs r4,r2,#15 adds r4,#1 @ x1=(x0>>15)+1; 2^16>31)+1; // 2^16=ey? - rsbs r4,#0 @ make shift positive + negs r4,r4 @ make shift positive asrs r0,r4 cmp r4,#28 blo 3f @@ -159,8 +159,8 @@ regular_func fatan2_shim ldr r3, =0x2cfc @ &pi_q29, circular coefficients cmp r0,#0 @ x negative bge 5f - rsbs r0,#0 @ rotate to 1st/4th quadrants - rsbs r1,#0 + negs r0,r0 @ rotate to 1st/4th quadrants + negs r1,r1 ldr r2,[r3] @ pi Q29 5: movs r4,#1 @ m=1 @@ -272,7 +272,7 @@ d2fix_a: movs r4,r0 lsls r1,r2 lsls r0,r2 - rsbs r2,#0 + negs r2,r2 adds r2,#32 @ complementary shift lsrs r4,r2 orrs r1,r4 @@ -287,7 +287,7 @@ d2fix_a: bmi 1f @ long shift? mov r4,r1 lsls r4,r2 - rsbs r2,#0 + negs r2,r2 adds r2,#32 @ complementary shift asrs r1,r2 lsrs r0,r2 @@ -299,7 +299,7 @@ d2fix_a: asrs r1,#31 @ shift down 32 places adds r2,#32 bmi 1f @ very long shift? - rsbs r2,#0 + negs r2,r2 adds r2,#32 asrs r0,r2 pop {r4,r15} @@ -329,7 +329,7 @@ regular_func float2double_shim cmp r2,#0xff @ Inf? beq 2f lsrs r1,#4 @ exponent and top 20 bits of mantissa - ldr r2,=#(0x3ff-0x7f)<<20 @ difference in exponent offsets + ldr r2,=(0x3ff-0x7f)<<20 @ difference in exponent offsets adds r1,r2 orrs r1,r3 lsls r0,#29 @ bottom 3 bits of mantissa @@ -340,7 +340,7 @@ regular_func float2double_shim movs r0,#0 bx r14 2: - ldr r1,=#0x7ff00000 @ return signed infinity + ldr r1,=0x7ff00000 @ return signed infinity adds r1,r3 b 3b