Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Timeline for Greatest Common Divisor

Current License: CC BY-SA 3.0

16 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited Community Bot
Commonmark migration
Dec 18, 2017 at 20:52 comment added Peter Cordes @l4m2: yeah, I know, but I'm just going to leave it alone. I'm going to let myself get away with it on a technicality, because it's just one byte either way, and I don't want to take the time to re-edit the answer. It wasn't the OP's edit that changed it; it was originally written as an ASM-encouraging question, but a mod changed it to be a normal code-golf question. I answered the original question, so I think it's fine to leave it.
Dec 18, 2017 at 20:47 comment added l4m2 The current question seem doesn't say to allow snippet
Dec 18, 2017 at 20:37 comment added Peter Cordes @l4m2: Yes, you can. But not with inline asm. Good point, I should update this answer to leave out the +1B for handling 0 on entry. Oh, but this is only a snippet, not a function, and in asm it's not free if the surrounding code can't just fall into / out of it. If I want it to be a function, I need to include a ret. (This was one of my first answers. I normally post functions now, but this question was originally written to allow a snippet, not a function.)
Dec 18, 2017 at 20:31 comment added l4m2 Can't you point to the middle as entry?
May 23, 2017 at 11:33 history edited Community Bot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Aug 13, 2016 at 14:43 comment added Peter Cordes @CodyGray: inc/loop is 3 bytes in the 32-bit version, but 4B in the 64-bit version. That means that in the 64-bit version only, it doesn't cost extra bytes to use jrcxz and jmp instead of inc / loop.
Aug 13, 2016 at 13:32 comment added Cody Gray Why couldn't you use jecxz in the 32-bit version to the same effect?
Apr 9, 2016 at 23:22 history edited Peter Cordes CC BY-SA 3.0
handle b=0 nicely for amd64, and with a hand-wave for i386
Apr 8, 2016 at 22:54 comment added Peter Cordes @MikeShlanta: I found a use for jrcxz after all in the uint64_t version :). Also, didn't notice that you'd specified unsigned, so I included byte counts for that, too.
Apr 8, 2016 at 22:53 history edited Peter Cordes CC BY-SA 3.0
Unsigned. And find a use for jrcxz in the 64b version to save a byte.
Apr 8, 2016 at 3:23 history edited Peter Cordes CC BY-SA 3.0
added 404 characters in body
Apr 8, 2016 at 3:19 comment added Peter Cordes @MikeShlanta: Thanks. If you like optimizing asm, have a look at some of my answers over on stackoverflow. :)
Apr 8, 2016 at 2:24 history edited Peter Cordes CC BY-SA 3.0
standard header formatting
Apr 8, 2016 at 2:13 history edited Peter Cordes CC BY-SA 3.0
standard header formatting
Apr 8, 2016 at 2:00 history answered Peter Cordes CC BY-SA 3.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /