Last active
October 13, 2017 11:18
-
-
Save tomtor/a66edfeebaa8bad430bca515ea26f63e to your computer and use it in GitHub Desktop.
Esp32 ULP macro function
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
/* r0 = r0 xor r2, spills r1 */ | |
.macro xor | |
/* | |
See https://stackoverflow.com/a/5377173 | |
int bitwise_XOR(int a, int b) | |
{ | |
return (a + b) - (a & b) - (a & b); | |
} | |
*/ | |
and r1,r0,r2 | |
add r0,r0,r2 | |
sub r0,r0,r1 | |
sub r0,r0,r1 | |
.endm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment