4dad76
From 4f0ded009bf6de2da6a2a2022bec03576dcb80ca Mon Sep 17 00:00:00 2001
4dad76
From: Karl Williamson <khw@cpan.org>
4dad76
Date: Wed, 1 May 2019 10:41:38 -0600
4dad76
Subject: [PATCH] pp.c: Add two UNLIKELY()s
4dad76
MIME-Version: 1.0
4dad76
Content-Type: text/plain; charset=UTF-8
4dad76
Content-Transfer-Encoding: 8bit
4dad76
4dad76
It should be uncommon to shift beyond a full word
4dad76
4dad76
Signed-off-by: Ported to 5.30.0 from
4dad76
bae047b68c92622bb4bb04499e36cdaa48138909.
4dad76
Signed-off-by: Petr Písař <ppisar@redhat.com>
4dad76
---
4dad76
 pp.c | 4 ++--
4dad76
 1 file changed, 2 insertions(+), 2 deletions(-)
4dad76
4dad76
diff --git a/pp.c b/pp.c
4dad76
index 90db3a0..7afb090 100644
4dad76
--- a/pp.c
4dad76
+++ b/pp.c
4dad76
@@ -1979,7 +1979,7 @@ static UV S_uv_shift(UV uv, int shift, bool left)
4dad76
        shift = -shift;
4dad76
        left = !left;
4dad76
    }
4dad76
-   if (shift >= IV_BITS) {
4dad76
+   if (UNLIKELY(shift >= IV_BITS)) {
4dad76
        return 0;
4dad76
    }
4dad76
    return left ? uv << shift : uv >> shift;
4dad76
@@ -1991,7 +1991,7 @@ static IV S_iv_shift(IV iv, int shift, bool left)
4dad76
        shift = -shift;
4dad76
        left = !left;
4dad76
    }
4dad76
-   if (shift >= IV_BITS) {
4dad76
+   if (UNLIKELY(shift >= IV_BITS)) {
4dad76
        return iv < 0 && !left ? -1 : 0;
4dad76
    }
4dad76
    return left ? iv << shift : iv >> shift;
4dad76
-- 
4dad76
2.20.1
4dad76