I am disassembling this code on llvm clang Apple LLVM version 8.0.0 (clang-800.0.42.1):I compiled with no -O specifications, but I also tried with -O0 (gives the same) and -O2 (actually computes the value and stores it precomputed)
Recently started messing with AArch64 assembly and I noticed that it has an assigned register strictly for zero, whereas (most) other architectures you would just xor var, var.
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.
Consider the following definition of Foo:Now, consider the following definition of Bar, which has the same data member as Foo, but has an empty user-declared destructor:
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?
If I compile the following in Ubuntu 16.04 / gcc 7.3Like so:I get:Which "looks" like linux stack protection is being applied to VecA. A little bit on the defensive side, but I can understand how a compiler could reach that conclusion.