[{"id":37915,"web_url":"https://patchwork.libcamera.org/comment/37915/","msgid":"<176917888850.302817.11641902956743250557@localhost>","date":"2026-01-23T14:34:48","subject":"Re: [PATCH v6 16/16] ipa: libipa: fixedpoint: Remove unsigned\n\tworkaround","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Kieran,\n\nQuoting Kieran Bingham (2026-01-21 18:37:35)\n> Now that we no longer attempt or allow storing signed negative floats\n> as an unsigned integer representation, remove the workaround which\n> required an intermediate cast when converting floats to fixed point values.\n> \n> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/ipa/libipa/fixedpoint.h | 7 +------\n>  1 file changed, 1 insertion(+), 6 deletions(-)\n> \n> diff --git a/src/ipa/libipa/fixedpoint.h b/src/ipa/libipa/fixedpoint.h\n> index 1a871bc554ef..b7dbb00cadaa 100644\n> --- a/src/ipa/libipa/fixedpoint.h\n> +++ b/src/ipa/libipa/fixedpoint.h\n> @@ -75,12 +75,7 @@ public:\n>         {\n>                 v = std::clamp(v, min, max);\n>  \n> -               /*\n> -                * The intermediate cast to int is needed on arm platforms to\n> -                * properly cast negative values. See\n> -                * https://embeddeduse.com/2013/08/25/casting-a-negative-float-to-an-unsigned-int/\n> -                */\n> -               return static_cast<T>(static_cast<int>(std::round(v * (1 << F)))) & bitMask;\n> +               return static_cast<T>(std::round(v * (1 << F))) & bitMask;\n\nI'm a bit sad, loosing that link :-)\n\nLooks good to me.\n\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> \n\nCheers,\nStefan\n\n>         }\n>  };\n>  \n> -- \n> 2.52.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D248FBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 Jan 2026 14:34:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0001461FC4;\n\tFri, 23 Jan 2026 15:34:52 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 64E27615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Jan 2026 15:34:51 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:1d92:9f27:5dd1:dc89])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id E83E9103D; \n\tFri, 23 Jan 2026 15:34:17 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hMQpyUep\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769178858;\n\tbh=dr5412Uim4YoJjLsQf2odQ7XKtf1XPPmcTMkY/a5Ahw=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=hMQpyUep0rZDLyJPZddjBlV1snAgUVkqEr2AWgngqPkD2paaI/OaaPF7ZDS5xoT8/\n\tNhDimWDGPiugiKs7emwKfqu49TmZPdkNufthABdxGyPy2qTkDaxo8Z87CFUFLeB2uB\n\tvVa/Vp96c2y+Y99ujFO2k/YftO4eSevYsY3FemtI=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260121173737.376113-17-kieran.bingham@ideasonboard.com>","References":"<20260121173737.376113-1-kieran.bingham@ideasonboard.com>\n\t<20260121173737.376113-17-kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v6 16/16] ipa: libipa: fixedpoint: Remove unsigned\n\tworkaround","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab?=\n\t=?utf-8?b?w6FzIFDFkWN6ZQ==?= <barnabas.pocze@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Fri, 23 Jan 2026 15:34:48 +0100","Message-ID":"<176917888850.302817.11641902956743250557@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]