In Delphi math.pas unit there is a procedure DivMod that i want to convert it into inline and optimize it for divisor to be always 10 . But I dont know details of Pentagon ASM . What is the conversion of bellow procedure
I was wondering if it is possible to decode x86-64 instructions in reverse?I need this for a runtime dissembler. Users can point to a random location in memory and then should be able to scroll upwards and see what instructions came before the specified address.
The execution times for these three snippets:And this:And this:Are, on a 4770K, roughly 5 cycles per iteration for the first snippet and roughly 9 cycles per iteration for the second snippet, then 5 cycles for the third snippet. They both access the exact same address, which is 4K-aligned. In the...
I was reading about the pipeline optimizations recently. I wanted to ask if I understand correctly how a processor handles pipelining.
Fully knowing that these completely artificial benchmarks don't mean much, I am nonetheless a bit surprised by the several ways the "big 4" compilers chose to compile a trivial snippet.
Executing following code:causes a run-time errror:Project HexFloat.exe raised exception class $C0000092 with message 'floating point stack check at 0x004e9903'.
For a 32-bit windows application is it valid to use stack memory below ESP for temporary swap space without explicitly decrementing ESP?
I've made a c/c++ program (mix of printf and std::) to get an idea of different cache performance. I would like to parallelize a process that's calculating over a big chunk of memory. I have to do several calculations on the same memory locations, so I've write the results on...
I was playing with the code in this answer, slightly modifying it:Without the lfence I the results I get are consistent with the static analysis in that answer.
Question: I'm looking for the best way to clear the lowest non-zero bit of a unsigned atomic like std::atomic_uint64_t in a threadsafe fashion without using an extra mutex or the like. In addition, I also need to know, which bit got cleared.