⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iqmathcpp.h

📁 TMS320X281xDSP应用系统设计-光盘应用程序
💻 H
📖 第 1 页 / 共 5 页
字号:
inline	iq24	IQ24rmpy(iq24 x, iq24 y)
{
   iq24 temp;
   temp.val = _IQ24rmpy(x.val, y.val);
   return temp;
}

inline	iq23	IQ23rmpy(iq23 x, iq23 y)
{
   iq23 temp;
   temp.val = _IQ23rmpy(x.val, y.val);
   return temp;
}

inline	iq22	IQ22rmpy(iq22 x, iq22 y)
{
   iq22 temp;
   temp.val = _IQ22rmpy(x.val, y.val);
   return temp;
}

inline	iq21	IQ21rmpy(iq21 x, iq21 y)
{
   iq21 temp;
   temp.val = _IQ21rmpy(x.val, y.val);
   return temp;
}

inline	iq20	IQ20rmpy(iq20 x, iq20 y)
{
   iq20 temp;
   temp.val = _IQ20rmpy(x.val, y.val);
   return temp;
}

inline	iq19	IQ19rmpy(iq19 x, iq19 y)
{
   iq19 temp;
   temp.val = _IQ19rmpy(x.val, y.val);
   return temp;
}

inline	iq18	IQ18rmpy(iq18 x, iq18 y)
{
   iq18 temp;
   temp.val = _IQ18rmpy(x.val, y.val);
   return temp;
}

inline	iq17	IQ17rmpy(iq17 x, iq17 y)
{
   iq17 temp;
   temp.val = _IQ17rmpy(x.val, y.val);
   return temp;
}

inline	iq16	IQ16rmpy(iq16 x, iq16 y)
{
   iq16 temp;
   temp.val = _IQ16rmpy(x.val, y.val);
   return temp;
}

inline	iq15	IQ15rmpy(iq15 x, iq15 y)
{
   iq15 temp;
   temp.val = _IQ15rmpy(x.val, y.val);
   return temp;
}

//---------------------------------------------------------------------------
// Functions: IQrsmpy(A,B), IQNrsmpy(A,B)
//---------------------------------------------------------------------------

inline	iq	IQrsmpy(iq x, iq y)
{
   iq temp;
   temp.val = _IQrsmpy(x.val, y.val);
   return temp;
}

inline	iq30	IQ30rsmpy(iq30 x, iq30 y)
{
   iq30 temp;
   temp.val = _IQ30rsmpy(x.val, y.val);
   return temp;
}

inline	iq29	IQ29rsmpy(iq29 x, iq29 y)
{
   iq29 temp;
   temp.val = _IQ29rsmpy(x.val, y.val);
   return temp;
}

inline	iq28	IQ28rsmpy(iq28 x, iq28 y)
{
   iq28 temp;
   temp.val = _IQ28rsmpy(x.val, y.val);
   return temp;
}

inline	iq27	IQ27rsmpy(iq27 x, iq27 y)
{
   iq27 temp;
   temp.val = _IQ27rsmpy(x.val, y.val);
   return temp;
}

inline	iq26	IQ26rsmpy(iq26 x, iq26 y)
{
   iq26 temp;
   temp.val = _IQ26rsmpy(x.val, y.val);
   return temp;
}

inline	iq25	IQ25rsmpy(iq25 x, iq25 y)
{
   iq25 temp;
   temp.val = _IQ25rsmpy(x.val, y.val);
   return temp;
}

inline	iq24	IQ24rsmpy(iq24 x, iq24 y)
{
   iq24 temp;
   temp.val = _IQ24rsmpy(x.val, y.val);
   return temp;
}

inline	iq23	IQ23rsmpy(iq23 x, iq23 y)
{
   iq23 temp;
   temp.val = _IQ23rsmpy(x.val, y.val);
   return temp;
}

inline	iq22	IQ22rsmpy(iq22 x, iq22 y)
{
   iq22 temp;
   temp.val = _IQ22rsmpy(x.val, y.val);
   return temp;
}

