Commit 2172c1f5 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Ingo Molnar

perf/x86: Micro-optimize nhmex_rbox_get_constraint()

Flipping the LSB doesn't require four lines of code. This shaves a few
bytes of the generated code, including a branch.
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1403183731-15402-1-git-send-email-linux@rasmusvillemoes.dkSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 985c8dcb
......@@ -2946,10 +2946,7 @@ nhmex_rbox_get_constraint(struct intel_uncore_box *box, struct perf_event *event
* extra registers. If we failed to take an extra
* register, try the alternative.
*/
if (idx % 2)
idx--;
else
idx++;
idx ^= 1;
if (idx != reg1->idx % 6) {
if (idx == 2)
config1 >>= 8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment