parisc: Define depi_safe macro
authorJohn David Anglin <dave.anglin@bell.net>
Tue, 21 Dec 2021 20:04:53 +0000 (15:04 -0500)
committerHelge Deller <deller@gmx.de>
Fri, 7 Jan 2022 00:29:20 +0000 (01:29 +0100)
The depi instruction is similar to the extru instruction on 64-bit machines.
It leaves the most-significant 32 bits of the target register in an undefined
state.  On 64-bit machines, the macro uses depdi to perform safe deposits in
the least-significant 32 bits.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/assembly.h

index 6d13ae2..6369082 100644 (file)
 #endif
        .endm
 
+       /* The depi instruction leaves the most significant 32 bits of the
+        * target register in an undefined state on PA 2.0 systems. */
+       .macro depi_safe i, p, len, t
+#ifdef CONFIG_64BIT
+       depdi   \i, 32+(\p), \len, \t
+#else
+       depi    \i, \p, \len, \t
+#endif
+       .endm
+
        /* load 32-bit 'value' into 'reg' compensating for the ldil
         * sign-extension when running in wide mode.
         * WARNING!! neither 'value' nor 'reg' can be expressions