Created
February 21, 2017 21:11
-
-
Save Spl3en/5fc93405ded96a70fb607bc037ec351b to your computer and use it in GitHub Desktop.
rol / ror gcc
This file contains 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
inline int rol (int in, int x) { | |
int res; | |
__asm__ __volatile__("rol %%eax, %%cl" :"=a"(res) :"a"(in), "c"(x)); | |
return res; | |
} | |
inline int ror (int in, int x) { | |
int res; | |
__asm__ __volatile__("ror %%eax, %%cl" :"=a"(res) :"a"(in), "c"(x)); | |
return res; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment