13 Commits

Author SHA1 Message Date
Mike Kruskal
3c5f7ea9fc Relocate and enhance CPU microarchitecture detection in Abseil
- Move cpu_detect to absl::base_internal, adding the kNvidiaGrace and kIntelGraniterapids enums.
- On aarch64 Linux, implement custom ISAR0.RNDR checking logic to distinguish kArmNeoverseV2 from kNvidiaGrace.
- Add IsSMTEnabled and NumContextsPerCPU

PiperOrigin-RevId: 922862384
Change-Id: I038b7732714400d6c63ff309bf20af3f436afcf5
2026-05-28 10:52:28 -07:00
Derek Mauro
5088cf5194 Cleanup the uses of the polyfills absl::any, absl::optional,
absl::variant, and related types

The corresponding headers are removed from cc files, but kept in
headers to prevent breakages from transitive dependencies.

PiperOrigin-RevId: 872421685
Change-Id: I867d4c3f7c9e422289c63816d44719b0530fb0a6
2026-02-19 08:53:17 -08:00
Derek Mauro
569ff20318 Cleanup duplicated bit-rotation code
PiperOrigin-RevId: 857286087
Change-Id: Ie79f5b9e7ca8417f6311750c0de469ca6de4a8f9
2026-01-16 13:38:01 -08:00
David Majnemer
6effb000ca Crc: Detect support for pmull and crc instructions on Apple AArch64
With a newer clang, we can use __builtin_cpu_supports which caches all
the feature bits.

If we are using an older clang, we fall back to querying sysctlbyname
for the relevant processor features.

PiperOrigin-RevId: 715153229
Change-Id: I570fa349f96829d5da3b32c928480ddf67176cad
2025-01-13 16:45:10 -08:00
Abseil Team
49ff696cda Migrate empty CrcCordState to absl::NoDestructor.
Note that this only changes how we allocate the empty state, and reference countings of `empty` stay the same.

PiperOrigin-RevId: 599526339
Change-Id: I2c6aaf875c144c947e17fe8f69692b1195b55dd7
2024-01-18 09:11:43 -08:00
Abseil Team
433289a258 Roll forward support for ARM intrinsics in crc_memcpy
This CL rolls forward a previous change which we rolled back temporarily due to
compilation errors on x86 when PCLMUL intrinsics were unavailable.

*** Original change description ***

This change replaces inline x86 intrinsics with generic versions that compile
for both x86 and ARM depending on the target arch.

This change does not enable the accelerated crc memcpy engine on ARM. That will
be done in a subsequent change after the optimal number of vector and integer
regions for different CPUs is determined.

***

PiperOrigin-RevId: 563416413
Change-Id: Iee630a15ed83c26659adb0e8a03d3f3d3a46d688
2023-09-07 06:53:24 -07:00
Abseil Team
461f1e49b3 Rollback adding support for ARM intrinsics
In some configurations this change causes compilation errors. We will roll this
forward again after those issue are addressed.

PiperOrigin-RevId: 562810916
Change-Id: I45b2a8d456273e9eff188f36da8f11323c4dfe66
2023-09-05 09:57:30 -07:00
Abseil Team
1a882833c0 Add support for ARM intrinsics in crc_memcpy
This change replaces inline x86 intrinsics with generic versions that compile
for both x86 and ARM depending on the target arch.

This change does not enable the accelerated crc memcpy engine on ARM. That will
be done in a subsequent change after the optimal number of vector and integer
regions for different CPUs is determined.

PiperOrigin-RevId: 562785420
Change-Id: I8ba4aa8de17587cedd92532f03767059a481f159
2023-09-05 08:24:39 -07:00
Abseil Team
e945c8d987 Implement AbslStringify for crc32c_t in order to support absl::StrFormat natively
PiperOrigin-RevId: 552940359
Change-Id: I925764757404c0c9f2a13ed729190d51f4ac46cf
2023-08-01 15:24:56 -07:00
Abseil Team
fc1dcc0f6a Changes absl::crc32c_t insertion operator (<<) to return value as 0-padded hex instead of dec
PiperOrigin-RevId: 552927211
Change-Id: I0375d60a9df4cdfc694fe8d3b3d790f80fc614a1
2023-08-01 14:41:35 -07:00
Derek Mauro
ff5644bb34 Allow Cord to store chunked checksums
PiperOrigin-RevId: 494587777
Change-Id: I41504edca6fcf750d52602fa84a33bc7fe5fbb48
2022-12-11 16:44:18 -08:00
Derek Mauro
e315808697 Use ABSL_HAVE_BUILTIN to fix -Wundef __has_builtin warning
Fixes #1329

PiperOrigin-RevId: 491372279
Change-Id: I93c094b06ece9cb9bdb39fd4541353e0344a1a57
2022-11-28 09:57:27 -08:00
Derek Mauro
1687dbf814 Release the CRC library
This implementation can advantage of hardware acceleration available
on common CPUs when using GCC and Clang. A future update may enable
this on MSVC as well.

PiperOrigin-RevId: 487327024
Change-Id: I99a8f1bcbdf25297e776537e23bd0a902e0818a1
2022-11-09 13:09:34 -08:00