Replace unavailable flag-preserving instruction #193

Merged
foopub merged 2 commits from patch-1 into develop 2021-02-27 12:07:57 -06:00
foopub commented 2021-02-25 19:43:51 -06:00 (Migrated from github.com)

It seems sub requires thumb2 instructions which are unavailable. This is in line with the rest of the sdk code base which uses subs.

It seems sub requires thumb2 instructions which are unavailable. This is in line with the rest of the sdk code base which uses subs.
kilograham commented 2021-02-26 07:32:19 -06:00 (Migrated from github.com)

some context needed here. why is this failing for you? I'm guessing you are perhaps trying to build with clang?

some context needed here. why is this failing for you? I'm guessing you are perhaps trying to build with clang?
foopub commented 2021-02-26 09:52:29 -06:00 (Migrated from github.com)

Yes, I'm trying to compile with clang.
I don't know if this is of any use, but the disassembly of the gcc binary with sub has this:

157   62:   3001            adds    r0, #1
158   64:   3801            subs    r0, #1
159   66:   d1fd            bne.n   64 <clock_configure+0x64>

while the clang with subs it's:

 95   86:   1c40            adds    r0, r0, #1
 96   88:   3801            subs    r0, #1
 97   8a:   d1fd            bne.n   88 <clock_configure+0x88>

so it shouldn't make a difference to bne?

Also, I realised I was testing with the -masm-syntax-unified option on gcc, so I'll change the commit to include
".syntax unified\n\t"
which I've tested and it works with the normal cmake.

Yes, I'm trying to compile with clang. I don't know if this is of any use, but the disassembly of the gcc binary with `sub` has this: ``` 157 62: 3001 adds r0, #1 158 64: 3801 subs r0, #1 159 66: d1fd bne.n 64 <clock_configure+0x64> ``` while the clang with `subs` it's: ``` 95 86: 1c40 adds r0, r0, #1 96 88: 3801 subs r0, #1 97 8a: d1fd bne.n 88 <clock_configure+0x88> ``` so it shouldn't make a difference to `bne`? Also, I realised I was testing with the -masm-syntax-unified option on gcc, so I'll change the commit to include `".syntax unified\n\t"` which I've tested and it works with the normal cmake.
kilograham commented 2021-02-26 11:54:50 -06:00 (Migrated from github.com)

Yes the fact that it was converted to a subs was a good thing, since sub would never have worked.

I was going to suggest .syntax unified but wanted to make sure what you were doing first.

Yes the fact that it was converted to a `subs` was a good thing, since `sub` would never have worked. I was going to suggest `.syntax unified` but wanted to make sure what you were doing first.
kilograham commented 2021-02-26 11:55:45 -06:00 (Migrated from github.com)

can you pls rebase

can you pls rebase
kilograham (Migrated from github.com) approved these changes 2021-02-27 12:07:50 -06:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!193
No description provided.