public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Mehak Mahajan <mehak.mahajan@gmail.com>
To: cgen@sources.redhat.com
Subject: Is there a function in cgen for parsing short integers?
Date: Thu, 17 Apr 2008 23:10:00 -0000	[thread overview]
Message-ID: <4807D8CD.20703@gmail.com> (raw)

Hi,

I am porting cgen to a 16 bit architecture. The immediates are 16 bits 
long. I am also parsing all hex numbers as signed numbers. Hence 0xFFFF 
will be -1.
When I parse -1, I get 0xFFFFFFFF, since cgen_parse_signed_integer 
accepts a long.
My problem is that since the max size of immediate can only be 16 bits, 
I want to flag an error if the user enters an immediate like 0xFFFFFFFF. 
However, since -1 is parsed as a long, there is no way for me to 
restrict the length of the immediates to 16 bits.

Is there an equivalent function for parsing short integers as well?

Cheers,
Mehak

             reply	other threads:[~2008-04-17 23:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-17 23:10 Mehak Mahajan [this message]
2008-04-18 15:24 ` Dave Brolley
2008-04-18 20:42 Mehak Mahajan
2008-04-19  0:09 ` Dave Brolley
2008-04-19 17:24   ` Dave Brolley

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=4807D8CD.20703@gmail.com \
    --to=mehak.mahajan@gmail.com \
    --cc=cgen@sources.redhat.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).