Home | Notifications | New Note | Local | Federated | Search | Logout

Note Detail


nytpu the wyvern@nytpu@tilde.zone (2026-10-01 07:33:53)
Anyone have suggestions on an assembly syntax for manual branch prediction hints? (As in, marking a branch as being likely or unlikely to be taken)

Even though the Pentium 4‡ actually implemented branch prediction hints, I can't find a single example of assembly syntax for it for any architecture (since manually hinted branch prediction was kinda DOA but I want to implement it anyways lol)

‡ EDIT: and PowerPC, just it's just difficult-to-impossible to research anything at all about it on modern search engines
Reply

---Replies---
Sun Microdevil Pte Ltd@koakuma@uwu.social (2026-10-15 14:16:05)
@nytpu Itanium has a quite nice two-part set of hints I think

You have the dynamicity hint (sp/dp), where sp (static prediction) makes it so that the processor will never use the dynamic prediction machinery for that branch

And the usual direction ones (tk/nt) (TaKen/Not Taken)

You can combine it like "sptk", "dpnt", etc.