[PATCH 3/4, MIPS] Move clear_upper32* patterns to the and patterns

Adam Nemet anemet@caviumnetworks.com
Mon Aug 3 20:18:00 GMT 2009


Richard Sandiford writes:
> Adam Nemet <anemet@caviumnetworks.com> writes:
> > Well as I said I was thinking DI mode where only LBU and LHU are valid:
> >
> > (and:DI (mem:DI) (const_int 0xff/0xffff))
> >
> > IOW, you can't generate ZEB and ZEH for:
> >
> > (and:DI (reg:DI) (const_int 0xff/0xffff))
> >
> > but you're right in SI mode we can also do ZEB and ZEH in addition to LBU and
> > LHU.
> 
> Well, you can do it in DImode too (and we already use ZEB and ZEH
> for DImode).  ZEH and ZEB are really just encodings of "andi ...,0xFF"
> and "andi ...,0xFFFF", with all that implies for 64-bit targets.

I think you misunderstood me, I meant DI mode input as in:

  (zero_extend:DI (subreg:SI (reg:DI) 0))

I don't think we use that.  The MIPS16e ASE spec says under ZEB and ZEH:

  Restrictions:
  If GPR rx does not contain a sign-extended 32-bit value (bits 63..31 equal), then the result of the operation is
  UNPREDICTABLE.

Adam



More information about the Gcc-patches mailing list