- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The icc appears to have trouble optimizing with signed 64-bit divisions on x86_64. Sample compiled with icc-11.1.069:
[plain]s_div_rem: movq %rdx, %rcx movq %rdi, %rax cqto idivq %rsi movq %rdi, %rax movq %rdx, (%rcx) cqto idivq %rsi ret u_div_rem: movq %rdx, %rcx movq %rdi, %rax xorl %edx, %edx divq %rsi movq %rdx, (%rcx) ret [/plain]Note that the compiler has failed to eliminate the second idiv. The source code is attached:
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the delay in responding. It looks suspicious to me as well. I'm consulting with our experts on the subject in case there's some subtlety that escapes me, but it could well be a missed optimization opportunity. Thanks for pointing this out, and for the concise test case. I'll let you know what I find.
Thanks!
Dale
Thanks!
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've filed CQ153925 on this issue, I'll update here with further info.
Thanks!
Dale
Thanks!
Dale

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page