flat assembler
Message board for the users of flat assembler.

Index > Main > Branch Likely Taken or Branch Unlikely Taken: mnemonic?


What should be FASM's mnemonics for Branch Likely Taken and Branch Unlikely Taken?
UT, LT
0%
 0%  [ 0 ]
BHT, BHNT
13%
 13%  [ 2 ]
HT, HNT
6%
 6%  [ 1 ]
LTJ, UTJ
6%
 6%  [ 1 ]
JES, NE
6%
 6%  [ 1 ]
HINT, NOHINT
0%
 0%  [ 0 ]
(other, not mentioned above)
6%
 6%  [ 1 ]
(none of the above, just stick to CS and DS)
60%
 60%  [ 9 ]
Total Votes : 15

Author
Thread Post new topic Reply to topic
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 11 Jun 2006, 19:16
Okay, let's get a feel for what people would prefer to use (although, obviously, the implementation is fully at Privalov's discretion).
Post 11 Jun 2006, 19:16
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 11 Jun 2006, 19:26
I'd prefer to stick with CS and DS (unless Intel/AMD come up with some standard), taking into consideration that other segment prefixes may also have some applications (see http://board.flatassembler.net/topic.php?p=39873#39873).
Post 11 Jun 2006, 19:26
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 11 Jun 2006, 20:18
I agree with Tomasz, specially because you can always use EQU to add the mnemonics.

AMD has this feature? which cores?
Post 11 Jun 2006, 20:18
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 12 Jun 2006, 13:10
According to Agner Fog's research, it's an undocumented feature of Pentium 4. Some testing would be needed on newer AMD processors to see if they made it, too.
Post 12 Jun 2006, 13:10
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 12 Jun 2006, 14:42
If you have some code that demostrates the existence of the feature post it and I'll test it for you. I have a Venice core

Regards
Post 12 Jun 2006, 14:42
View user's profile Send private message Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 13 Jun 2006, 12:39
What about some modification of the instruction mnemonic itself, e.g., lje (likely taken jump if equal), ujb (unlikely taken jump if below), ajnbe (alternating jump if not above or equal)? It is ugly, but not uglier than lt je and ut jb.
Post 13 Jun 2006, 12:39
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 13 Jun 2006, 13:01
Code:
irps instr, ja jae jb jbe jc jcxz jecxz je jg jge jl jle jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns jnz jo jp jpe jpo js jz
{ 
    macro l#instr offset\{ds instr offset\}
    macro u#instr offset\{cs instr offset\}
    ; Agner Fog's discovery
    macro a#instr offset\{fs instr offset\}
}    


Nice idea MazeGen, I still think that Tomasz is right in wait for a standard. However you can use macros in the mean time Very Happy

Regards

[edit]match directive removed and added Agner Fog's discovery[/edit]


Last edited by LocoDelAssembly on 13 Jun 2006, 13:13; edited 1 time in total
Post 13 Jun 2006, 13:01
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 13 Jun 2006, 13:03
The "match" is redundant in your macro. Wink
Post 13 Jun 2006, 13:03
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 13 Jun 2006, 13:17
Corrected, I used match because without it the source didn't pass the preprossessing stage, however I had not this problem again :S I don't know which was the first problem but anyway, it works fine know Very Happy

Regards
Post 13 Jun 2006, 13:17
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 13 Jun 2006, 22:05
This feature is documented
Intel manual "Volume 2A: Instruction Set Reference A-M" has a sub-chapter "Instruction prefixes" and there are mentioned the branch hints prefixes.

EDIT: Ah, I misunderstood Tomasz's post Embarassed. I thought the branch taken/not taken hints are the undocumented prefixes, and showed a reference to such info. But the trick with FS is in fact undocumented.
Post 13 Jun 2006, 22:05
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.