flat assembler
Message board for the users of flat assembler.
Index
> Main > disappointed with xor eax,eax \ cmovnz eax,[eax] |
Author |
|
edemko 21 Jun 2010, 22:22
good night(it's 1:07 due Kiev here now)
the way CPU processes a cmovCC instruction shocked me: following sequence rises memory access violation: Code: xor eax,eax cmovnz eax,[eax] so i got a bug which says our AMD Sempron 1400(2500++) fetches memory contents and only then solves whether it is needed or not; the pitty is it was intended to remove unwanted jumps; do you get same deal state too?; eh, my proc crashed; well, be aware optimizing, contact Fog Agner :); you know Tomasz, \ would be good instros/per line separator: Code: hlt \ hlt ; :( 1:21 - 8 minutes edit: http://board.flatassembler.net/topic.php?t=1938 |
|||
21 Jun 2010, 22:22 |
|
edemko 21 Jun 2010, 22:25
Quote:
please |
|||
21 Jun 2010, 22:25 |
|
revolution 22 Jun 2010, 06:13
This is a consequence of the pipelining in the x86 architecture. The cmovcc instruction is only evaluated at the end of the pipeline, long after the operands have been fetched. So all register values and memory values much be fetched and available before the condition flags are known or tested.
IMO cmovcc in x86 is seriously broken. Most other CPU architectures with similar instructions can be used with faulting addresses when the condition fails by using deferrable memory fault generation. |
|||
22 Jun 2010, 06:13 |
|
sinsi 22 Jun 2010, 06:49
Looking in the Intel docs for cmov, in the pseudo-code the first thing is
Quote: temp ← SRC Where would your code be used? |
|||
22 Jun 2010, 06:49 |
|
edemko 22 Jun 2010, 07:27
Quote:
Oh, i was playing with borland styled dynamic strings(re_working for ansi version again) as not satisfied with standard c-styled. I was going to make a Tool submenu(test version) in fasmw.exe and found tool absense for myself. BTW a year ago i was so naive treating them perfect that was sending them to TG and MartinMocko with the purpose those would be useful <- hahahahahahah ah. This time those are really rapid. Real code i'll publish today later was: Code: ;it was wariable into register pulling test ecx,ecx cmovz ebp,ecx cmovnz ebp,[ecx-4] |
|||
22 Jun 2010, 07:27 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.