target/mips: Implement emulation of nanoMIPS EXTW instruction
authorJames Hogan <james.hogan@mips.com>
Thu, 2 Aug 2018 14:16:21 +0000 (16:16 +0200)
committerAleksandar Markovic <amarkovic@wavecomp.com>
Fri, 24 Aug 2018 15:51:59 +0000 (17:51 +0200)
commit821f2008c3c708e0e33158039ab55673a0f04519
tree8cbb3a0a7cdede6a05981c90fcd0fc6ff3eac709
parente222f5067269392af489731221750976d0cf3c05
target/mips: Implement emulation of nanoMIPS EXTW instruction

Implement emulation of nanoMIPS EXTW instruction. EXTW instruction
is similar to the MIPS r6 ALIGN instruction, except that it counts
the other way and in bits instead of bytes. We therefore generalise
gen_align() function into a new gen_align_bits() function (which
counts in bits instead of bytes and optimises when bits = size of
the word), and implement gen_align() and a new gen_ext() based on
that. Since we need to know the word size to check for when the
number of bits == the word size, the opc argument is replaced with
a wordsz argument (either 32 or 64).

Signed-off-by: James Hogan <james.hogan@mips.com>
Signed-off-by: Yongbok Kim <yongbok.kim@mips.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/mips/translate.c