Tixanou@lemmy.world to Programmer Humor@lemmy.ml · 9 months agocoding chesslemmy.worldimagemessage-square44fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imagecoding chesslemmy.worldTixanou@lemmy.world to Programmer Humor@lemmy.ml · 9 months agomessage-square44fedilink
minus-square Morphit @feddit.uklinkfedilinkarrow-up0·9 months agoGodbolt to the rescue! So gcc 13.2 certainly does produce the same code, though a lot of other versions and compilers do it slightly differently. Surprisingly, clang doesn’t optimise this and uses idiv for the modulo version.
Godbolt to the rescue! So gcc 13.2 certainly does produce the same code, though a lot of other versions and compilers do it slightly differently. Surprisingly, clang doesn’t optimise this and uses
idiv
for the modulo version.