Re: [PATCH 2/8] i386: bitops: Rectify bogus "Ir" constraints

From: H. Peter Anvin
Date: Mon Jul 23 2007 - 14:29:22 EST


H. Peter Anvin wrote:
>
> "I" is correct. The Intel documentation on this is highly confusing
> (and has bugs in it), but it does unambiguously state:
>
> "Some assemblers support immediate bit offsets larger than 31 by using
> the immediate bit offset field in combination with the displacement
> field in the memory operand ... The processor will ignore the high-order
> bits if they are not zero." AMD processors might be different for all I
> know.
>
> So unless gas is capable of doing this transformation (and it's not as
> of binutils-2.17.50.0.6) "I" is what's needed here.
>

Just tested it on a K8 machine; AMD behaves the same way. So "I" is
correct, and changing it to "N" would introduce a bug.

The only way to optimize this is by using __builtin_constant_p() and
adjust the offset appropriately.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/