Add NOP after store operation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Add NOP after store operation

Michael Trimarchi-2
Hi all,
my intention is to add a fixed number of NOP operation after a str in
arm. I have a problem width the memory bus and I must solve this problem
width a delay in the store operation. I would change the md_assemble
function to add nop if the opcode is related to a store. I think that I
must change the tc-arm.c file and the read.c in the gas directory. Is it
correct?

Regars
Michael

Reply | Threaded
Open this post in threaded view
|

Re: Add NOP after store operation

Nick Clifton
Hi Michael,

> my intention is to add a fixed number of NOP operation after a str in
> arm. I have a problem width the memory bus and I must solve this problem
> width a delay in the store operation. I would change the md_assemble
> function to add nop if the opcode is related to a store. I think that I
> must change the tc-arm.c file and the read.c in the gas directory. Is it
> correct?

Unless you are programming only in assembler then the answer is "no".
You must gcc instead.  This is because GCC calculates the length of
branches and uses different instructions depending upon how far away the
target of the branch is.  So if you insert NOPs without gcc knowing
about it, it will generate code that does not assemble.

If you are restricting yourself to assembler then you should be able to
contain all the modifications you make just to the tc-arm.c file.

Cheers
   Nick


Reply | Threaded
Open this post in threaded view
|

Re: Add NOP after store operation

Eric Christopher

> Unless you are programming only in assembler then the answer is "no".
> You must gcc instead.  This is because GCC calculates the length of
> branches and uses different instructions depending upon how far away the
> target of the branch is.  So if you insert NOPs without gcc knowing
> about it, it will generate code that does not assemble.
>
> If you are restricting yourself to assembler then you should be able to
> contain all the modifications you make just to the tc-arm.c file.

Should probably do both, or flag a warning in gas if there aren't enough
nops there.

The mips port uses this kind of stuff extensively to work around cpu
bugs. You can look at the mips port of gcc and gas for some other ideas
on how to do this.

-eric

Reply | Threaded
Open this post in threaded view
|

Re: Add NOP after store operation

Michael Trimarchi-2
Quoting Eric Christopher <[hidden email]>:

>
>> Unless you are programming only in assembler then the answer is "no".
>> You must gcc instead.  This is because GCC calculates the length of
>> branches and uses different instructions depending upon how far away the
>> target of the branch is.  So if you insert NOPs without gcc knowing
>> about it, it will generate code that does not assemble.
>>
>> If you are restricting yourself to assembler then you should be able to
>> contain all the modifications you make just to the tc-arm.c file.
>
> Should probably do both, or flag a warning in gas if there aren't enough
> nops there.
>
> The mips port uses this kind of stuff extensively to work around cpu
> bugs. You can look at the mips port of gcc and gas for some other ideas
> on how to do this.
>
> -eric

This is a good news for me

Regards
Michael
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.