flat assembler
Message board for the users of flat assembler.
Index
> Main > Beauty in x86 assembly? Goto page Previous 1, 2 |
Author |
|
Furs 29 Apr 2018, 12:24
revolution wrote: It isn't just the CPU though. Even if you knew exactly every transistor, it is still the code you are running that affects things. On some CPUs the OOO buffer is more than 100 instructions long. So you also have to know every one of those 100+ instructions ahead of your snippet, and which port they will go into, and what instructions are currently in each port, and how many ports you have, and whether or not the memory read/write buffers are full, and the current state of the BTB and caches, whether or not another SMP instruction stream is interleaved with your stream, etc. etc. etc. It's mind bogglingly complex. It's not often you see hyperthreading double the performance, but it does happen (and it did for me) when I did a brute force test of a very long latency-bottlenecked algorithm (but you could parallelize individual inputs of course). Using 8 threads with hyperthreading finished in almost half the time I estimated with 4 threads (8 threads with HT), which was a 2 hour gain. And that's with me still using my PC for lightweight stuff (I lowered the priority on that test program to minimum). |
|||
29 Apr 2018, 12:24 |
|
revolution 29 Apr 2018, 13:15
Furs wrote: Sometimes it's good to have unused ports or units in a thread, because they become free to use for another thread with Hyperthreading. |
|||
29 Apr 2018, 13:15 |
|
rugxulo 02 May 2018, 02:25
Remember the 62-byte Sudoku solver (DOS .COM) we discussed years ago?
There's also Assembly Gems (archived). Bob Swart wrote about Borland Pascal Efficiency, and one interesting snippet is this: Code: function IsAscii(C: Char): Boolean; InLine( $5B/ { POP BX } $31/$C0/ { XOR AX,AX } $D0/$E3/ { SHL BL,1 } $1C/$FF); { SBB AL,$FF } |
|||
02 May 2018, 02:25 |
|
Picnic 03 May 2018, 14:20
This snippet prints a two-digit number in AL (11 bytes).
Code: putn: aam push A A:xchg al,ah add al,48 int 0x29 ret |
|||
03 May 2018, 14:20 |
|
revolution 03 May 2018, 14:29
Picnic wrote: This snippet prints a two-digit number in AL (11 bytes). |
|||
03 May 2018, 14:29 |
|
Picnic 03 May 2018, 14:40
Yes, it is the 29h Fast console output (more about here Undocumented DOS Programming).
If i recall well i saw it inside one of the 256 byte demo, many years ago. |
|||
03 May 2018, 14:40 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.