diff options
| author | 2025-02-14 16:54:10 +0000 | |
|---|---|---|
| committer | 2025-02-14 16:54:10 +0000 | |
| commit | ebbdeee0bb91d5008a405e43114f1653ecdf8ce8 (patch) | |
| tree | d9b1c087a34e6f5947d553f7cb04503b3c411e93 /vendor/modernc.org/libc/builtin64.go | |
| parent | [bugfix] Drop status indices AFTER updating visibility (#3795) (diff) | |
| download | gotosocial-ebbdeee0bb91d5008a405e43114f1653ecdf8ce8.tar.xz | |
bump modernc.org/sqlite to v1.35.0-concurrency-workaround (#3797)
Diffstat (limited to 'vendor/modernc.org/libc/builtin64.go')
| -rw-r--r-- | vendor/modernc.org/libc/builtin64.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/modernc.org/libc/builtin64.go b/vendor/modernc.org/libc/builtin64.go new file mode 100644 index 000000000..9dce964f5 --- /dev/null +++ b/vendor/modernc.org/libc/builtin64.go @@ -0,0 +1,24 @@ +// Copyright 2024 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux && (amd64 || arm64 || loong64 || ppc64le || s390x || riscv64) + +package libc // import "modernc.org/libc" + +import ( + mbits "math/bits" +) + +func X__builtin_ctzl(tls *TLS, x ulong) int32 { + return int32(mbits.TrailingZeros64(x)) +} + +func X__builtin_clzl(t *TLS, n ulong) int32 { + return int32(mbits.LeadingZeros64(n)) +} + +// int __builtin_popcountl (unsigned long x) +func X__builtin_popcountl(t *TLS, x ulong) int32 { + return int32(mbits.OnesCount64(x)) +} |
