This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to calculate opcode mask


> I can translate d,v,t into a mask by looking at the definitions in
> include/opcode/mips.h, and doing
>     ~ ((OP_MASK_RD << OP_SH_RD)
>        | (OP_MASK_RS << OP_SH_RS)
>        | (OP_MASK_RT << OP_SH_RT))
> As I said, though, that approach doesn't always work for all
> instructions.

Right. I do it a little easier (IMO :) and just look at the binary for
the instruction and group it together. This also helps when adding new
instructions since you double check that the ops that you have match the
spots in the opcode that you are trying to add.

*shrug*

-eric

-- 
Eric Christopher <echristo@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]