* Support SIGN-OPT attribute.
@ 2001-06-30 18:03 Geoffrey Keating
2001-06-30 19:28 ` Ben Elliston
0 siblings, 1 reply; 2+ messages in thread
From: Geoffrey Keating @ 2001-06-30 18:03 UTC (permalink / raw)
To: cgen
The SIGN-OPT field attribute was documented, used in a number of .cpu
files, was correctly output to the *_cgen_insert_operand routine...
but was never actually _implemented_ anywhere.
OK to commit?
--
Geoff Keating <geoffk@redhat.com>
===File ~/patches/cgen-signopt.patch========================
2001-06-30 Geoffrey Keating <geoffk@redhat.com>
* cgen-ibld.in (insert_normal): Support CGEN_IFLD_SIGN_OPT.
Index: cgen-ibld.in
===================================================================
RCS file: /cvs/cvsfiles/devo/opcodes/cgen-ibld.in,v
retrieving revision 1.14
diff -p -u -p -r1.14 cgen-ibld.in
--- cgen-ibld.in 2001/05/07 17:55:25 1.14
+++ cgen-ibld.in 2001/07/01 00:59:27
@@ -145,7 +145,22 @@ insert_normal (cd, value, attrs, word_of
}
/* Ensure VALUE will fit. */
- if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
+ if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
+ {
+ long minval = - (1L << (length - 1));
+ unsigned long maxval = mask;
+
+ if ((value > 0 && (unsigned long) value > maxval)
+ || value < minval)
+ {
+ /* xgettext:c-format */
+ sprintf (errbuf,
+ _("operand out of range (%ld not between %ld and %lu)"),
+ value, minval, maxval);
+ return errbuf;
+ }
+ }
+ else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
{
unsigned long maxval = mask;
============================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Support SIGN-OPT attribute.
2001-06-30 18:03 Support SIGN-OPT attribute Geoffrey Keating
@ 2001-06-30 19:28 ` Ben Elliston
0 siblings, 0 replies; 2+ messages in thread
From: Ben Elliston @ 2001-06-30 19:28 UTC (permalink / raw)
To: geoffk; +Cc: cgen
>>>>> "Geoffrey" == Geoffrey Keating <geoffk@thief.cygnus.com> writes:
Geoffrey> The SIGN-OPT field attribute was documented, used in a number of .cpu
Geoffrey> files, was correctly output to the *_cgen_insert_operand routine...
Geoffrey> but was never actually _implemented_ anywhere.
Geoffrey> OK to commit?
Approved. Thanks!
Ben
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-06-30 19:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-30 18:03 Support SIGN-OPT attribute Geoffrey Keating
2001-06-30 19:28 ` Ben Elliston
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).