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: objdump fails for ColdFire


>>I think this is caused by the disassembler picking only *one* entry
>>out of the table and then checking the if the args match the
>>patterns:
>>
>>{"movel",	one(0020000),	one(0170000), "ms%d", mcf },
>>{"movel",	one(0020000),	one(0170000), "nspd", mcf },
>>{"movel",	one(0020000),	one(0170000), "olmd", mcf },
>>
>>Note that the mask and bits are the same for each pattern, its down to
>>the args to determine which form is valid.  
>>
>>To fix this I'm thinking of looping over the table for each match of
>>the masked opcode and if the args match, accept it.
>>  
>>
>
>This is probably a good idea.  It would be nice to have this code 
>cleaned up somewhat.
>
>I see in the function opcodes/m68k-dis.c:print_insn_m68k() that there is 
>already some special case code for the divul, divsl and other 
>instructions.  So maybe you could also add some code there.

I'm thinking of splitting print_insn_m68k into two parts, the first
part which iterates over the table looking for opcodes that match, and
the second whihc would either accept an instruction (based on
opc->args) and print it out, or reject it.  This function would be
called from the loop where 'best' is updated, and if reutrns a
non-zero then it had accepted and printed out the function.

I'm also looking at all the special code to deal with deciding whic
alternates(i.e, wait for fmoveml instead of fmove if more than one
register) which appearenly is there since the opcode table is layed
out in alphabetical order instead of an order that would best suit the
disassembler. (then this special case wouldn't have to be there since
fmoveml could be placed *before* fmovel).

Comments?

-- 
Peter Barada
peter@the-baradas.com


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