浏览代码

Fix missing DSP instruction alternates on Teensy LC

dds
PaulStoffregen 4 年前
父节点
当前提交
f6b809e572
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. +4
    -4
      utility/dspinst.h

+ 4
- 4
utility/dspinst.h 查看文件

@@ -100,7 +100,7 @@ static inline int32_t multiply_32x32_rshift32(int32_t a, int32_t b)
asm volatile("smmul %0, %1, %2" : "=r" (out) : "r" (a), "r" (b));
return out;
#elif defined(KINETISL)
return 0; // TODO....
return ((int64_t)a * (int64_t)b) >> 32;
#endif
}

@@ -113,7 +113,7 @@ static inline int32_t multiply_32x32_rshift32_rounded(int32_t a, int32_t b)
asm volatile("smmulr %0, %1, %2" : "=r" (out) : "r" (a), "r" (b));
return out;
#elif defined(KINETISL)
return 0; // TODO....
return (((int64_t)a * (int64_t)b) + 0x8000000) >> 32;
#endif
}

@@ -126,7 +126,7 @@ static inline int32_t multiply_accumulate_32x32_rshift32_rounded(int32_t sum, in
asm volatile("smmlar %0, %2, %3, %1" : "=r" (out) : "r" (sum), "r" (a), "r" (b));
return out;
#elif defined(KINETISL)
return 0; // TODO....
return sum + ((((int64_t)a * (int64_t)b) + 0x8000000) >> 32);
#endif
}

@@ -139,7 +139,7 @@ static inline int32_t multiply_subtract_32x32_rshift32_rounded(int32_t sum, int3
asm volatile("smmlsr %0, %2, %3, %1" : "=r" (out) : "r" (sum), "r" (a), "r" (b));
return out;
#elif defined(KINETISL)
return 0; // TODO....
return sum - ((((int64_t)a * (int64_t)b) + 0x8000000) >> 32);
#endif
}


正在加载...
取消
保存