[patch] Hookize SMALL_REGISTER_CLASSES

Uros Bizjak ubizjak@gmail.com
Mon May 3 19:29:00 GMT 2010


Hello!

>> I know it's silly, but can you split out the hookization from the i386
>> change? ?That way the hookization itself becomes obvious and
>> a i386 maintainer can approve that piece separately (and we can
>> revert it separately).
>>
>> And yes, this is an approval for the hookization-only variant.
> 
> OK, I've committed that part. Here is the i386 part. OK?

> Index: config/i386/i386.c
> ===================================================================
> --- config/i386/i386.c	(revision 158996)
> +++ config/i386/i386.c	(working copy)
> @@ -25302,6 +25302,31 @@ ix86_cannot_change_mode_class (enum mach
>    return false;
>  }
> 
> +/* Implement target hook small_register_classes_for_mode_p.  */
> +
> +bool
> +ix86_small_register_classes_for_mode_p (enum machine_mode mode)
> +{
> +  /* On 32-bits x86, all register classes are considered small.  */
> +  if (! TARGET_64BIT)
> +    return true;
> +
> +  /* Any mode that is OK for SSE or AVX registers is not likely
> +     to be allocated to a small class.  */
> +  if (TARGET_SSE_MATH
> +      && (SSE_FLOAT_MODE_P (mode) || VECTOR_MODE_P (mode)))
> +    return false;
> +
> +  /* AMD64 has 16 registers for >=32 bits integers.  This is not
> +     large compared to RISC/VLIW architectures, but it is big
> +     enough for us to consider it non-small.  */
> +  if (SCALAR_INT_MODE_P (mode) && GET_MODE_SIZE (mode) >= 32)
> +    return false;

As mentioned elsewhere, all registers can be accessed as 8bit or 16bit
in addition to 32bit and 64bit on x86_64.

Uros.



More information about the Gcc-patches mailing list