This is the mail archive of the binutils@sourceware.org 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: assembler relaxation


Hi Nagaraju,

I have ported Binutils to a new port. My problem is that in a 16-bit instruction if the constant range is exceeded then I need to emit 2 instructions. I have referred other architectures and did it and my assembler is generating instructions them. While running some bench mark codes it is observed instead of generating two instructions it is generating 1-st instruction correctly and for other instruction it is appending Zero's as a result it got struck up.

Without access to the source code for your new port is hard to give specific advice[1] but in general what you need to do is to look at the where these instructions are generated/inserted and determine why the second instruction is using zeroes.


Note - normally relaxation works the other way. That is it normally removes instructions rather than adding them. Thus I would have expected that the default behaviour be for the compiler (or user, if we are talking about hand generated assembler source files) to generate the two instruction sequence, and for the assembler to relax this to just one instruction if it can show that this will work.

Cheers
  Nick

[1] I am not asking for a copy of the source code - I would rather that you debug the problem yourself, possibly with some help from this list. Posting code fragments and more detailed examples of the problem is a good idea though.


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