Commit 169d1a4a authored by Helge Deller's avatar Helge Deller

parisc: Provide an extru_safe() macro to extract unsigned bits

The extru instruction leaves the most significant 32 bits of the
target register in an undefined state on PA 2.0 systems.
Provide a macro to safely use extru on 32- and 64-bit machines.
Suggested-by: default avatarJohn David Anglin <dave.anglin@bell.net>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 8d192bec
...@@ -147,6 +147,17 @@ ...@@ -147,6 +147,17 @@
extrd,u \r, 63-(\sa), 64-(\sa), \t extrd,u \r, 63-(\sa), 64-(\sa), \t
.endm .endm
/* Extract unsigned for 32- and 64-bit
* The extru instruction leaves the most significant 32 bits of the
* target register in an undefined state on PA 2.0 systems. */
.macro extru_safe r, p, len, t
#ifdef CONFIG_64BIT
extrd,u \r, 32+(\p), \len, \t
#else
extru \r, \p, \len, \t
#endif
.endm
/* load 32-bit 'value' into 'reg' compensating for the ldil /* load 32-bit 'value' into 'reg' compensating for the ldil
* sign-extension when running in wide mode. * sign-extension when running in wide mode.
* WARNING!! neither 'value' nor 'reg' can be expressions * WARNING!! neither 'value' nor 'reg' can be expressions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment