sifive / freedom-metal

Bare Metal Compatibility Library for the Freedom Platform
Other
154 stars 47 forks source link

Fix wrong inline assembly code in nop_putc. #419

Open zakk0610 opened 3 years ago

zakk0610 commented 3 years ago

We need to add a0 into clobber list.

In clang, the result is incorrect.

c.mv         a1, a0
c.li         a0, -1
c.mv         a0, a1
slli         zero, a0, 0x11
c.jr         ra

we could rewrite it and avoid additional mv instruction.