public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Kazu Hirata <kazu@hxi.com>
Cc: binutils@sourceware.cygnus.com
Subject: Re: [patch] gas/config/tc-h8300.c (build_bytes): Assemble ldmac correctly.
Date: Mon, 26 Jun 2000 20:49:00 -0000	[thread overview]
Message-ID: <29653.962077030@upchuck> (raw)
In-Reply-To: <200006242323.QAA05447@cygnus.com>

  In message <200006242323.QAA05447@cygnus.com>you write:
  > Hi,
  > 
  > Attached is a patch to fix a bug in h8300-hms-as. The original gas
  > does not assemble the first two lines of the following function
  > correctly. The last two lines are OK.
  > 
  > /* h8300-hms-gcc -ms -Wall -O2 -fomit-frame-pointer */
  > void
  > test ()
  > {
  >   __asm__ __volatile__ ("ldmac\ter4,mach");
  >   __asm__ __volatile__ ("ldmac\ter5,macl");
  >   __asm__ __volatile__ ("stmac\tmach,er4");
  >   __asm__ __volatile__ ("stmac\tmacl,er5");
  > }
  > 
  > Without the patch,
  > 
  > 00000000 <_test>:
  >    0:	03 64       	03 64             ldmac	er4,mach <- incorrect
  >    2:	03 75       	03 75             ldmac	er5,mach <- incorrect
  >    4:	02 24       	02 24             stmac	mach,er4
  >    6:	02 35       	02 35             stmac	macl,er5
  >    8:	54 70       	54 70             rts	
  > 
  > With the patch, 
  > 
  > 00000000 <_test>:
  >    0:	03 24       	03 24             ldmac	er4,mach <- correct
  >    2:	03 35       	03 35             ldmac	er5,macl <- correct
  >    4:	02 24       	02 24             stmac	mach,er4
  >    6:	02 35       	02 35             stmac	macl,er5
  >    8:	54 70       	54 70             rts	
  > 
  > The problem is that the variable 'd' in 'build_bytes ()' is always 0,
  > meaning the first operand, when processing MACREG. However, as you can
  > see from the assembly code, when we want to know which half of the mac
  > register (mach or macl) is used, we have to look at either the first
  > or second operand depending on ldmac or stmac.
  > 
  > By the way, the existing testsuite (gas/testsuite/gas/h8300/h8300.exp
  > and macs.s) is correct. The reason this bug got away with a failure is
  > a coincident that you would never expect. If you change the 32-bit
  > registers (er0 and er1) used in macs.s to some other 32-bit registers
  > (say, er4 and er5 just like the above example) and change h8300.exp
  > accordingly, the original gas would fail.
Can you please install a test for this bug into the testsuite?

I believe Nick C. already approved the tc-h8300.c change.
Thanks,
jeff

       reply	other threads:[~2000-06-26 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200006242323.QAA05447@cygnus.com>
2000-06-26 20:49 ` Jeffrey A Law [this message]
2000-06-29 16:45 Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2000-06-27  6:56 Kazu Hirata
2000-06-25  9:50 Nick Clifton
2000-06-24 16:23 Kazu Hirata

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=29653.962077030@upchuck \
    --to=law@cygnus.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=kazu@hxi.com \
    /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).