Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gpderetta
4 months ago
|
parent
|
context
|
favorite
| on:
A leap year check in three instructions
You could argue that the setb and ret are not part of the leap year check itself. For example if the compiled inlined the call into a caller doing:
if(is_leap_year_fast()) {...}
Then the ret would obviously go away and the setb wouldn't be necessary as it could generate directly a conditional jmp from the result of the cmp.
npendleton
4 months ago
[–]
Hah, great point!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: