Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22117

GCC Loop Increment Optimization -O2 and above

$
0
0

I've been doing some research involving optimization and loop unrolling and I've been looking at the generated assembly code for different optimization levels. I've come across a weird optimization strategy that gcc uses at -O2 and above. I was wondering if there was a name for this. Here's the generated assembly code:

mov    %rsi,(%rcx)
mov    %rsi,0x8(%rcx)
mov    %rsi,0x10(%rcx)
mov    %rsi,0x18(%rcx)
sub    $0xffffffffffffff80,%rcx // What is this called?
mov    %rsi,-0x60(%rcx)
mov    %rsi,-0x58(%rcx)
mov    %rsi,-0x50(%rcx)
mov    %rsi,-0x48(%rcx)
mov    %rsi,-0x38(%rcx)
mov    %rsi,-0x30(%rcx)
mov    %rsi,-0x28(%rcx)
mov    %rsi,-0x20(%rcx)
mov    %rsi,-0x18(%rcx)
mov    %rsi,-0x10(%rcx)
mov    %rsi,-0x8(%rcx)
cmp    %rdx,%r8

Viewing all articles
Browse latest Browse all 22117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>