[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function
- To: Rahul Singh <Rahul.Singh@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Tue, 12 Jan 2021 11:35:46 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M+216yQ1WbMZaug+B6fcdodgrjl+5luN9zrVBDrIfhA=; b=bcrzkSCKSpeALcV2jjn34DTi4jG01y+C2H+4KxG3jBHDgEKIi5JEtvsd4U7roKYh/T2aH/nbFY2aJwllZ4LFXuj1eZepnFRjHgny7x+oIlqV5TMV+Dleee19TzT4nSSL6qdK0zZrVZRgdO9LuxEe7u9ahYf3GIOlcpy74II4OMpdGuCmXmSV+CMEbvBCkkLMejVc2Mts5CB4J5MAH+XH0Dmuaius8NDXPeJWeL/VKc6u8NFWFYAEVgEgGlZTTIodw56QA0BTKfP3HsmVpS/8hEL9uUPsScrgoN5LcmYJw/kSsrwIcKE0YsXK9iahZdtuqqESYk5q5tSPqqPA8OQToA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oMEcRS3afpE4FbLfZ/EeIgoB50Wexgnvo+H7Bq89RKswLE/xtsEyOhwqMaJdRyXzzRu/cSP0IOGAcZOeEJVDgSpoAwlE106iTfknE1b3YeEPnJnkgW5k6iuFnbyDYFpLtu0uH8RBFZP4AK9BRmnDYY7t1aeHgD2Xw6KQwY8ejMbW3veqMZPJoyrV63ZQQJWmSY/Dvkssw7lAgXNwB4wMLhVPj2u9O1zTmm9dG0PB1BocpsaWgdFlT8Pg32bVjXz3vJCA0ekjaLymvJMUO08pT5hYaXG5fC4rPpMef7Ln6nVUaoWloATFSLDypmXONvwTSF3gskxPvCOXnlK+2/3O9Q==
- Authentication-results-original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Tue, 12 Jan 2021 11:35:57 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Thread-index: AQHW5c2vv6J1akVlkkOrk3JqhZNFu6oj4ocA
- Thread-topic: [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function
Hi,
> On 8 Jan 2021, at 14:46, Rahul Singh <Rahul.Singh@xxxxxxx> wrote:
>
> Implement the ffsll based on built-in function "__builtin_ffsll()"
>
> ffsll will return one plus the index of the least significant 1-bit in
> doublewords or if doublewords is zero, returns zero.
>
> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
Cheers
Bertrand
> ---
> Changes in V4:
> - This patch is introduce in this verison.
> ---
> xen/include/asm-arm/bitops.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/xen/include/asm-arm/bitops.h b/xen/include/asm-arm/bitops.h
> index 71ae14cab3..7f83ee1828 100644
> --- a/xen/include/asm-arm/bitops.h
> +++ b/xen/include/asm-arm/bitops.h
> @@ -170,6 +170,18 @@ static inline unsigned int find_first_set_bit(unsigned
> long word)
> return ffsl(word) - 1;
> }
>
> +/**
> + * ffsll - find the first least significant set bit
> + * @doubleword: double word to search
> + *
> + * Returns one plus the index of the least significant 1-bit in @doubleword
> + * or if doubleword is zero, returns zero.
> + */
> +static inline int ffsll(long long doubleword)
> +{
> + return __builtin_ffsll(doubleword);
> +}
> +
> /**
> * hweightN - returns the hamming weight of a N-bit word
> * @x: the word to weigh
> --
> 2.17.1
>
|