[Issue 6829] Unsigned rotate standard function in Phobos, or rotate intrinsic in core.bitop

2021-06-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6829 moonlightsenti...@disroot.org changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 6829] Unsigned rotate standard function in Phobos

2013-11-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 Martin Nowak changed: What|Removed |Added CC||l...@luismarques.eu --- Comment #46 fro

[Issue 6829] Unsigned rotate standard function in Phobos

2013-09-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 k...@redstar.de changed: What|Removed |Added CC||k...@redstar.de --- Comment #45 from

[Issue 6829] Unsigned rotate standard function in Phobos

2013-08-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #44 from Iain Buclaw 2013-08-13 12:05:05 PDT --- (In reply to comment #42) > Guys, please, fix the bugs, not improve performance of DMD's backend. > For that purpose there are LDC and GDC. Intrinsics benefits GDC code generation a

[Issue 6829] Unsigned rotate standard function in Phobos

2013-08-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #43 from bearophile_h...@eml.cc 2013-08-13 11:20:41 PDT --- (In reply to comment #42) > Guys, please, fix the bugs, not improve performance of DMD's backend. > For that purpose there are LDC and GDC. Walter is free to do what he lik

[Issue 6829] Unsigned rotate standard function in Phobos

2013-08-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 Temtaime changed: What|Removed |Added CC||temta...@gmail.com --- Comment #42 from Tem

[Issue 6829] Unsigned rotate standard function in Phobos

