Created
September 20, 2017 11:47
-
-
Save pamaury/0011c653a8d2dae5fd16116a8fb4d536 to your computer and use it in GitHub Desktop.
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
extern int rand(void); | |
typedef long int32_t; | |
typedef unsigned long uint32_t; | |
typedef int32_t mad_fixed64hi_t; | |
typedef uint32_t mad_fixed64lo_t; | |
typedef int32_t mad_fixed_t; | |
int main() | |
{ | |
int requantized = rand(); | |
int D = rand(); | |
int C = rand(); | |
int output = ({ | |
register mad_fixed64hi_t __hi; | |
register mad_fixed64lo_t __lo; | |
asm ("mult %2,%3" : "=l" (__lo), "=h" (__hi) : "%r" ((requantized + D)), "r" ((C))); | |
((mad_fixed_t) (((__hi) << (32 - 28)) | ((__lo) >> 28))); | |
}); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment