Better HN
topnewbestaskshowjobs
Log inSign up

chris_swenson

2 karma · joined Oct 4, 2012 (14y ago) · 2 submissions

Submissions

comment 9mo ago · link · parent

“mov rcx, 0”. At least one assembler (the Go assembler) would at one point blindly (and arguably, incorrectly) rewrite this to “xor rcx, rcx”, which is smaller but modifies flags, which “mov” does not. I believe Go fixed this later, possibly by looking at surrounding instructions to see if the flags were being used, for instance by an “adc” later, to know if the assembler needs to pick the larger “mov” encoding.

Whether that logic should belong in a compiler or an assembler is a separate issue, but it definitely was in the assembler there.

2.

Survey on code review tools

1 points · by chris_swenson · 12y ago · discuss