|
|
@ -59,19 +59,16 @@ static inline av_const int MULH(int a, int b) |
|
|
|
|
|
|
|
|
|
|
|
static inline av_const int64_t MUL64(int a, int b) |
|
|
|
static inline av_const int64_t MUL64(int a, int b) |
|
|
|
{ |
|
|
|
{ |
|
|
|
union { uint64_t x; unsigned hl[2]; } x; |
|
|
|
int64_t x; |
|
|
|
__asm__ ("smull %0, %1, %2, %3" |
|
|
|
__asm__ ("smull %Q0, %R0, %1, %2" : "=r"(x) : "r"(a), "r"(b)); |
|
|
|
: "=r"(x.hl[0]), "=r"(x.hl[1]) : "r"(a), "r"(b)); |
|
|
|
return x; |
|
|
|
return x.x; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#define MUL64 MUL64 |
|
|
|
#define MUL64 MUL64 |
|
|
|
|
|
|
|
|
|
|
|
static inline av_const int64_t MAC64(int64_t d, int a, int b) |
|
|
|
static inline av_const int64_t MAC64(int64_t d, int a, int b) |
|
|
|
{ |
|
|
|
{ |
|
|
|
union { uint64_t x; unsigned hl[2]; } x = { d }; |
|
|
|
__asm__ ("smlal %Q0, %R0, %1, %2" : "+r"(d) : "r"(a), "r"(b)); |
|
|
|
__asm__ ("smlal %0, %1, %2, %3" |
|
|
|
return d; |
|
|
|
: "+r"(x.hl[0]), "+r"(x.hl[1]) : "r"(a), "r"(b)); |
|
|
|
|
|
|
|
return x.x; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#define MAC64(d, a, b) ((d) = MAC64(d, a, b)) |
|
|
|
#define MAC64(d, a, b) ((d) = MAC64(d, a, b)) |
|
|
|
#define MLS64(d, a, b) MAC64(d, -(a), b) |
|
|
|
#define MLS64(d, a, b) MAC64(d, -(a), b) |
|
|
|