flat assembler
Message board for the users of flat assembler.
Index
> Main > Branch hint prefixes |
Author |
|
revolution 15 Jul 2010, 13:38
It means you can tell the CPU whether the branch is most likely to be taken or not. Rather than rely on the static prediction the CPU provides.
But, don't try to understand too deeply, they are mostly useless, and only have any effect on a very narrow range of one type of one manufacturer's CPU. |
|||
15 Jul 2010, 13:38 |
|
edfed 15 Jul 2010, 14:14
hum.. if these prefixes can be used on many X86 CPU, it can be interrresting for big loops. for exemple, a functions that compute on many audio samples, will run inside the loop a lot of time, compared to a branch that will occur rarelly like the null terminating char.
using these prefixes can be interresting, i'll look it deeper one day. what symbol can be used to declare the branch hint prefixes? Code: @@: lodsd cmp eax,0 true jne @b @@: lodsd cmp eax,0 false je @b something like that. true and false keywords just before the instruction. yes or no? |
|||
15 Jul 2010, 14:14 |
|
revolution 15 Jul 2010, 14:29
IIRC the override is only active when the branch has no history stored in the BTB. So you have to be executing a lot of "new" code the CPU has not seen before to make use of the hint. For loops and other normal things the static predictor + BTB will almost always get it right and no hint is needed.
|
|||
15 Jul 2010, 14:29 |
|
MazeGen 15 Jul 2010, 17:34
Branch hint prefixes are not of much use today as Intel abandoned NetBurst microarchitecture:
http://ref.x86asm.net/geek32.html#gen_note_branch_prefixes |
|||
15 Jul 2010, 17:34 |
|
Teehee 15 Jul 2010, 22:44
phew, one less thing to worry about.
|
|||
15 Jul 2010, 22:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.