2013-08-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #41 from hst...@quickfur.ath.cx 2013-08-13 09:42:34 PDT --- Related: issue #1116. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #40 from bearophile_h...@eml.cc 2013-07-28 10:19:00 PDT --- (In reply to comment #13) > (Perhaps here there's material for a small enhancement request for LLVM.) Here it is, in the LLVM Bugzilla: http://llvm.org/bugs/show_bug.cgi?i

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #39 from Iain Buclaw 2013-07-14 10:28:05 PDT --- (In reply to comment #38) > (In reply to comment #37) > > > gdc 4.9.0 20130707 - produces rol/ror instructions. > > gdc 4.9.0 20130616 - produces rol/ror instructions. > > gdc 4.9.0

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #38 from bearophile_h...@eml.cc 2013-07-14 09:10:08 PDT --- (In reply to comment #37) > gdc 4.9.0 20130707 - produces rol/ror instructions. > gdc 4.9.0 20130616 - produces rol/ror instructions. > gdc 4.9.0 20130505 - produces shl/sh

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #37 from Iain Buclaw 2013-07-14 08:38:50 PDT --- (In reply to comment #36) > (In reply to comment #35) > > Interestingly, translating the code into C and compiling with gcc 4.8.1 does > > produce the rotate instructions. But compil

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #36 from Iain Buclaw 2013-07-14 08:10:23 PDT --- (In reply to comment #35) > Interestingly, translating the code into C and compiling with gcc 4.8.1 does > produce the rotate instructions. But compiling the D version with gdc 4.8 >

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #35 from hst...@quickfur.ath.cx 2013-07-14 07:45:05 PDT --- Interestingly, translating the code into C and compiling with gcc 4.8.1 does produce the rotate instructions. But compiling the D version with gdc 4.8 doesn't. I've no idea

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #34 from Iain Buclaw 2013-07-14 02:47:24 PDT --- (In reply to comment #33) > Interesting. Running dmd -m32 -O works, produces the rotate instructions. > > For some reason, I still can't coax gdc to do this. I've tried all > combi

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #33 from hst...@quickfur.ath.cx 2013-07-13 14:27:53 PDT --- Interesting. Running dmd -m32 -O works, produces the rotate instructions. For some reason, I still can't coax gdc to do this. I've tried all combinations of -O, -O2, -O3 an

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #32 from Walter Bright 2013-07-13 12:54:15 PDT --- (In reply to comment #31) > I don't understand what I'm doing wrong. Is this a platform-specific issue? > I'm > running Linux/x86_64. It works with 32 bit code generation, not wi

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #31 from hst...@quickfur.ath.cx 2013-07-13 10:25:27 PDT --- I still can't get it to work. I copied Walter's code exactly, compiled with dmd -O (from DMD git HEAD) and here's the disassembly: 00416854 <_D4test4testFiZv>: 41

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #30 from bearophile_h...@eml.cc 2013-07-13 02:37:33 PDT --- (In reply to comment #28) > Ack, the example is bad. This one generates rol/ror: For normal D programmers it's easy to write D "rotation" code that the D compiler doesn't

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #29 from Walter Bright 2013-07-13 00:35:45 PDT --- Fix test case: https://github.com/D-Programming-Language/dmd/pull/2341 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving th

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 Walter Bright changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #27 from hst...@quickfur.ath.cx 2013-07-12 08:40:43 PDT --- Huh? So which gdc have you been using to test this earlier? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this ma

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #26 from Iain Buclaw 2013-07-12 08:21:21 PDT --- Don't currently have a gdc 4.8 compiler at hand to test... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #25 from hst...@quickfur.ath.cx 2013-07-12 08:13:16 PDT --- Nope, it's still not working. I copied-n-pasted exactly the code posted above, and compiled with gdc -frelease -O3 test.d, and here is the disassembly output: 00404

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #24 from bearophile_h...@eml.cc 2013-07-12 01:59:52 PDT --- (In reply to comment #23) > and 5. Make sure that you use bearophiles last implementation example. ;) Updated code, lacks unittests: import std.traits: isIntegral, isUnsi

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #22 from Iain Buclaw 2013-07-12 01:00:57 PDT --- (In reply to comment #21) > 1. Not my problem. :) > 2. When comparing gdc and dmd, make sure your actually looking at object files > generated by gdc, and not dmd. :) > 3. That's hig

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #23 from Iain Buclaw 2013-07-12 01:02:52 PDT --- (In reply to comment #22) > (In reply to comment #21) > > 1. Not my problem. :) > > 2. When comparing gdc and dmd, make sure your actually looking at object > > files > > generated

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #21 from Iain Buclaw 2013-07-12 00:58:49 PDT --- 1. Not my problem. :) 2. When comparing gdc and dmd, make sure your actually looking at object files generated by gdc, and not dmd. :) 3. That's highly unlikely as I've tested on x86

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #20 from hst...@quickfur.ath.cx 2013-07-11 21:46:05 PDT --- Could it be because amd64 doesn't support this optimization? Seems odd, though. I'd expect it to work at least up to 16-bit argument form, since that's common to both x86 an

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #19 from hst...@quickfur.ath.cx 2013-07-11 21:40:34 PDT --- I can't get GDC git HEAD to recognize this pattern either. What am I doing wrong?? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- Yo

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #18 from hst...@quickfur.ath.cx 2013-07-11 21:37:37 PDT --- Hmph. I'm using bearophile's code with DMD git HEAD, running as dmd -O, and *none* of the cases produce a rotate instruction. :-( Could it be an issue with 32bit vs. 64-bit

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #17 from bearophile_h...@eml.cc 2013-07-10 09:29:51 PDT --- (In reply to comment #15) > But to give you a comparison. > > // LDC > > __D5temp210__T3rolThZ3rolFNaNbNfxhxkZh: > pushl %esi > movzbl 8(%esp), %edx > movb

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #16 from Iain Buclaw 2013-07-10 06:59:38 PDT --- (In reply to comment #13) > (In reply to comment #11) > > > It has no problem detecting all those cases. :o) > > Perhaps you want to show the asm generated by gdc for those functi

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #15 from Iain Buclaw 2013-07-10 06:55:08 PDT --- (In reply to comment #13) > (In reply to comment #11) > > > It has no problem detecting all those cases. :o) > > Perhaps you want to show the asm generated by gdc for those functi

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #14 from Iain Buclaw 2013-07-10 06:53:27 PDT --- (In reply to comment #12) > (In reply to comment #11) > > > gdc > (ldc && dmd); > > > > It has no problem detecting all those cases. :o) > > But is that asm generated by gdc actu

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #12 from bearophile_h...@eml.cc 2013-07-10 06:45:05 PDT --- A bit better, with a pre-condition to catch some bugs: T rol(T)(in T x, in uint n) @safe pure nothrow if (isIntegral!T && isUnsigned!T) in { assert(n < (T.sizeof * 8))

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #13 from bearophile_h...@eml.cc 2013-07-10 06:46:44 PDT --- (In reply to comment #11) > It has no problem detecting all those cases. :o) Perhaps you want to show the asm generated by gdc for those functions? (Perhaps here there's

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #11 from Iain Buclaw 2013-07-10 04:57:05 PDT --- (In reply to comment #10) > (In reply to comment #9) > > > Excellent, so could put these as templates then. :) > > I have improved your code a little. Follows the 32 bit asm for ld

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #10 from bearophile_h...@eml.cc 2013-07-10 04:15:16 PDT --- (In reply to comment #9) > Excellent, so could put these as templates then. :) I have improved your code a little. Follows the 32 bit asm for ldc2 and dmd: import std.tr

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #9 from Iain Buclaw 2013-07-10 03:49:49 PDT --- (In reply to comment #8) > (In reply to comment #6) > > (In reply to comment #5) > > > I think this should be a recognizable rotate left function: > > > > > > private static uint

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #8 from bearophile_h...@eml.cc 2013-07-10 03:28:19 PDT --- (In reply to comment #6) > (In reply to comment #5) > > I think this should be a recognizable rotate left function: > > > > private static uint rol(in uint x, in uint y)

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #7 from Iain Buclaw 2013-07-10 02:50:07 PDT --- (In reply to comment #5) > I think this should be a recognizable rotate left function: > > private static uint rol(in uint x, in uint y) pure nothrow { > return (x << y) |

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 Iain Buclaw changed: What|Removed |Added CC||ibuc...@ubuntu.com --- Comment #6 from I

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #5 from bearophile_h...@eml.cc 2013-07-10 02:11:50 PDT --- I think this should be a recognizable rotate left function: private static uint rol(in uint x, in uint y) pure nothrow { return (x << y) | (x >> (32 - y)); }

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #4 from hst...@quickfur.ath.cx 2013-07-09 12:20:16 PDT --- In fact, not even gdc -O3 recognizes this pattern. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #3 from hst...@quickfur.ath.cx 2013-07-09 12:06:57 PDT --- Hmph. That doesn't work. Compiling without -O just makes DMD translate it literally into shl/shr followed by or. Compiling with -O computes the values via CTFE, so I changed

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #2 from bearophile_h...@eml.cc 2013-07-09 10:13:38 PDT --- (In reply to comment #1) > What's the pattern that DMD recognizes for rotate instructions? Walter offers this example of recognizable rotation: void test236() { uint

[Issue 6829] Unsigned rotate standard function in Phobos

2013-07-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6829 --- Comment #1 from hst...@quickfur.ath.cx 2013-07-09 09:05:22 PDT --- The implementation should probably go into std.bitmanip or core.bitop. What's the pattern that DMD recognizes for rotate instructions? -- Configure issuemail: http://d.pur