Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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.dk


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 985c8dcb
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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;