Created
September 20, 2017 11:47
Star
You must be signed in to star a gist
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
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