public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Meissner, Michael" <michael.meissner@amd.com>
To: zneda@ce.aut.ac.ir, gnu@gnu.org, gcc-help@gcc.gnu.org
Cc: neda.zf@gmail.com
Subject: RE: Hazard Detection
Date: Tue, 12 Dec 2006 18:31:00 -0000	[thread overview]
Message-ID: <6096959DEF5C9447A6BF80BDC7EB9EDC02A44E66@SBOSEXMB1.amd.com> (raw)
In-Reply-To: <40970.192.168.1.13.1165934653.squirrel@ce.aut.ac.ir>

> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]
On
> Behalf Of zneda@ce.aut.ac.ir
> Sent: Tuesday, December 12, 2006 9:44 AM
> To: gnu@gnu.org; gcc-help@gcc.gnu.org
> Cc: neda.zf@gmail.com
> Subject: Hazard Detection
> 
> Hi
> 
> I have a question: I compiled a program with  gcc -mips1 ,
> Compiler generate this list of instructions:
>    ...               ....               ...
>   10b71c:    87a20018      lh        v0,24(sp)
>   10b720:    00000000     nop
>   10b724:    144000b9     bnez    v0,10ba0c
>   10b728:    0015ac03      sra      s5,s5,0x10
>    ...               ....               ...
> 
> but by a small change, some times in variables, (using same compiler
> switches) compiler don't insert  nop between load and branch and
generates
> this sequence of instructions:
>    ...               ....               ...
>   10b754:    87a20018     lh         v0,24(sp)
>   10b758:    144000b9     bnez     v0,10ba40
>   10b75c:    0015ac03      sra       s5,s5,0x10
>    ...               ....               ...
> 
> would you please tell me the reason?
> 
> why doesn't compiler detect hazard always?
> 
> Thanks in advanced.

I haven't programmed in the MIPS for awhile, but when I did, GCC
expected the assembler to do the hazard detection (ie, if you
disassemble the object code, there should be a NOP between the lh and
the bnez if -mips1 was passed to the assembler.  GCC used to have a
separate hazard detection pass many years ago, but it was removed when
GAS added the support.


  reply	other threads:[~2006-12-12 18:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 14:37 zneda
2006-12-12 18:31 ` Meissner, Michael [this message]
2006-12-12 23:22   ` Ian Lance Taylor
2006-12-12 14:52 zneda
2006-12-12 14:56 zneda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6096959DEF5C9447A6BF80BDC7EB9EDC02A44E66@SBOSEXMB1.amd.com \
    --to=michael.meissner@amd.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gnu@gnu.org \
    --cc=neda.zf@gmail.com \
    --cc=zneda@ce.aut.ac.ir \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).