Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\math\int_sqrt.c Create Date:2022-07-28 06:43:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:_sqrt64 - strongly typed int_sqrt function when minimum 64 bit input* is expected.*@x: 64bit integer of which to calculate the sqrt

Proto:u32 int_sqrt64(u64 x)

Type:u32

Parameter:

TypeParameterName
u64x
50  y = 0
52  If x <= ULONG_MAX Then Return _sqrt - computes the integer square root*@x: integer of which to calculate the sqrt* Computes: floor(sqrt(x))
55  m = 1ULL << ( ls64 - find last set bit in a 64-bit word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffsll, but returns the position of the most significant set bit - 1 & ~1ULL)
56  When m != 0 cycle
57  b = y + m
58  y >>= 1
60  If x >= b Then
61  x -= b
62  y += m
64  m >>= 2
67  Return y