VIA PadLock support
Alan Modra
amodra@bigpond.net.au
Thu Mar 11 15:39:00 GMT 2004
On Thu, Mar 11, 2004 at 04:08:10PM +0100, Michal Ludvig wrote:
> Hi all,
> this patch adds support for (dis)assembling VIA Nehemiah PadLock
> instructions. These insns are 3 bytes long and except for 'xstore' must
> have a 'rep' prefix. I modified add_prefix() to accept 'xcrypt' insns
> both with and without explicitly mentioned 'rep' (although it is always
> emitted exacly once without complains).
I think it would be better to warn if a rep prefix is given with these
instructions. Also, do any of these instructions take a lock prefix?
Since rep and lock are mutually exclusive on other x86 archs, the
assembler warns if you use both.
Assuming lock isn't allowed,
- then your changes aren't correct as you'll lose the lock warning.
- you could dipense with the add_prefix change, and instead check
i.prefix[LOCKREP_PREFIX] in the following code before calling
add_prefix.
> + if (i.tm.cpu_flags & CpuPadLock) {
> + if (i.tm.base_opcode & 0xff000000)
> + add_prefix ((i.tm.base_opcode >> 24) & 0xff, 1);
> + } else {
> + if (i.tm.base_opcode & 0xff0000)
> + add_prefix ((i.tm.base_opcode >> 16) & 0xff, 0);
> + }
Formatting here and elsewhere. Braces go on separate lines.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list