Tixanou@lemmy.world to Programmer Humor@lemmy.ml · 1 year agocoding chesslemmy.worldimagemessage-square44fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imagecoding chesslemmy.worldTixanou@lemmy.world to Programmer Humor@lemmy.ml · 1 year agomessage-square44fedilink
minus-square Morphit @feddit.uklinkfedilinkarrow-up0·1 year 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.