This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
how to calculate opcode mask
- From: Shinpei Kato <shinny at j02 dot itscom dot net>
- To: binutils at sources dot redhat dot com
- Date: Tue, 10 Feb 2004 21:16:16 +0900
- Subject: how to calculate opcode mask
Hi, there.
I'm porting GAS to the new CPU that is similar to MIPS.
So I'm refering to binutils-2.14/opcodes/mips-opc.c to add several new
instructions.
However I have one thing I can't understand.
That is how I can caluculate a mask member of the type "mips_opcode".
For instance, please see followings.
const struct mips_opcode mips_builtin_opcodes[] =
{
:
:
{"add", "d,v,t", 0x00000020, 0xfc0007ff, WR_d|RD_s|RD_t, I1},
:
:
}
This is the mips_builtin_opcodes definition in mips-opc.c.
0x0000000020 is a match member.
0x7c0007ff is a mask member.
I can understand a match member because it's just opcode but not a mask
member.
0xfc007ff means "d,v,t", doesn't it? But how can we calculate 0xfc0007ff
from "d,v,t"?
I hope your help.
Regards,
Shinpei Kato