Bug 11417 – rotate with immediate not recognized by optimizer

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-01T19:16:00Z
Last change time
2015-06-09T05:11:38Z
Keywords
pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2013-11-01T19:16:22Z
cat > bug.d << CODE uint rol(uint n)(in uint x) { return x << n | x >> 32 - n; } uint ror(uint n)(in uint x) { return x >> n | x << 32 - n; } alias rol8 = rol!8; alias ror8 = ror!8; CODE dmd -O -release -inline bug obj2asm bug.o ---- shl EAX,8 shr EDI,018h or EAX,EDI shr EAX,8 shl EDI,018h or EAX,EDI ---- While Issue 6829 which uses an runtime shift works the instruction with an immediate shift isn't recognized by the compiler.
Comment #1 by yebblies — 2013-11-14T22:49:36Z
Comment #2 by github-bugzilla — 2013-11-15T14:42:46Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6cdeae745a816d68c13dbdf7db06dd6c05e32f7f Fix Issue 11417 - rotate with immediate not recognized by optimizer https://github.com/D-Programming-Language/dmd/commit/964188a54b363574adfcbf00847944b2cd713ec4 Merge pull request #2772 from yebblies/issue11417 Issue 11417 - rotate with immediate not recognized by optimizer
Comment #3 by github-bugzilla — 2013-11-15T15:01:45Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a8693d0a053a8c3ec88712956905e5d3c731dc3e Merge pull request #2772 from yebblies/issue11417 Issue 11417 - rotate with immediate not recognized by optimizer