Re: [PATCH] x86: clean up unnecessarily wide TEST insns
From: Andy Lutomirski
Date: Fri Mar 06 2015 - 17:33:32 EST
On Fri, Mar 6, 2015 at 2:24 PM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
> Denys Vlasenko <dvlasenk@xxxxxxxxxx> writes:
>
>> By the nature of TEST operation, it is often possible
>> to test a narrower part of the operand:
>> "testl $3, mem" -> "testb $3, mem",
>> "testq $3, %rcx" -> "testb $3, %cl"
>> This results in shorter insns, because TEST insn has no
>> sign-entending byte-immediate forms unlike other ALU ops.
>
> It also results in expensive LCP stalls. Please don't do it.
> If you feel the need to change instructions around like this read
> the optimization manuals first.
Is this true for register access or just memory?
--Andy
>
> -Andi
>
> --
> ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
Andy Lutomirski
AMA Capital Management, LLC
--
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/