下面是几个linux环境的内嵌汇编,小弟没有这方面经验,请高手帮我翻译成ADS,realview环境下的相应内嵌汇编.先谢过高手们
# define mad_f_mul(x, y) ({ mad_fixed64hi_t __hi; mad_fixed64lo_t __lo; mad_fixed_t __result; asm ("smull %0, %1, %3, %4
" "movs %0, %0, lsr %5
" "adc %2, %0, %1, lsl %6" : "=&r" (__lo), "=&r" (__hi), "=r" (__result) : "%r" (x), "r" (y), "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) : "cc"); __result; })
#define MAD_F_MLX(hi, lo, x, y) asm ("smull %0, %1, %2, %3" : "=&r" (lo), "=&r" (hi) : "%r" (x), "r" (y))
#define MAD_F_MLA(hi, lo, x, y) asm ("smlal %0, %1, %2, %3" : "+r" (lo), "+r" (hi) : "%r" (x), "r" (y))
#define MAD_F_MLN(hi, lo) asm ("rsbs %0, %2, #0
" "rsc %1, %3, #0" : "=r" (lo), "=r" (hi) : "0" (lo), "1" (hi) : "cc")
#define mad_f_scale64(hi, lo) ({ mad_fixed_t __result; asm ("movs %0, %1, lsr %3
" "adc %0, %0, %2, lsl %4" : "=&r" (__result) : "r" (lo), "r" (hi), "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) : "cc"); __result; }) |