This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about Machine Description
- From: Revital1 Eres <ERES at il dot ibm dot com>
- To: yazdanbakhsh <amir dot yazdanbakhsh at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 15 Jun 2010 12:29:52 +0300
- Subject: Re: Question about Machine Description
- References: <63281.24.163.112.200.1128386718.squirrel@webmail.ncsu.edu> <28433505.post@talk.nabble.com> <mcrr5lskb7f.fsf@dhcp-172-17-9-151.mtv.corp.google.com> <28439702.post@talk.nabble.com> <mcr6334kagr.fsf@dhcp-172-17-9-151.mtv.corp.google.com> <28447744.post@talk.nabble.com> <mcrpr1bg144.fsf@dhcp-172-17-9-151.mtv.corp.google.com> <28449607.post@talk.nabble.com> <mcr4oinfwny.fsf@dhcp-172-17-9-151.mtv.corp.google.com> <28476454.post@talk.nabble.com> <mcrbpcsye9x.fsf@dhcp-172-17-9-151.mtv.corp.google.com> <28503521.post@talk.nabble.com> <28790054.post@talk.nabble.com> <mcraar974zw.fsf@dhcp-172-17-9-151.mtv.corp.google.com> <28790996.post@talk.nabble.com> <mcry6es67iq.fsf@dhcp-172-17-9-151.mtv.corp.google.com> <28888872.post@talk.nabble.com>
Hello,
> I want to limit the size of immediate field of some operation.
I think you can look at SIGNED_INT_FITS_N_BITS definition at
config/crx/crx.c
for such example.
You can write a predicate like the following; and use it when describing
the immediate
operand in the md file.
(define_predicate "s24bits_operand"
(match_code "const_int")
{
return (SIGNED_INT_FITS_N_BITS(INTVAL(op), 24)) ? 1 : 0;
}
)
Thanks,
Revital