[riot-notifications] [RIOT-OS/RIOT] cpu/fe310: Mark registers as clobbered and allow using immediates for values (#15837)

Koen Zandberg notifications at github.com
Fri Jan 22 11:34:32 CET 2021


### Contribution description

The `mv` instruction (which is usually implemented as `add rd, x0, r1`) is
changed to `add rd, x0, %[input]`. This can either be used as a load
immediate or as an move.

The code size grows by two bytes. This because GCC does not compress the
`li` instruction to the compressed version (even though this is possible). This could be an missed optimization from GCC.

### Testing procedure

#### Before:

```
  11108     128    3640   14876    3a1c /home/koen/dev/RIOT-review/tests/bench_thread_yield_pingpong/bin/hifive1b/tests_bench_thread_yield_pingpong.elf
```
```
{ "result" : 694087, "ticks" : 461 }
```

#### After:

```
  11110     128    3640   14878    3a1e /home/koen/dev/RIOT-review/tests/bench_thread_yield_pingpong/bin/hifive1b/tests_bench_thread_yield_pingpong.elf
```
```
{ "result" : 694085, "ticks" : 461 }
```

### Issues/PRs references

Follow up to #15736 
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/15837

-- Commit Summary --

  * cpu/fe310: Add used registers to clobbers
  * cpu/fe310: Allow using immediates for ecall arguments

-- File Changes --

    M cpu/fe310/thread_arch.c (8)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/15837.patch
https://github.com/RIOT-OS/RIOT/pull/15837.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15837
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210122/5d8f3afe/attachment.htm>


More information about the notifications mailing list