inline	iq21	IQ21rsmpy(iq21 x, iq21 y)
{
   iq21 temp;
   temp.val = _IQ21rsmpy(x.val, y.val);
   return temp;
}

inline	iq20	IQ20rsmpy(iq20 x, iq20 y)
{
   iq20 temp;
   temp.val = _IQ20rsmpy(x.val, y.val);
   return temp;
}

inline	iq19	IQ19rsmpy(iq19 x, iq19 y)
{
   iq19 temp;
   temp.val = _IQ19rsmpy(x.val, y.val);
   return temp;
}

inline	iq18	IQ18rsmpy(iq18 x, iq18 y)
{
   iq18 temp;
   temp.val = _IQ18rsmpy(x.val, y.val);
   return temp;
}

inline	iq17	IQ17rsmpy(iq17 x, iq17 y)
{
   iq17 temp;
   temp.val = _IQ17rsmpy(x.val, y.val);
   return temp;
}

inline	iq16	IQ16rsmpy(iq16 x, iq16 y)
{
   iq16 temp;
   temp.val = _IQ16rsmpy(x.val, y.val);
   return temp;
}

inline	iq15	IQ15rsmpy(iq15 x, iq15 y)
{
   iq15 temp;
   temp.val = _IQ15rsmpy(x.val, y.val);
   return temp;
}

//---------------------------------------------------------------------------
// Functions: IQmpyIQX(A,IQA,B,IQB), IQNmpyIQX(A,IQA,B,IQB)
//---------------------------------------------------------------------------

#define  IQmpyIQX(A, IQA, B, IQB)   ((iq)   __IQxmpy(A.val, B.val, (GLOBAL_Q + 32 - IQA - IQB)))
#define  IQ30mpyIQX(A, IQA, B, IQB) ((iq30) __IQxmpy(A.val, B.val, (30 + 32 - IQA - IQB)))
#define  IQ29mpyIQX(A, IQA, B, IQB) ((iq29) __IQxmpy(A.val, B.val, (29 + 32 - IQA - IQB)))
#define  IQ28mpyIQX(A, IQA, B, IQB) ((iq28) __IQxmpy(A.val, B.val, (28 + 32 - IQA - IQB)))
#define  IQ27mpyIQX(A, IQA, B, IQB) ((iq27) __IQxmpy(A.val, B.val, (27 + 32 - IQA - IQB)))
#define  IQ26mpyIQX(A, IQA, B, IQB) ((iq26) __IQxmpy(A.val, B.val, (26 + 32 - IQA - IQB)))
#define  IQ25mpyIQX(A, IQA, B, IQB) ((iq25) __IQxmpy(A.val, B.val, (25 + 32 - IQA - IQB)))
#define  IQ24mpyIQX(A, IQA, B, IQB) ((iq24) __IQxmpy(A.val, B.val, (24 + 32 - IQA - IQB)))
#define  IQ23mpyIQX(A, IQA, B, IQB) ((iq23) __IQxmpy(A.val, B.val, (23 + 32 - IQA - IQB)))
#define  IQ22mpyIQX(A, IQA, B, IQB) ((iq22) __IQxmpy(A.val, B.val, (22 + 32 - IQA - IQB)))
#define  IQ21mpyIQX(A, IQA, B, IQB) ((iq21) __IQxmpy(A.val, B.val, (21 + 32 - IQA - IQB)))
#define  IQ20mpyIQX(A, IQA, B, IQB) ((iq20) __IQxmpy(A.val, B.val, (20 + 32 - IQA - IQB)))
#define  IQ19mpyIQX(A, IQA, B, IQB) ((iq19) __IQxmpy(A.val, B.val, (19 + 32 - IQA - IQB)))
#define  IQ18mpyIQX(A, IQA, B, IQB) ((iq18) __IQxmpy(A.val, B.val, (18 + 32 - IQA - IQB)))
#define  IQ17mpyIQX(A, IQA, B, IQB) ((iq17) __IQxmpy(A.val, B.val, (17 + 32 - IQA - IQB)))
#define  IQ16mpyIQX(A, IQA, B, IQB) ((iq16) __IQxmpy(A.val, B.val, (16 + 32 - IQA - IQB)))
#define  IQ15mpyIQX(A, IQA, B, IQB) ((iq15) __IQxmpy(A.val, B.val, (15 + 32 - IQA - IQB)))

