flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4, 5, 6 |
Author |
|
randomdude 16 Jul 2014, 18:42
@offtopic
can we expect that everybody nowdays has a computer with supports for mmx instructions? i see most games/programs still use old instructions only |
|||
![]() |
|
r22 16 Jul 2014, 19:38
@randomdude - Check the release dates for SSE/2/3/4 AVX/2 and base your decision on how far back you're willing to support.
|
|||
![]() |
|
JohnFound 16 Jul 2014, 22:22
randomdude wrote: @offtopic It is not exactly offtopic. Actually I also wander whether it is good idea to use MMX and the other newer instruction sets... For the MMX, the answer is probably "yes". The CPUs without MMX actually are not in use today. The answer for the remaming: SSE, etc. is not so clear, but most of them are for floating point arithmetics, that is not so widely used in assembly programming (but is still essential for some tasks). So, here one have to decide on case-by-case basis... _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
![]() |
|
HaHaAnonymous 17 Jul 2014, 03:22
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 18:05; edited 1 time in total |
|||
![]() |
|
JohnFound 17 Jul 2014, 05:37
90% is not enough. IMHO, 99% if the bare minimum and 99.5% is desirable goal.
|
|||
![]() |
|
redsock 17 Jul 2014, 06:41
Chiming in after having read through this entire thread... IMO Paul Hsieh covered this pretty well, and while I did see a few "extreme likeness" to his effort and specifically Alan Mycroft/Norbert Juffa, no one seems to have covered it verbatim... in my experimenting, (small) C strings don't benefit from the added SSE* overhead, and still haven't... all of my code uses the following code bit... see Paul's length section re: same at http://www.azillionmonkeys.com/qed/asmexample.html...
$0.02 thusly, hehe Cheers Code: macro calign { local a virtual align 16 a = $ - $$ end virtual if a = 15 db 0x66, 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x66, 0xf, 0x1f, 0x44, 0x00, 0x00 else if a = 14 db 0x66, 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 db 0xf, 0x1f, 0x44, 0x00, 0x00 else if a = 13 db 0x66, 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 db 0xf, 0x1f, 0x40, 0x00 else if a = 12 db 0x66, 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 db 0xf, 0x1f, 0x00 else if a = 11 db 0x66, 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x66, 0x90 else if a = 10 db 0x66, 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x90 else if a = 9 db 0x66, 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 else if a = 8 db 0xf, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 else if a = 7 db 0xf, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 else if a = 6 db 0x66, 0xf, 0x1f, 0x44, 0x00, 0x00 else if a = 5 db 0xf, 0x1f, 0x44, 0x00, 0x00 else if a = 4 db 0xf, 0x1f, 0x40, 0x00 else if a = 3 db 0xf, 0x1f, 0x00 else if a = 2 db 0x66, 0x90 else if a = 1 db 0x90 end if } align 16 strlen_latin1: mov rax, rdi sub rax, 1 calign .top: add rax, 1 test rax, 3 jnz .misaligned calign .inner: mov ecx, [rax] add rax, 4 mov edx, ecx not ecx sub edx, 0x01010101 and ecx, 0x80808080 and ecx, edx jz .inner sub rax, 4 calign .misaligned: cmp byte [rax], 0 jne .top sub rax, rdi ret |
|||
![]() |
|
Goto page Previous 1, 2, 3, 4, 5, 6 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.