SIGN IN SIGN UP

Protocol Buffers - Google's data interchange format

0 0 35 C++

Add BTI to branch targets when branch protection is enabled. This resolves

https://github.com/protocolbuffers/protobuf/issues/23306

Since there's a measurable performance cost (~12% for a long varint heavy message) on little and mid size cores, these instructions aren't unconditionally emitted even though they're compatible (CPUs lacking FEAT_BTI interpret them as HINT/NOP). Even with these extra instructions, the assembly path is still much faster than the generic one.

PiperOrigin-RevId: 834093313
P
Protobuf Team Bot committed
a3ca522fc5d9e364910dee60e1f30a945ebf6762
Parent: ea940ef
Committed by Copybara-Service <copybara-worker@google.com> on 11/19/2025, 4:44:01 AM