From: "Jerry Quinn" <jquinn@nortelnetworks.com>
To: binutils@sourceware.cygnus.com
Subject: Patch: fix 64 bit cmpb behavior for hppa
Date: Fri, 24 Sep 1999 13:57:00 -0000 [thread overview]
Message-ID: <27470.938206666.0@NO-ID-FOUND.mhonarc.org> (raw)
Made a couple of mistakes in the cmpb patch. This lets 32 bit cmpb and cmpib
work correctly.
Jerry
Changelog entry:
Fri Sep 24 16:51:04 EDT 1999
* include/opcode/hppa.h (pa_opcodes): Fix cmpb and cmpib entries.
* gas/config/tc-hppa.c (pa_ip): Change error message.
(pa_ip,pa_parse_cmpb_64_cmpltr,pa_parse_cmpib_64_cmpltr) Fix '?N' and
'?Q' args to allow falling through.
*** orig/include/opcode/hppa.h Fri Sep 24 16:03:43 1999
--- gas-src/include/opcode/hppa.h Fri Sep 24 16:45:25 1999
***************
*** 271,286 ****
{ "ret", 0xe840d000, 0xfffffffd, "n", pa20, FLAG_STRICT},
{ "cmpib", 0xec000000, 0xfc000000, "?Qn5,b,w", pa20, FLAG_STRICT},
! { "cmpib", 0x84000000, 0xf4000000, "?rn5,b,w", pa10, FLAG_STRICT},
!
{ "comib", 0x84000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
/* This entry is for the disassembler only. It will never be used by
assembler. */
{ "comib", 0x8c000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
!
! { "cmpb", 0x9c000000, 0xdc000000, "?Rnx,b,w", pa20, FLAG_STRICT},
! { "cmpb", 0x80000000, 0xf4000000, "?rnx,b,w", pa10, FLAG_STRICT},
!
{ "comb", 0x80000000, 0xfc000000, "?nnx,b,w", pa10, 0}, /* comb{tf} */
/* This entry is for the disassembler only. It will never be used by
assembler. */
--- 270,282 ----
{ "ret", 0xe840d000, 0xfffffffd, "n", pa20, FLAG_STRICT},
{ "cmpib", 0xec000000, 0xfc000000, "?Qn5,b,w", pa20, FLAG_STRICT},
! { "cmpib", 0x84000000, 0xf4000000, "?nn5,b,w", pa10, FLAG_STRICT},
{ "comib", 0x84000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
/* This entry is for the disassembler only. It will never be used by
assembler. */
{ "comib", 0x8c000000, 0xfc000000, "?nn5,b,w", pa10, 0}, /* comib{tf}*/
! { "cmpb", 0x9c000000, 0xdc000000, "?Nnx,b,w", pa20, FLAG_STRICT},
! { "cmpb", 0x80000000, 0xf4000000, "?nnx,b,w", pa10, FLAG_STRICT},
{ "comb", 0x80000000, 0xfc000000, "?nnx,b,w", pa10, 0}, /* comb{tf} */
/* This entry is for the disassembler only. It will never be used by
assembler. */
*** orig/gas/config/tc-hppa.c Fri Sep 24 16:09:59 1999
--- gas-src/gas/config/tc-hppa.c Fri Sep 24 16:48:49 1999
***************
*** 2312,2318 ****
cmpltr = pa_parse_nonneg_add_cmpltr (&s, 1);
if (cmpltr < 0)
{
! as_bad (_("Invalid Compare/Subtract Condition: %c"), *s);
cmpltr = 0;
}
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
--- 2312,2318 ----
cmpltr = pa_parse_nonneg_add_cmpltr (&s, 1);
if (cmpltr < 0)
{
! as_bad (_("Invalid Add and Branch Condition: %c"), *s);
cmpltr = 0;
}
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
***************
*** 2508,2523 ****
/* Handle a 64 bit compare and branch condition. */
case 'N':
cmpltr = pa_parse_cmpb_64_cmpltr (&s);
! if (cmpltr < 0)
! {
! as_bad (_("Invalid 64 Bit Compare and Branch Condition."));
! cmpltr = 0;
! }
! else
{
/* Negated condition requires an opcode change. */
opcode |= (cmpltr & 8) << 26;
}
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr & 7, 13);
--- 2508,2521 ----
/* Handle a 64 bit compare and branch condition. */
case 'N':
cmpltr = pa_parse_cmpb_64_cmpltr (&s);
! if (cmpltr >= 0)
{
/* Negated condition requires an opcode change. */
opcode |= (cmpltr & 8) << 26;
}
+ else
+ /* Not a 64 bit cond. Give 32 bit a chance. */
+ break;
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr & 7, 13);
***************
*** 2525,2534 ****
case 'Q':
cmpltr = pa_parse_cmpib_64_cmpltr (&s);
if (cmpltr < 0)
! {
! as_bad (_("Invalid 64 Bit Compare Immediate Branch Condition."));
! cmpltr = 0;
! }
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
--- 2523,2530 ----
case 'Q':
cmpltr = pa_parse_cmpib_64_cmpltr (&s);
if (cmpltr < 0)
! /* Not a 64 bit cond. Give 32 bit a chance. */
! break;
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
***************
*** 5288,5296 ****
char *name = *s + 1;
char c;
char *save_s = *s;
- int nullify = 0;
! cmpltr = 0;
if (**s == ',')
{
*s += 1;
--- 5284,5291 ----
char *name = *s + 1;
char c;
char *save_s = *s;
! cmpltr = -1;
if (**s == ',')
{
*s += 1;
***************
*** 5363,5375 ****
{
cmpltr = 15;
}
- /* If we have something like addb,n then there is no condition
- completer. */
- else if (strcasecmp (name, "n") == 0)
- {
- cmpltr = 0;
- nullify = 1;
- }
else
{
cmpltr = -1;
--- 5358,5363 ----
***************
*** 5377,5386 ****
**s = c;
}
- /* Reset pointers if this was really a ,n for a branch instruction. */
- if (nullify)
- *s = save_s;
-
return cmpltr;
}
--- 5365,5370 ----
***************
*** 5396,5404 ****
char *name = *s + 1;
char c;
char *save_s = *s;
- int nullify = 0;
! cmpltr = 0;
if (**s == ',')
{
*s += 1;
--- 5380,5387 ----
char *name = *s + 1;
char c;
char *save_s = *s;
! cmpltr = -1;
if (**s == ',')
{
*s += 1;
***************
*** 5439,5461 ****
{
cmpltr = 7;
}
- /* If we have something like addb,n then there is no condition
- completer. */
- else if (strcasecmp (name, "n") == 0)
- {
- cmpltr = 0;
- nullify = 1;
- }
else
{
cmpltr = -1;
}
**s = c;
}
-
- /* Reset pointers if this was really a ,n for a branch instruction. */
- if (nullify)
- *s = save_s;
return cmpltr;
--- 5422,5433 ----
next reply other threads:[~1999-09-24 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-24 13:57 Jerry Quinn [this message]
1999-09-24 13:57 Jerry Quinn
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=27470.938206666.0@NO-ID-FOUND.mhonarc.org \
--to=jquinn@nortelnetworks.com \
--cc=binutils@sourceware.cygnus.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).