//---------------------------------------------------------------------------
// Functions: IQmpyI32(A,B), IQNmpyI32(A,B)
//---------------------------------------------------------------------------

inline	iq	IQmpyI32(iq y, long x)
{
   iq temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq 	IQmpyI32(long y, iq x)
{
   iq temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq30	IQ30mpyI32(iq30 y, long x)
{
   iq30 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq30 	IQ30mpyI32(long y, iq30 x)
{
   iq30 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq29	IQ29mpyI32(iq29 y, long x)
{
   iq29 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq29 	IQ29mpyI32(long y, iq29 x)
{
   iq29 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq28	IQ28mpyI32(iq28 y, long x)
{
   iq28 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq28 	IQ28mpyI32(long y, iq28 x)
{
   iq28 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq27	IQ27mpyI32(iq27 y, long x)
{
   iq27 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq27 	IQ27mpyI32(long y, iq27 x)
{
   iq27 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq26	IQ26mpyI32(iq26 y, long x)
{
   iq26 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq26 	IQ26mpyI32(long y, iq26 x)
{
   iq26 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq25	IQ25mpyI32(iq25 y, long x)
{
   iq25 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq25 	IQ25mpyI32(long y, iq25 x)
{
   iq25 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq24	IQ24mpyI32(iq24 y, long x)
{
   iq24 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq24 	IQ24mpyI32(long y, iq24 x)
{
   iq24 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq23	IQ23mpyI32(iq23 y, long x)
{
   iq23 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq23 	IQ23mpyI32(long y, iq23 x)
{
   iq23 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq22	IQ22mpyI32(iq22 y, long x)
{
   iq22 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq22 	IQ22mpyI32(long y, iq22 x)
{
   iq22 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq21	IQ21mpyI32(iq21 y, long x)
{
   iq21 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq21 	IQ21mpyI32(long y, iq21 x)
{
   iq21 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq20	IQ20mpyI32(iq20 y, long x)
{
   iq20 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq20 	IQ20mpyI32(long y, iq20 x)
{
   iq20 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq19	IQ19mpyI32(iq19 y, long x)
{
   iq19 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq19 	IQ19mpyI32(long y, iq19 x)
{
   iq19 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq18	IQ18mpyI32(iq18 y, long x)
{
   iq18 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq18 	IQ18mpyI32(long y, iq18 x)
{
   iq18 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq17	IQ17mpyI32(iq17 y, long x)
{
   iq17 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq17 	IQ17mpyI32(long y, iq17 x)
{
   iq17 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq16	IQ16mpyI32(iq16 y, long x)
{
   iq16 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq16 	IQ16mpyI32(long y, iq16 x)
{
   iq16 temp;
   temp.val = (y * x.val);
   return temp;
}

inline	iq15	IQ15mpyI32(iq15 y, long x)
{
   iq15 temp;
   temp.val = (y.val * x);
   return temp;
}

inline	iq15 	IQ15mpyI32(long y, iq15 x)
{
   iq15 temp;
   temp.val = (y * x.val);
   return temp;
}

//---------------------------------------------------------------------------
// Functions: IQmpyI32int(A,B), IQNmpyI32int(A,B)
//---------------------------------------------------------------------------

inline	long	IQmpyI32int(iq y, long x) { return _IQmpyI32int(y.val, x); }
inline	long	IQmpyI32int(long y, iq x) { return _IQmpyI32int(y, x.val); }
inline	long	IQ30mpyI32int(iq30 y, long x) { return _IQ30mpyI32int(y.val, x); }
inline	long	IQ30mpyI32int(long y, iq30 x) { return _IQ30mpyI32int(y, x.val); }
inline	long	IQ29mpyI32int(iq29 y, long x) { return _IQ29mpyI32int(y.val, x); }
inline	long	IQ29mpyI32int(long y, iq29 x) { return _IQ29mpyI32int(y, x.val); }
inline	long	IQ28mpyI32int(iq28 y, long x) { return _IQ28mpyI32int(y.val, x); }
inline	long	IQ28mpyI32int(long y, iq28 x) { return _IQ28mpyI32int(y, x.val); }
inline	long	IQ27mpyI32int(iq27 y, long x) { return _IQ27mpyI32int(y.val, x); }
inline	long	IQ27mpyI32int(long y, iq27 x) { return _IQ27mpyI32int(y, x.val); }
inline	long	IQ26mpyI32int(iq26 y, long x) { return _IQ26mpyI32int(y.val, x); }
inline	long	IQ26mpyI32int(long y, iq26 x) { return _IQ26mpyI32int(y, x.val); }
inline	long	IQ25mpyI32int(iq25 y, long x) { return _IQ25mpyI32int(y.val, x); }
inline	long	IQ25mpyI32int(long y, iq25 x) { return _IQ25mpyI32int(y, x.val); }
inline	long	IQ24mpyI32int(iq24 y, long x) { return _IQ24mpyI32int(y.val, x); }
inline	long	IQ24mpyI32int(long y, iq24 x) { return _IQ24mpyI32int(y, x.val); }
inline	long	IQ23mpyI32int(iq23 y, long x) { return _IQ23mpyI32int(y.val, x); }
inline	long	IQ23mpyI32int(long y, iq23 x) { return _IQ23mpyI32int(y, x.val); }
inline	long	IQ22mpyI32int(iq22 y, long x) { return _IQ22mpyI32int(y.val, x); }
inline	long	IQ22mpyI32int(long y, iq22 x) { return _IQ22mpyI32int(y, x.val); }
inline	long	IQ21mpyI32int(iq21 y, long x) { return _IQ21mpyI32int(y.val, x); }
inline	long	IQ21mpyI32int(long y, iq21 x) { return _IQ21mpyI32int(y, x.val); }
inline	long	IQ20mpyI32int(iq20 y, long x) { return _IQ20mpyI32int(y.val, x); }
inline	long	IQ20mpyI32int(long y, iq20 x) { return _IQ20mpyI32int(y, x.val); }
inline	long	IQ19mpyI32int(iq19 y, long x) { return _IQ19mpyI32int(y.val, x); }
inline	long	IQ19mpyI32int(long y, iq19 x) { return _IQ19mpyI32int(y, x.val); }
inline	long	IQ18mpyI32int(iq18 y, long x) { return _IQ18mpyI32int(y.val, x); }
inline	long	IQ18mpyI32int(long y, iq18 x) { return _IQ18mpyI32int(y, x.val); }
inline	long	IQ17mpyI32int(iq17 y, long x) { return _IQ17mpyI32int(y.val, x); }
inline	long	IQ17mpyI32int(long y, iq17 x) { return _IQ17mpyI32int(y, x.val); }
inline	long	IQ16mpyI32int(iq16 y, long x) { return _IQ16mpyI32int(y.val, x); }
inline	long	IQ16mpyI32int(long y, iq16 x) { return _IQ16mpyI32int(y, x.val); }
inline	long	IQ15mpyI32int(iq15 y, long x) { return _IQ15mpyI32int(y.val, x); }
inline	long	IQ15mpyI32int(long y, iq15 x) { return _IQ15mpyI32int(y, x.val); }

//---------------------------------------------------------------------------
// Functions: IQmpyI32frac(A,B), IQNmpyI32frac(A,B)
//---------------------------------------------------------------------------

inline	iq	IQmpyI32frac(iq y, long x)
{
   iq temp;
   temp.val = _IQmpyI32frac(y.val, x);
   return temp;
}

inline	iq 	IQmpyI32frac(long y, iq x)
{
   iq temp;
   temp.val = _IQmpyI32frac(y, x.val);
   return temp;
}

inline	iq30	IQ30mpyI32frac(iq30 y, long x)
{
   iq30 temp;
   temp.val = _IQ30mpyI32frac(y.val, x);
   return temp;
}

inline	iq30 	IQ30mpyI32frac(long y, iq30 x)
{
   iq30 temp;
   temp.val = _IQ30mpyI32frac(y, x.val);
   return temp;
}

inline	iq29	IQ29mpyI32frac(iq29 y, long x)
{
   iq29 temp;
   temp.val = _IQ29mpyI32frac(y.val, x);
   return temp;
}

inline	iq29 	IQ29mpyI32frac(long y, iq29 x)
{
   iq29 temp;
   temp.val = _IQ29mpyI32frac(y, x.val);
   return temp;
}

inline	iq28	IQ28mpyI32frac(iq28 y, long x)
{
   iq28 temp;
   temp.val = _IQ28mpyI32frac(y.val, x);
   return temp;
}

inline	iq28 	IQ28mpyI32frac(long y, iq28 x)
{
   iq28 temp;
   temp.val = _IQ28mpyI32frac(y, x.val);
   return temp;
}

inline	iq27	IQ27mpyI32frac(iq27 y, long x)
{
   iq27 temp;
   temp.val = _IQ27mpyI32frac(y.val, x);
   return temp;
}

inline	iq27 	IQ27mpyI32frac(long y, iq27 x)
{
   iq27 temp;
   temp.val = _IQ27mpyI32frac(y, x.val);
   return temp;
}

inline	iq26	IQ26mpyI32frac(iq26 y, long x)
{
   iq26 temp;
   temp.val = _IQ26mpyI32frac(y.val, x);
   return temp;
}

inline	iq26 	IQ26mpyI32frac(long y, iq26 x)
{
   iq26 temp;
   temp.val = _IQ26mpyI32frac(y, x.val);
   return temp;
}

inline	iq25	IQ25mpyI32frac(iq25 y, long x)
{
   iq25 temp;
   temp.val = _IQ25mpyI32frac(y.val, x);
   return temp;
}

inline	iq25 	IQ25mpyI32frac(long y, iq25 x)
{
   iq25 temp;
   temp.val = _IQ25mpyI32frac(y, x.val);
   return temp;
}

inline	iq24	IQ24mpyI32frac(iq24 y, long x)
{
   iq24 temp;
   temp.val = _IQ24mpyI32frac(y.val, x);
   return temp;
}

inline	iq24 	IQ24mpyI32frac(long y, iq24 x)
{
   iq24 temp;
   temp.val = _IQ24mpyI32frac(y, x.val);
   return temp;
}

inline	iq23	IQ23mpyI32frac(iq23 y, long x)
{
   iq23 temp;
   temp.val = _IQ23mpyI32frac(y.val, x);
   return temp;
}

inline	iq23 	IQ23mpyI32frac(long y, iq23 x)
{
   iq23 temp;
   temp.val = _IQ23mpyI32frac(y, x.val);
   return temp;
}

inline	iq22	IQ22mpyI32frac(iq22 y, long x)
{
   iq22 temp;
   temp.val = _IQ22mpyI32frac(y.val, x);
   return temp;
}

inline	iq22 	IQ22mpyI32frac(long y, iq22 x)
{
   iq22 temp;
   temp.val = _IQ22mpyI32frac(y, x.val);
   return temp;
}

inline	iq21	IQ21mpyI32frac(iq21 y, long x)
{
   iq21 temp;
   temp.val = _IQ21mpyI32frac(y.val, x);
   return temp;
}

inline	iq21 	IQ21mpyI32frac(long y, iq21 x)
{
   iq21 temp;
   temp.val = _IQ21mpyI32frac(y, x.val);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -