This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mode dependent constants
- To: vbrahmaiah at yahoo dot com (brahmaiah vallabhaneni)
- Subject: Re: mode dependent constants
- From: Joern Rennecke <amylaar at cambridge dot redhat dot com>
- Date: Fri, 9 Feb 2001 13:17:00 +0000 (GMT)
- Cc: gcc at gcc dot gnu dot org, hp at axis dot se
> I am working for gcc z80 port.
> In z80 the valid constants range depends on the
> instruction that involves the constants.
> If it is an 8 bit operation, the valid range is
> -128 to 127 and it differs in the 16 bit
> operations.
> But in gcc I am not able to figure out how to
> handle this. The macro LEGITIMATE_CONSTANT
> checks for the valid constant range. But actually if
> I say
> some mode dependent check, it does n't work.
>
> May be because constants can pass any mode.
> Could you please tell me how to handle this.
> If I am assuming something wrong please let me
> know.thanks and regards
> V.Brahmaiah
LEGITIMATE_CONSTANT only says if the constant is valid for some insn.
Others might still reject it. You should use predicates and constraints
an the different insns to specify which constants are allowed.