Assembly snippets

Hello
Snippets are rather scattered, IMO.
This place is for gathering them.
It will be free will, free share under a PDF or FAQ format ;
we accept Epiphany assembly - if with a macro for C usage, it's a bonus.
***
Here is my 1st snippet, I call it modestly
"PERFECT_ALIGN8".
It will align the code on a 64-bit boundary with an optimized number of instructions, whatever the program counter modulo 8 is:
The whole story is here https://parallella.org/forums/viewtopic.php?f=13&t=3679&p=17627#p17627
***
It may be useful for:
- the PAL guys (if they accept assembly ?! did not read everything) ; I did write a better 32-bit popcount routine recently
- the "integer" guys - most of the time I work with integers and bits.
- the compiler guys
- ourselves (the "assembly class")
Snippets are rather scattered, IMO.
This place is for gathering them.
It will be free will, free share under a PDF or FAQ format ;
we accept Epiphany assembly - if with a macro for C usage, it's a bonus.
***
Here is my 1st snippet, I call it modestly

It will align the code on a 64-bit boundary with an optimized number of instructions, whatever the program counter modulo 8 is:
- Code: Select all
.balignw 4, 0x01a2
.balignl 8, 0xfc02fcef
The whole story is here https://parallella.org/forums/viewtopic.php?f=13&t=3679&p=17627#p17627
***
It may be useful for:
- the PAL guys (if they accept assembly ?! did not read everything) ; I did write a better 32-bit popcount routine recently
- the "integer" guys - most of the time I work with integers and bits.
- the compiler guys
- ourselves (the "assembly class")