[Openmcl-devel] Challenge: CCL port to the RPi Pico (RP2040)

Carl Shapiro carl.shapiro at gmail.com
Sun Jul 28 12:53:03 PDT 2024


On Sun, Jul 28, 2024 at 11:10 AM Ron Garret <ron at flownet.com> wrote:

> Doesn't seem like it would be very hard.  They are the same ISA, just
> different encodings.
>
>
> https://stackoverflow.com/questions/28669905/what-is-the-difference-between-the-arm-thumb-and-thumb-2-instruction-encodings
>

There is a lot of room for hair-splitting in terms of what constitutes an
encoding and what does not.  That is certainly more true if you are talking
about ARM being an alternate encoding for Thumb-2 and less true in the
other direction.  That aside, if you have an ARM backend that does not
excessively rely on the eccentricities of 32-bit ARM then, indeed,
targeting Thumb should not be very hard.

Anyway, to emit Thumb, this could just require a refactoring of the backend
to remove ARM-specific assumptions: instructions will encoding in 2-4 bytes
instead of always 4, the IT instruction is required for conditional
execution and not present on 32-bit ARM, and many instructions take 2
address instead of always having 3 addresses.  The smaller microcontrollers
also do not offer the full ISA.

Fortunately, since you can run Thumb code side-by-side with ARM code this
work can be done much less disruptively than targeting a new architecture.
It is real work but, again, not very hard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20240728/540a3d5c/attachment.htm>


More information about the Openmcl-devel mailing list