Lines Matching +full:- +full:- +full:short
1 /* Copyright (C) 2003 Jean-Marc Valin */
4 @brief Fixed-point operations with debugging
11 - Redistributions of source code must retain the above copyright
14 - Redistributions in binary form must reproduce the above copyright
18 - Neither the name of the Xiph.org Foundation nor the names of its
47 #define VERIFY_SHORT(x) ((x)<=32767&&(x)>=-32768)
48 #define VERIFY_INT(x) ((x)<=2147483647LL&&(x)>=-2147483648LL)
50 static inline short NEG16(int x) in NEG16()
55 fprintf (stderr, "NEG16: input is not short: %d\n", (int)x); in NEG16()
57 res = -x; in NEG16()
59 fprintf (stderr, "NEG16: output is not short: %d\n", (int)res); in NEG16()
70 res = -x; in NEG32()
78 static inline short _EXTRACT16(int x, char *file, int line) in _EXTRACT16()
83 fprintf (stderr, "EXTRACT16: input is not short: %d in %s: line %d\n", x, file, line); in _EXTRACT16()
96 fprintf (stderr, "EXTEND32: input is not short: %d in %s: line %d\n", x, file, line); in _EXTEND32()
104 static inline short _SHR16(int a, int shift, char *file, int line) in _SHR16()
109 … fprintf (stderr, "SHR16: inputs are not short: %d >> %d in %s: line %d\n", a, shift, file, line); in _SHR16()
113 fprintf (stderr, "SHR16: output is not short: %d in %s: line %d\n", res, file, line); in _SHR16()
118 static inline short _SHL16(int a, int shift, char *file, int line) in _SHL16()
123 fprintf (stderr, "SHL16: inputs are not short: %d %d in %s: line %d\n", a, shift, file, line); in _SHL16()
127 fprintf (stderr, "SHL16: output is not short: %d in %s: line %d\n", res, file, line); in _SHL16()
165 #define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift)))
167 #define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
168 #define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
174 static inline short _ADD16(int a, int b, char *file, int line) in _ADD16()
179 fprintf (stderr, "ADD16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); in _ADD16()
184 … fprintf (stderr, "ADD16: output is not short: %d+%d=%d in %s: line %d\n", a,b,res, file, line); in _ADD16()
191 static inline short _SUB16(int a, int b, char *file, int line) in _SUB16()
196 fprintf (stderr, "SUB16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); in _SUB16()
198 res = a-b; in _SUB16()
200 fprintf (stderr, "SUB16: output is not short: %d in %s: line %d\n", res, file, line); in _SUB16()
229 res = a-b; in SUB32()
239 static inline short MULT16_16_16(int a, int b) in MULT16_16_16()
244 fprintf (stderr, "MULT16_16_16: inputs are not short: %d %d\n", a, b); in MULT16_16_16()
248 fprintf (stderr, "MULT16_16_16: output is not short: %d\n", res); in MULT16_16_16()
259 fprintf (stderr, "MULT16_16: inputs are not short: %d %d in %s: line %d\n", a, b, file, line); in _MULT16_16()
268 #define MAC16_16(c,a,b) (spx_mips--,ADD32((c),MULT16_16((a),(b))))
280 …fprintf (stderr, "MULT16_32_Q%d: inputs are not short+int: %d %d in %s: line %d\n", Q, (int)a, (in… in _MULT16_32_QX()
296 fprintf (stderr, "MULT16_32_P%d: inputs are not short+int: %d %d\n", Q, (int)a, (int)b); in MULT16_32_PX()
321 if (a<-b) in SATURATE()
322 a = -b; in SATURATE()
331 fprintf (stderr, "MULT16_16_Q11: inputs are not short: %d %d\n", a, b); in MULT16_16_Q11_32()
336 fprintf (stderr, "MULT16_16_Q11: output is not short: %d*%d=%d\n", (int)a, (int)b, (int)res); in MULT16_16_Q11_32()
340 static inline short MULT16_16_Q13(int a, int b) in MULT16_16_Q13()
345 fprintf (stderr, "MULT16_16_Q13: inputs are not short: %d %d\n", a, b); in MULT16_16_Q13()
350 fprintf (stderr, "MULT16_16_Q13: output is not short: %d*%d=%d\n", a, b, (int)res); in MULT16_16_Q13()
354 static inline short MULT16_16_Q14(int a, int b) in MULT16_16_Q14()
359 fprintf (stderr, "MULT16_16_Q14: inputs are not short: %d %d\n", a, b); in MULT16_16_Q14()
364 fprintf (stderr, "MULT16_16_Q14: output is not short: %d\n", (int)res); in MULT16_16_Q14()
368 static inline short MULT16_16_Q15(int a, int b) in MULT16_16_Q15()
373 fprintf (stderr, "MULT16_16_Q15: inputs are not short: %d %d\n", a, b); in MULT16_16_Q15()
379 fprintf (stderr, "MULT16_16_Q15: output is not short: %d\n", (int)res); in MULT16_16_Q15()
385 static inline short MULT16_16_P13(int a, int b) in MULT16_16_P13()
390 fprintf (stderr, "MULT16_16_P13: inputs are not short: %d %d\n", a, b); in MULT16_16_P13()
398 fprintf (stderr, "MULT16_16_P13: output is not short: %d*%d=%d\n", a, b, (int)res); in MULT16_16_P13()
402 static inline short MULT16_16_P14(int a, int b) in MULT16_16_P14()
407 fprintf (stderr, "MULT16_16_P14: inputs are not short: %d %d\n", a, b); in MULT16_16_P14()
415 fprintf (stderr, "MULT16_16_P14: output is not short: %d*%d=%d\n", a, b, (int)res); in MULT16_16_P14()
419 static inline short MULT16_16_P15(int a, int b) in MULT16_16_P15()
424 fprintf (stderr, "MULT16_16_P15: inputs are not short: %d %d\n", a, b); in MULT16_16_P15()
432 fprintf (stderr, "MULT16_16_P15: output is not short: %d*%d=%d\n", a, b, (int)res); in MULT16_16_P15()
449 …fprintf (stderr, "DIV32_16: inputs are not int/short: %d %d in %s: line %d\n", (int)a, (int)b, fil… in _DIV32_16()
454 …fprintf (stderr, "DIV32_16: output is not short: %d / %d = %d in %s: line %d\n", (int)a,(int)b,(in… in _DIV32_16()
457 if (res<-32768) in _DIV32_16()
458 res = -32768; in _DIV32_16()
476 …fprintf (stderr, "DIV32: inputs are not int/short: %d %d in %s: line %d\n", (int)a, (int)b, file, … in _DIV32()