Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BD9AC4338F for ; Sun, 25 Jul 2021 13:22:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E20360555 for ; Sun, 25 Jul 2021 13:22:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6E20360555 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:55224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7e4z-0002p2-Cq for qemu-devel@archiver.kernel.org; Sun, 25 Jul 2021 09:22:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7e4M-00029L-2G for qemu-devel@nongnu.org; Sun, 25 Jul 2021 09:21:26 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:45611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m7e4K-0007pv-Cv for qemu-devel@nongnu.org; Sun, 25 Jul 2021 09:21:25 -0400 Received: by mail-pj1-x1031.google.com with SMTP id m10-20020a17090a34cab0290176b52c60ddso4318914pjf.4 for ; Sun, 25 Jul 2021 06:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=d2/4624cnC7PlfzzXleej5DvT9JGDQb8z7g1XxXZ9nk=; b=Om6dDv8HmIwxWRUvHPM5M3lwQJN4OydeyHD3J11xTPlwVr6dbZ3kPxrdLeaz0WazFm pRg0vqPaIVrZOstud1SxRUcpoJrWv90J+DTbloc+bjZ+8zw5eD47pgxGSsKKrAnoY+kW 9U/GHSx6qli7srWFT4yo4T6Y3SpHY/k0Oht3mXS+OOfMVtIJPcvQU1/WsVsW/00IZXJS D2pndILufvYmNp/2ApIGDrwmnRLKGhJOyFgZE6oe3R47Fu852wtw0GUUalpdXsJbmBoo +UiTrCvRISOGc0iolY2nFIk5MAnmIKbWb5363bC92Jmjvf9Xiejpm+PDwq5uZI73vlsK aJXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=d2/4624cnC7PlfzzXleej5DvT9JGDQb8z7g1XxXZ9nk=; b=qigLxgCilCWeckvYnP0tt1jWI80hZkON8yLLD+7ttIY7mS1er66/Cu5xnYKdhIuBZV y5Yf+3KiRry/L6YjsUn0ydJ9jrlLeoJkfKntFy5COLxi419jWfZX3Hbc0vgWFFwI/AGI exdzxbKu7leBLFEOcjBWEi1dKlT4+zHpC6Fe2FDDl6vgDgLiJQ8UJXytSK0MTd9cueIs ZVA0koqy2EXxoHIaNRXynxW/T/WZMVzC+NRRdx1vOJ+kYhSRTEsMJ5NR63hCrHt/kM/s xSkwGi+vSBwh6XFrZZucne0ryXi9bg+aRDMEFYtuEkIeN/nr2KVVNkZzKdZ1dZ3u1g2i eZ+w== X-Gm-Message-State: AOAM533r1qA66YUS715L4CDQgQDMTM5oTKnkqS1CjcQpsAyPpHYEcbcB pZMBbmKXt4/Cbb2U7dPhNTozQg== X-Google-Smtp-Source: ABdhPJweS7pAxhE/lMgMOdIomy1wsWdLiNxoAwIfHzDY9UkRAjdu5FKa/MCMkAnR2lcpCkqZnSgOtQ== X-Received: by 2002:a65:6110:: with SMTP id z16mr10120117pgu.152.1627219282041; Sun, 25 Jul 2021 06:21:22 -0700 (PDT) Received: from ?IPv6:2603:800c:3202:ffa7:497b:6ae4:953c:7ad1? (2603-800c-3202-ffa7-497b-6ae4-953c-7ad1.res6.spectrum.com. [2603:800c:3202:ffa7:497b:6ae4:953c:7ad1]) by smtp.gmail.com with ESMTPSA id d2sm40376081pfa.84.2021.07.25.06.21.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Jul 2021 06:21:21 -0700 (PDT) Subject: Re: [PATCH 11/20] Hexagon HVX (target/hexagon) instruction utility functions To: Taylor Simpson , qemu-devel@nongnu.org References: <1625528074-19440-1-git-send-email-tsimpson@quicinc.com> <1625528074-19440-12-git-send-email-tsimpson@quicinc.com> From: Richard Henderson Message-ID: Date: Sun, 25 Jul 2021 03:21:18 -1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1625528074-19440-12-git-send-email-tsimpson@quicinc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.google.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.091, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ale@rev.ng, bcain@quicinc.com, philmd@redhat.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 7/5/21 1:34 PM, Taylor Simpson wrote: > Functions to support scatter/gather ... > +uint32_t count_leading_ones_2(uint16_t src) > +{ > + int ret; > + for (ret = 0; src & 0x8000; src <<= 1) { > + ret++; > + } > + return ret; > +} Not related to scatter/gather. Also, much better implemented as clz32(~src & 0xffff) - 16 r~