summaryrefslogtreecommitdiff
path: root/arch/sh/kernel/cpu/sh3
diff options
context:
space:
mode:
authorStuart Menefy <stuart.menefy@st.com>2009-08-24 08:09:53 (GMT)
committerPaul Mundt <lethal@linux-sh.org>2009-08-24 08:09:53 (GMT)
commitfea966f7564205fcf5919af9bde031e753419c96 (patch)
treeeb04727dfaad0c42bf9ba771e38f07c310622120 /arch/sh/kernel/cpu/sh3
parentd724a9c9d572e092d1ce820463f082697487b874 (diff)
downloadlinux-fsl-qoriq-fea966f7564205fcf5919af9bde031e753419c96.tar.xz
sh: Remove implicit sign extension from assembler immediates
The SH instruction set has several instructions which accept an 8 bit immediate operand. For logical instructions this operand is zero extended, for arithmetic instructions the operand is sign extended. After adding an option to the assembler to check this, it was found that several pieces of assembly code were assuming this behaviour, and in one case getting it wrong. So this patch explicitly sign extends any immediate operands, which makes it obvious what is happening, and fixes the one case which got it wrong. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index 8c19e21..9421ec7 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -257,7 +257,7 @@ restore_all:
!
! Calculate new SR value
mov k3, k2 ! original SR value
- mov #0xf0, k1
+ mov #0xfffffff0, k1
extu.b k1, k1
not k1, k1
and k1, k2 ! Mask original SR value