Created
December 5, 2012 02:17
-
-
Save kmcallister/4211534 to your computer and use it in GitHub Desktop.
impressive clang optimization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int is_json_space(char c) { | |
| return c == ' ' || c == '\t' || c == '\n' || c == '\r'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| is_json_space: | |
| cmpb $32, %dil | |
| ja .LBB0_2 | |
| movzbl %dil, %ecx | |
| movl $1, %eax | |
| movabsq $4294977024, %rdx | |
| btq %rcx, %rdx | |
| jb .LBB0_3 | |
| .LBB0_2: | |
| xorl %eax, %eax | |
| .LBB0_3: | |
| ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment