diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2009-03-11 20:32:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 17:54:27 -0400 |
commit | dc57a3ea80a85a74094b873a693c3e07b2cb5da4 (patch) | |
tree | d97d5169b0ec2d8d99678d6d06cee8bb563a5d2a /drivers | |
parent | 2961f24f78f456a0a2d0dada56ee795232fe21b3 (diff) |
Staging: echo cleanup
before:
errors lines of code errors/KLOC
drivers/staging/echo/ 213 1701 125.2
after:
errors lines of code errors/KLOC
drivers/staging/echo/ 8 1685 4.7
Compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/echo/bit_operations.h | 30 | ||||
-rw-r--r-- | drivers/staging/echo/echo.c | 42 | ||||
-rw-r--r-- | drivers/staging/echo/echo.h | 2 | ||||
-rw-r--r-- | drivers/staging/echo/fir.h | 28 | ||||
-rw-r--r-- | drivers/staging/echo/mmx.h | 408 |
5 files changed, 247 insertions, 263 deletions
diff --git a/drivers/staging/echo/bit_operations.h b/drivers/staging/echo/bit_operations.h index cecdcf3fd755..4c4ccbc97313 100644 --- a/drivers/staging/echo/bit_operations.h +++ b/drivers/staging/echo/bit_operations.h | |||
@@ -21,8 +21,6 @@ | |||
21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
22 | * along with this program; if not, write to the Free Software | 22 | * along with this program; if not, write to the Free Software |
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | * | ||
25 | * $Id: bit_operations.h,v 1.11 2006/11/28 15:37:03 steveu Exp $ | ||
26 | */ | 24 | */ |
27 | 25 | ||
28 | /*! \file */ | 26 | /*! \file */ |
@@ -34,7 +32,7 @@ | |||
34 | /*! \brief Find the bit position of the highest set bit in a word | 32 | /*! \brief Find the bit position of the highest set bit in a word |
35 | \param bits The word to be searched | 33 | \param bits The word to be searched |
36 | \return The bit number of the highest set bit, or -1 if the word is zero. */ | 34 | \return The bit number of the highest set bit, or -1 if the word is zero. */ |
37 | static __inline__ int top_bit(unsigned int bits) | 35 | static inline int top_bit(unsigned int bits) |
38 | { | 36 | { |
39 | int res; | 37 | int res; |
40 | 38 | ||
@@ -50,7 +48,7 @@ static __inline__ int top_bit(unsigned int bits) | |||
50 | /*! \brief Find the bit position of the lowest set bit in a word | 48 | /*! \brief Find the bit position of the lowest set bit in a word |
51 | \param bits The word to be searched | 49 | \param bits The word to be searched |
52 | \return The bit number of the lowest set bit, or -1 if the word is zero. */ | 50 | \return The bit number of the lowest set bit, or -1 if the word is zero. */ |
53 | static __inline__ int bottom_bit(unsigned int bits) | 51 | static inline int bottom_bit(unsigned int bits) |
54 | { | 52 | { |
55 | int res; | 53 | int res; |
56 | 54 | ||
@@ -63,7 +61,7 @@ static __inline__ int bottom_bit(unsigned int bits) | |||
63 | return res; | 61 | return res; |
64 | } | 62 | } |
65 | #else | 63 | #else |
66 | static __inline__ int top_bit(unsigned int bits) | 64 | static inline int top_bit(unsigned int bits) |
67 | { | 65 | { |
68 | int i; | 66 | int i; |
69 | 67 | ||
@@ -93,7 +91,7 @@ static __inline__ int top_bit(unsigned int bits) | |||
93 | return i; | 91 | return i; |
94 | } | 92 | } |
95 | 93 | ||
96 | static __inline__ int bottom_bit(unsigned int bits) | 94 | static inline int bottom_bit(unsigned int bits) |
97 | { | 95 | { |
98 | int i; | 96 | int i; |
99 | 97 | ||
@@ -127,7 +125,7 @@ static __inline__ int bottom_bit(unsigned int bits) | |||
127 | /*! \brief Bit reverse a byte. | 125 | /*! \brief Bit reverse a byte. |
128 | \param data The byte to be reversed. | 126 | \param data The byte to be reversed. |
129 | \return The bit reversed version of data. */ | 127 | \return The bit reversed version of data. */ |
130 | static __inline__ uint8_t bit_reverse8(uint8_t x) | 128 | static inline uint8_t bit_reverse8(uint8_t x) |
131 | { | 129 | { |
132 | #if defined(__i386__) || defined(__x86_64__) | 130 | #if defined(__i386__) || defined(__x86_64__) |
133 | /* If multiply is fast */ | 131 | /* If multiply is fast */ |
@@ -172,32 +170,32 @@ uint32_t make_mask32(uint32_t x); | |||
172 | uint16_t make_mask16(uint16_t x); | 170 | uint16_t make_mask16(uint16_t x); |
173 | 171 | ||
174 | /*! \brief Find the least significant one in a word, and return a word | 172 | /*! \brief Find the least significant one in a word, and return a word |
175 | with just that bit set. | 173 | with just that bit set. |
176 | \param x The word to be searched. | 174 | \param x The word to be searched. |
177 | \return The word with the single set bit. */ | 175 | \return The word with the single set bit. */ |
178 | static __inline__ uint32_t least_significant_one32(uint32_t x) | 176 | static inline uint32_t least_significant_one32(uint32_t x) |
179 | { | 177 | { |
180 | return (x & (-(int32_t) x)); | 178 | return x & (-(int32_t) x); |
181 | } | 179 | } |
182 | 180 | ||
183 | /*! \brief Find the most significant one in a word, and return a word | 181 | /*! \brief Find the most significant one in a word, and return a word |
184 | with just that bit set. | 182 | with just that bit set. |
185 | \param x The word to be searched. | 183 | \param x The word to be searched. |
186 | \return The word with the single set bit. */ | 184 | \return The word with the single set bit. */ |
187 | static __inline__ uint32_t most_significant_one32(uint32_t x) | 185 | static inline uint32_t most_significant_one32(uint32_t x) |
188 | { | 186 | { |
189 | #if defined(__i386__) || defined(__x86_64__) | 187 | #if defined(__i386__) || defined(__x86_64__) |
190 | return 1 << top_bit(x); | 188 | return 1 << top_bit(x); |
191 | #else | 189 | #else |
192 | x = make_mask32(x); | 190 | x = make_mask32(x); |
193 | return (x ^ (x >> 1)); | 191 | return x ^ (x >> 1); |
194 | #endif | 192 | #endif |
195 | } | 193 | } |
196 | 194 | ||
197 | /*! \brief Find the parity of a byte. | 195 | /*! \brief Find the parity of a byte. |
198 | \param x The byte to be checked. | 196 | \param x The byte to be checked. |
199 | \return 1 for odd, or 0 for even. */ | 197 | \return 1 for odd, or 0 for even. */ |
200 | static __inline__ int parity8(uint8_t x) | 198 | static inline int parity8(uint8_t x) |
201 | { | 199 | { |
202 | x = (x ^ (x >> 4)) & 0x0F; | 200 | x = (x ^ (x >> 4)) & 0x0F; |
203 | return (0x6996 >> x) & 1; | 201 | return (0x6996 >> x) & 1; |
@@ -206,7 +204,7 @@ static __inline__ int parity8(uint8_t x) | |||
206 | /*! \brief Find the parity of a 16 bit word. | 204 | /*! \brief Find the parity of a 16 bit word. |
207 | \param x The word to be checked. | 205 | \param x The word to be checked. |
208 | \return 1 for odd, or 0 for even. */ | 206 | \return 1 for odd, or 0 for even. */ |
209 | static __inline__ int parity16(uint16_t x) | 207 | static inline int parity16(uint16_t x) |
210 | { | 208 | { |
211 | x ^= (x >> 8); | 209 | x ^= (x >> 8); |
212 | x = (x ^ (x >> 4)) & 0x0F; | 210 | x = (x ^ (x >> 4)) & 0x0F; |
@@ -216,7 +214,7 @@ static __inline__ int parity16(uint16_t x) | |||
216 | /*! \brief Find the parity of a 32 bit word. | 214 | /*! \brief Find the parity of a 32 bit word. |
217 | \param x The word to be checked. | 215 | \param x The word to be checked. |
218 | \return 1 for odd, or 0 for even. */ | 216 | \return 1 for odd, or 0 for even. */ |
219 | static __inline__ int parity32(uint32_t x) | 217 | static inline int parity32(uint32_t x) |
220 | { | 218 | { |
221 | x ^= (x >> 16); | 219 | x ^= (x >> 16); |
222 | x ^= (x >> 8); | 220 | x ^= (x >> 8); |
diff --git a/drivers/staging/echo/echo.c b/drivers/staging/echo/echo.c index fd4007e329e7..6d7217e1bd06 100644 --- a/drivers/staging/echo/echo.c +++ b/drivers/staging/echo/echo.c | |||
@@ -27,8 +27,6 @@ | |||
27 | * You should have received a copy of the GNU General Public License | 27 | * You should have received a copy of the GNU General Public License |
28 | * along with this program; if not, write to the Free Software | 28 | * along with this program; if not, write to the Free Software |
29 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 29 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
30 | * | ||
31 | * $Id: echo.c,v 1.20 2006/12/01 18:00:48 steveu Exp $ | ||
32 | */ | 30 | */ |
33 | 31 | ||
34 | /*! \file */ | 32 | /*! \file */ |
@@ -113,17 +111,17 @@ | |||
113 | 111 | ||
114 | #define MIN_TX_POWER_FOR_ADAPTION 64 | 112 | #define MIN_TX_POWER_FOR_ADAPTION 64 |
115 | #define MIN_RX_POWER_FOR_ADAPTION 64 | 113 | #define MIN_RX_POWER_FOR_ADAPTION 64 |
116 | #define DTD_HANGOVER 600 /* 600 samples, or 75ms */ | 114 | #define DTD_HANGOVER 600 /* 600 samples, or 75ms */ |
117 | #define DC_LOG2BETA 3 /* log2() of DC filter Beta */ | 115 | #define DC_LOG2BETA 3 /* log2() of DC filter Beta */ |
118 | 116 | ||
119 | /*-----------------------------------------------------------------------*\ | 117 | /*-----------------------------------------------------------------------*\ |
120 | FUNCTIONS | 118 | FUNCTIONS |
121 | \*-----------------------------------------------------------------------*/ | 119 | \*-----------------------------------------------------------------------*/ |
122 | 120 | ||
123 | /* adapting coeffs using the traditional stochastic descent (N)LMS algorithm */ | 121 | /* adapting coeffs using the traditional stochastic descent (N)LMS algorithm */ |
124 | 122 | ||
125 | #ifdef __bfin__ | 123 | #ifdef __bfin__ |
126 | static void __inline__ lms_adapt_bg(struct oslec_state *ec, int clean, | 124 | static inline void lms_adapt_bg(struct oslec_state *ec, int clean, |
127 | int shift) | 125 | int shift) |
128 | { | 126 | { |
129 | int i, j; | 127 | int i, j; |
@@ -147,13 +145,13 @@ static void __inline__ lms_adapt_bg(struct oslec_state *ec, int clean, | |||
147 | 145 | ||
148 | /* st: and en: help us locate the assembler in echo.s */ | 146 | /* st: and en: help us locate the assembler in echo.s */ |
149 | 147 | ||
150 | //asm("st:"); | 148 | /* asm("st:"); */ |
151 | n = ec->taps; | 149 | n = ec->taps; |
152 | for (i = 0, j = offset2; i < n; i++, j++) { | 150 | for (i = 0, j = offset2; i < n; i++, j++) { |
153 | exp = *phist++ * factor; | 151 | exp = *phist++ * factor; |
154 | ec->fir_taps16[1][i] += (int16_t) ((exp + (1 << 14)) >> 15); | 152 | ec->fir_taps16[1][i] += (int16_t) ((exp + (1 << 14)) >> 15); |
155 | } | 153 | } |
156 | //asm("en:"); | 154 | /* asm("en:"); */ |
157 | 155 | ||
158 | /* Note the asm for the inner loop above generated by Blackfin gcc | 156 | /* Note the asm for the inner loop above generated by Blackfin gcc |
159 | 4.1.1 is pretty good (note even parallel instructions used): | 157 | 4.1.1 is pretty good (note even parallel instructions used): |
@@ -195,7 +193,7 @@ static void __inline__ lms_adapt_bg(struct oslec_state *ec, int clean, | |||
195 | */ | 193 | */ |
196 | 194 | ||
197 | #else | 195 | #else |
198 | static __inline__ void lms_adapt_bg(struct oslec_state *ec, int clean, | 196 | static inline void lms_adapt_bg(struct oslec_state *ec, int clean, |
199 | int shift) | 197 | int shift) |
200 | { | 198 | { |
201 | int i; | 199 | int i; |
@@ -249,9 +247,8 @@ struct oslec_state *oslec_create(int len, int adaption_mode) | |||
249 | fir16_create(&ec->fir_state, ec->fir_taps16[0], ec->taps); | 247 | fir16_create(&ec->fir_state, ec->fir_taps16[0], ec->taps); |
250 | fir16_create(&ec->fir_state_bg, ec->fir_taps16[1], ec->taps); | 248 | fir16_create(&ec->fir_state_bg, ec->fir_taps16[1], ec->taps); |
251 | 249 | ||
252 | for (i = 0; i < 5; i++) { | 250 | for (i = 0; i < 5; i++) |
253 | ec->xvtx[i] = ec->yvtx[i] = ec->xvrx[i] = ec->yvrx[i] = 0; | 251 | ec->xvtx[i] = ec->yvtx[i] = ec->xvrx[i] = ec->yvrx[i] = 0; |
254 | } | ||
255 | 252 | ||
256 | ec->cng_level = 1000; | 253 | ec->cng_level = 1000; |
257 | oslec_adaption_mode(ec, adaption_mode); | 254 | oslec_adaption_mode(ec, adaption_mode); |
@@ -271,14 +268,13 @@ struct oslec_state *oslec_create(int len, int adaption_mode) | |||
271 | 268 | ||
272 | return ec; | 269 | return ec; |
273 | 270 | ||
274 | error_oom: | 271 | error_oom: |
275 | for (i = 0; i < 2; i++) | 272 | for (i = 0; i < 2; i++) |
276 | kfree(ec->fir_taps16[i]); | 273 | kfree(ec->fir_taps16[i]); |
277 | 274 | ||
278 | kfree(ec); | 275 | kfree(ec); |
279 | return NULL; | 276 | return NULL; |
280 | } | 277 | } |
281 | |||
282 | EXPORT_SYMBOL_GPL(oslec_create); | 278 | EXPORT_SYMBOL_GPL(oslec_create); |
283 | 279 | ||
284 | void oslec_free(struct oslec_state *ec) | 280 | void oslec_free(struct oslec_state *ec) |
@@ -292,14 +288,12 @@ void oslec_free(struct oslec_state *ec) | |||
292 | kfree(ec->snapshot); | 288 | kfree(ec->snapshot); |
293 | kfree(ec); | 289 | kfree(ec); |
294 | } | 290 | } |
295 | |||
296 | EXPORT_SYMBOL_GPL(oslec_free); | 291 | EXPORT_SYMBOL_GPL(oslec_free); |
297 | 292 | ||
298 | void oslec_adaption_mode(struct oslec_state *ec, int adaption_mode) | 293 | void oslec_adaption_mode(struct oslec_state *ec, int adaption_mode) |
299 | { | 294 | { |
300 | ec->adaption_mode = adaption_mode; | 295 | ec->adaption_mode = adaption_mode; |
301 | } | 296 | } |
302 | |||
303 | EXPORT_SYMBOL_GPL(oslec_adaption_mode); | 297 | EXPORT_SYMBOL_GPL(oslec_adaption_mode); |
304 | 298 | ||
305 | void oslec_flush(struct oslec_state *ec) | 299 | void oslec_flush(struct oslec_state *ec) |
@@ -326,14 +320,12 @@ void oslec_flush(struct oslec_state *ec) | |||
326 | ec->curr_pos = ec->taps - 1; | 320 | ec->curr_pos = ec->taps - 1; |
327 | ec->Pstates = 0; | 321 | ec->Pstates = 0; |
328 | } | 322 | } |
329 | |||
330 | EXPORT_SYMBOL_GPL(oslec_flush); | 323 | EXPORT_SYMBOL_GPL(oslec_flush); |
331 | 324 | ||
332 | void oslec_snapshot(struct oslec_state *ec) | 325 | void oslec_snapshot(struct oslec_state *ec) |
333 | { | 326 | { |
334 | memcpy(ec->snapshot, ec->fir_taps16[0], ec->taps * sizeof(int16_t)); | 327 | memcpy(ec->snapshot, ec->fir_taps16[0], ec->taps * sizeof(int16_t)); |
335 | } | 328 | } |
336 | |||
337 | EXPORT_SYMBOL_GPL(oslec_snapshot); | 329 | EXPORT_SYMBOL_GPL(oslec_snapshot); |
338 | 330 | ||
339 | /* Dual Path Echo Canceller ------------------------------------------------*/ | 331 | /* Dual Path Echo Canceller ------------------------------------------------*/ |
@@ -399,7 +391,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) | |||
399 | /* efficient "out with the old and in with the new" algorithm so | 391 | /* efficient "out with the old and in with the new" algorithm so |
400 | we don't have to recalculate over the whole block of | 392 | we don't have to recalculate over the whole block of |
401 | samples. */ | 393 | samples. */ |
402 | new = (int)tx *(int)tx; | 394 | new = (int)tx * (int)tx; |
403 | old = (int)ec->fir_state.history[ec->fir_state.curr_pos] * | 395 | old = (int)ec->fir_state.history[ec->fir_state.curr_pos] * |
404 | (int)ec->fir_state.history[ec->fir_state.curr_pos]; | 396 | (int)ec->fir_state.history[ec->fir_state.curr_pos]; |
405 | ec->Pstates += | 397 | ec->Pstates += |
@@ -498,15 +490,15 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) | |||
498 | 490 | ||
499 | if ((ec->adaption_mode & ECHO_CAN_USE_ADAPTION) && | 491 | if ((ec->adaption_mode & ECHO_CAN_USE_ADAPTION) && |
500 | (ec->nonupdate_dwell == 0) && | 492 | (ec->nonupdate_dwell == 0) && |
501 | (8 * ec->Lclean_bg < | 493 | /* (ec->Lclean_bg < 0.875*ec->Lclean) */ |
502 | 7 * ec->Lclean) /* (ec->Lclean_bg < 0.875*ec->Lclean) */ && | 494 | (8 * ec->Lclean_bg < 7 * ec->Lclean) && |
503 | (8 * ec->Lclean_bg < | 495 | /* (ec->Lclean_bg < 0.125*ec->Ltx) */ |
504 | ec->Ltx) /* (ec->Lclean_bg < 0.125*ec->Ltx) */ ) { | 496 | (8 * ec->Lclean_bg < ec->Ltx)) { |
505 | if (ec->cond_met == 6) { | 497 | if (ec->cond_met == 6) { |
506 | /* BG filter has had better results for 6 consecutive samples */ | 498 | /* BG filter has had better results for 6 consecutive samples */ |
507 | ec->adapt = 1; | 499 | ec->adapt = 1; |
508 | memcpy(ec->fir_taps16[0], ec->fir_taps16[1], | 500 | memcpy(ec->fir_taps16[0], ec->fir_taps16[1], |
509 | ec->taps * sizeof(int16_t)); | 501 | ec->taps * sizeof(int16_t)); |
510 | } else | 502 | } else |
511 | ec->cond_met++; | 503 | ec->cond_met++; |
512 | } else | 504 | } else |
@@ -580,7 +572,6 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) | |||
580 | 572 | ||
581 | return (int16_t) ec->clean_nlp << 1; | 573 | return (int16_t) ec->clean_nlp << 1; |
582 | } | 574 | } |
583 | |||
584 | EXPORT_SYMBOL_GPL(oslec_update); | 575 | EXPORT_SYMBOL_GPL(oslec_update); |
585 | 576 | ||
586 | /* This function is seperated from the echo canceller is it is usually called | 577 | /* This function is seperated from the echo canceller is it is usually called |
@@ -604,7 +595,7 @@ EXPORT_SYMBOL_GPL(oslec_update); | |||
604 | precision, which noise shapes things, giving very clean DC removal. | 595 | precision, which noise shapes things, giving very clean DC removal. |
605 | */ | 596 | */ |
606 | 597 | ||
607 | int16_t oslec_hpf_tx(struct oslec_state * ec, int16_t tx) | 598 | int16_t oslec_hpf_tx(struct oslec_state *ec, int16_t tx) |
608 | { | 599 | { |
609 | int tmp, tmp1; | 600 | int tmp, tmp1; |
610 | 601 | ||
@@ -629,7 +620,6 @@ int16_t oslec_hpf_tx(struct oslec_state * ec, int16_t tx) | |||
629 | 620 | ||
630 | return tx; | 621 | return tx; |
631 | } | 622 | } |
632 | |||
633 | EXPORT_SYMBOL_GPL(oslec_hpf_tx); | 623 | EXPORT_SYMBOL_GPL(oslec_hpf_tx); |
634 | 624 | ||
635 | MODULE_LICENSE("GPL"); | 625 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/staging/echo/echo.h b/drivers/staging/echo/echo.h index 34fb816b15c8..c835e5c5314c 100644 --- a/drivers/staging/echo/echo.h +++ b/drivers/staging/echo/echo.h | |||
@@ -23,8 +23,6 @@ | |||
23 | * You should have received a copy of the GNU General Public License | 23 | * You should have received a copy of the GNU General Public License |
24 | * along with this program; if not, write to the Free Software | 24 | * along with this program; if not, write to the Free Software |
25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | * | ||
27 | * $Id: echo.h,v 1.9 2006/10/24 13:45:28 steveu Exp $ | ||
28 | */ | 26 | */ |
29 | 27 | ||
30 | #ifndef __ECHO_H | 28 | #ifndef __ECHO_H |
diff --git a/drivers/staging/echo/fir.h b/drivers/staging/echo/fir.h index d35f16805f4b..ac6c553e89f2 100644 --- a/drivers/staging/echo/fir.h +++ b/drivers/staging/echo/fir.h | |||
@@ -21,8 +21,6 @@ | |||
21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
22 | * along with this program; if not, write to the Free Software | 22 | * along with this program; if not, write to the Free Software |
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | * | ||
25 | * $Id: fir.h,v 1.8 2006/10/24 13:45:28 steveu Exp $ | ||
26 | */ | 24 | */ |
27 | 25 | ||
28 | /*! \page fir_page FIR filtering | 26 | /*! \page fir_page FIR filtering |
@@ -102,8 +100,8 @@ struct fir_float_state_t { | |||
102 | float *history; | 100 | float *history; |
103 | }; | 101 | }; |
104 | 102 | ||
105 | static __inline__ const int16_t *fir16_create(struct fir16_state_t *fir, | 103 | static inline const int16_t *fir16_create(struct fir16_state_t *fir, |
106 | const int16_t * coeffs, int taps) | 104 | const int16_t *coeffs, int taps) |
107 | { | 105 | { |
108 | fir->taps = taps; | 106 | fir->taps = taps; |
109 | fir->curr_pos = taps - 1; | 107 | fir->curr_pos = taps - 1; |
@@ -116,7 +114,7 @@ static __inline__ const int16_t *fir16_create(struct fir16_state_t *fir, | |||
116 | return fir->history; | 114 | return fir->history; |
117 | } | 115 | } |
118 | 116 | ||
119 | static __inline__ void fir16_flush(struct fir16_state_t *fir) | 117 | static inline void fir16_flush(struct fir16_state_t *fir) |
120 | { | 118 | { |
121 | #if defined(USE_MMX) || defined(USE_SSE2) || defined(__bfin__) | 119 | #if defined(USE_MMX) || defined(USE_SSE2) || defined(__bfin__) |
122 | memset(fir->history, 0, 2 * fir->taps * sizeof(int16_t)); | 120 | memset(fir->history, 0, 2 * fir->taps * sizeof(int16_t)); |
@@ -125,7 +123,7 @@ static __inline__ void fir16_flush(struct fir16_state_t *fir) | |||
125 | #endif | 123 | #endif |
126 | } | 124 | } |
127 | 125 | ||
128 | static __inline__ void fir16_free(struct fir16_state_t *fir) | 126 | static inline void fir16_free(struct fir16_state_t *fir) |
129 | { | 127 | { |
130 | kfree(fir->history); | 128 | kfree(fir->history); |
131 | } | 129 | } |
@@ -148,16 +146,16 @@ static inline int32_t dot_asm(short *x, short *y, int len) | |||
148 | "A0 += R0.L*R1.L (IS);\n\t" | 146 | "A0 += R0.L*R1.L (IS);\n\t" |
149 | "R0 = A0;\n\t" | 147 | "R0 = A0;\n\t" |
150 | "%0 = R0;\n\t" | 148 | "%0 = R0;\n\t" |
151 | :"=&d"(dot) | 149 | : "=&d"(dot) |
152 | :"a"(x), "a"(y), "a"(len) | 150 | : "a"(x), "a"(y), "a"(len) |
153 | :"I0", "I1", "A1", "A0", "R0", "R1" | 151 | : "I0", "I1", "A1", "A0", "R0", "R1" |
154 | ); | 152 | ); |
155 | 153 | ||
156 | return dot; | 154 | return dot; |
157 | } | 155 | } |
158 | #endif | 156 | #endif |
159 | 157 | ||
160 | static __inline__ int16_t fir16(struct fir16_state_t *fir, int16_t sample) | 158 | static inline int16_t fir16(struct fir16_state_t *fir, int16_t sample) |
161 | { | 159 | { |
162 | int32_t y; | 160 | int32_t y; |
163 | #if defined(USE_MMX) | 161 | #if defined(USE_MMX) |
@@ -250,8 +248,8 @@ static __inline__ int16_t fir16(struct fir16_state_t *fir, int16_t sample) | |||
250 | return (int16_t) (y >> 15); | 248 | return (int16_t) (y >> 15); |
251 | } | 249 | } |
252 | 250 | ||
253 | static __inline__ const int16_t *fir32_create(struct fir32_state_t *fir, | 251 | static inline const int16_t *fir32_create(struct fir32_state_t *fir, |
254 | const int32_t * coeffs, int taps) | 252 | const int32_t *coeffs, int taps) |
255 | { | 253 | { |
256 | fir->taps = taps; | 254 | fir->taps = taps; |
257 | fir->curr_pos = taps - 1; | 255 | fir->curr_pos = taps - 1; |
@@ -260,17 +258,17 @@ static __inline__ const int16_t *fir32_create(struct fir32_state_t *fir, | |||
260 | return fir->history; | 258 | return fir->history; |
261 | } | 259 | } |
262 | 260 | ||
263 | static __inline__ void fir32_flush(struct fir32_state_t *fir) | 261 | static inline void fir32_flush(struct fir32_state_t *fir) |
264 | { | 262 | { |
265 | memset(fir->history, 0, fir->taps * sizeof(int16_t)); | 263 | memset(fir->history, 0, fir->taps * sizeof(int16_t)); |
266 | } | 264 | } |
267 | 265 | ||
268 | static __inline__ void fir32_free(struct fir32_state_t *fir) | 266 | static inline void fir32_free(struct fir32_state_t *fir) |
269 | { | 267 | { |
270 | kfree(fir->history); | 268 | kfree(fir->history); |
271 | } | 269 | } |
272 | 270 | ||
273 | static __inline__ int16_t fir32(struct fir32_state_t *fir, int16_t sample) | 271 | static inline int16_t fir32(struct fir32_state_t *fir, int16_t sample) |
274 | { | 272 | { |
275 | int i; | 273 | int i; |
276 | int32_t y; | 274 | int32_t y; |
diff --git a/drivers/staging/echo/mmx.h b/drivers/staging/echo/mmx.h index 44e5cfebc18f..c1dcd7299cb5 100644 --- a/drivers/staging/echo/mmx.h +++ b/drivers/staging/echo/mmx.h | |||
@@ -44,238 +44,238 @@ union xmm_t { | |||
44 | char b[16]; | 44 | char b[16]; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #define mmx_i2r(op,imm,reg) \ | 47 | #define mmx_i2r(op, imm, reg) \ |
48 | __asm__ __volatile__ (#op " %0, %%" #reg \ | 48 | __asm__ __volatile__ (#op " %0, %%" #reg \ |
49 | : /* nothing */ \ | 49 | : /* nothing */ \ |
50 | : "i" (imm) ) | 50 | : "i" (imm)) |
51 | 51 | ||
52 | #define mmx_m2r(op,mem,reg) \ | 52 | #define mmx_m2r(op, mem, reg) \ |
53 | __asm__ __volatile__ (#op " %0, %%" #reg \ | 53 | __asm__ __volatile__ (#op " %0, %%" #reg \ |
54 | : /* nothing */ \ | 54 | : /* nothing */ \ |
55 | : "m" (mem)) | 55 | : "m" (mem)) |
56 | 56 | ||
57 | #define mmx_r2m(op,reg,mem) \ | 57 | #define mmx_r2m(op, reg, mem) \ |
58 | __asm__ __volatile__ (#op " %%" #reg ", %0" \ | 58 | __asm__ __volatile__ (#op " %%" #reg ", %0" \ |
59 | : "=m" (mem) \ | 59 | : "=m" (mem) \ |
60 | : /* nothing */ ) | 60 | : /* nothing */) |
61 | 61 | ||
62 | #define mmx_r2r(op,regs,regd) \ | 62 | #define mmx_r2r(op, regs, regd) \ |
63 | __asm__ __volatile__ (#op " %" #regs ", %" #regd) | 63 | __asm__ __volatile__ (#op " %" #regs ", %" #regd) |
64 | 64 | ||
65 | #define emms() __asm__ __volatile__ ("emms") | 65 | #define emms() __asm__ __volatile__ ("emms") |
66 | 66 | ||
67 | #define movd_m2r(var,reg) mmx_m2r (movd, var, reg) | 67 | #define movd_m2r(var, reg) mmx_m2r(movd, var, reg) |
68 | #define movd_r2m(reg,var) mmx_r2m (movd, reg, var) | 68 | #define movd_r2m(reg, var) mmx_r2m(movd, reg, var) |
69 | #define movd_r2r(regs,regd) mmx_r2r (movd, regs, regd) | 69 | #define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) |
70 | 70 | ||
71 | #define movq_m2r(var,reg) mmx_m2r (movq, var, reg) | 71 | #define movq_m2r(var, reg) mmx_m2r(movq, var, reg) |
72 | #define movq_r2m(reg,var) mmx_r2m (movq, reg, var) | 72 | #define movq_r2m(reg, var) mmx_r2m(movq, reg, var) |
73 | #define movq_r2r(regs,regd) mmx_r2r (movq, regs, regd) | 73 | #define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) |
74 | 74 | ||
75 | #define packssdw_m2r(var,reg) mmx_m2r (packssdw, var, reg) | 75 | #define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg) |
76 | #define packssdw_r2r(regs,regd) mmx_r2r (packssdw, regs, regd) | 76 | #define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) |
77 | #define packsswb_m2r(var,reg) mmx_m2r (packsswb, var, reg) | 77 | #define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg) |
78 | #define packsswb_r2r(regs,regd) mmx_r2r (packsswb, regs, regd) | 78 | #define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd) |
79 | 79 | ||
80 | #define packuswb_m2r(var,reg) mmx_m2r (packuswb, var, reg) | 80 | #define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg) |
81 | #define packuswb_r2r(regs,regd) mmx_r2r (packuswb, regs, regd) | 81 | #define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) |
82 | 82 | ||
83 | #define paddb_m2r(var,reg) mmx_m2r (paddb, var, reg) | 83 | #define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg) |
84 | #define paddb_r2r(regs,regd) mmx_r2r (paddb, regs, regd) | 84 | #define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd) |
85 | #define paddd_m2r(var,reg) mmx_m2r (paddd, var, reg) | 85 | #define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg) |
86 | #define paddd_r2r(regs,regd) mmx_r2r (paddd, regs, regd) | 86 | #define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd) |
87 | #define paddw_m2r(var,reg) mmx_m2r (paddw, var, reg) | 87 | #define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) |
88 | #define paddw_r2r(regs,regd) mmx_r2r (paddw, regs, regd) | 88 | #define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) |
89 | 89 | ||
90 | #define paddsb_m2r(var,reg) mmx_m2r (paddsb, var, reg) | 90 | #define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg) |
91 | #define paddsb_r2r(regs,regd) mmx_r2r (paddsb, regs, regd) | 91 | #define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd) |
92 | #define paddsw_m2r(var,reg) mmx_m2r (paddsw, var, reg) | 92 | #define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg) |
93 | #define paddsw_r2r(regs,regd) mmx_r2r (paddsw, regs, regd) | 93 | #define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd) |
94 | 94 | ||
95 | #define paddusb_m2r(var,reg) mmx_m2r (paddusb, var, reg) | 95 | #define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg) |
96 | #define paddusb_r2r(regs,regd) mmx_r2r (paddusb, regs, regd) | 96 | #define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd) |
97 | #define paddusw_m2r(var,reg) mmx_m2r (paddusw, var, reg) | 97 | #define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg) |
98 | #define paddusw_r2r(regs,regd) mmx_r2r (paddusw, regs, regd) | 98 | #define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd) |
99 | 99 | ||
100 | #define pand_m2r(var,reg) mmx_m2r (pand, var, reg) | 100 | #define pand_m2r(var, reg) mmx_m2r(pand, var, reg) |
101 | #define pand_r2r(regs,regd) mmx_r2r (pand, regs, regd) | 101 | #define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd) |
102 | 102 | ||
103 | #define pandn_m2r(var,reg) mmx_m2r (pandn, var, reg) | 103 | #define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg) |
104 | #define pandn_r2r(regs,regd) mmx_r2r (pandn, regs, regd) | 104 | #define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd) |
105 | 105 | ||
106 | #define pcmpeqb_m2r(var,reg) mmx_m2r (pcmpeqb, var, reg) | 106 | #define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg) |
107 | #define pcmpeqb_r2r(regs,regd) mmx_r2r (pcmpeqb, regs, regd) | 107 | #define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd) |
108 | #define pcmpeqd_m2r(var,reg) mmx_m2r (pcmpeqd, var, reg) | 108 | #define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg) |
109 | #define pcmpeqd_r2r(regs,regd) mmx_r2r (pcmpeqd, regs, regd) | 109 | #define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd) |
110 | #define pcmpeqw_m2r(var,reg) mmx_m2r (pcmpeqw, var, reg) | 110 | #define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg) |
111 | #define pcmpeqw_r2r(regs,regd) mmx_r2r (pcmpeqw, regs, regd) | 111 | #define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd) |
112 | 112 | ||
113 | #define pcmpgtb_m2r(var,reg) mmx_m2r (pcmpgtb, var, reg) | 113 | #define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg) |
114 | #define pcmpgtb_r2r(regs,regd) mmx_r2r (pcmpgtb, regs, regd) | 114 | #define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd) |
115 | #define pcmpgtd_m2r(var,reg) mmx_m2r (pcmpgtd, var, reg) | 115 | #define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg) |
116 | #define pcmpgtd_r2r(regs,regd) mmx_r2r (pcmpgtd, regs, regd) | 116 | #define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd) |
117 | #define pcmpgtw_m2r(var,reg) mmx_m2r (pcmpgtw, var, reg) | 117 | #define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg) |
118 | #define pcmpgtw_r2r(regs,regd) mmx_r2r (pcmpgtw, regs, regd) | 118 | #define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) |
119 | 119 | ||
120 | #define pmaddwd_m2r(var,reg) mmx_m2r (pmaddwd, var, reg) | 120 | #define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg) |
121 | #define pmaddwd_r2r(regs,regd) mmx_r2r (pmaddwd, regs, regd) | 121 | #define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) |
122 | 122 | ||
123 | #define pmulhw_m2r(var,reg) mmx_m2r (pmulhw, var, reg) | 123 | #define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) |
124 | #define pmulhw_r2r(regs,regd) mmx_r2r (pmulhw, regs, regd) | 124 | #define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) |
125 | 125 | ||
126 | #define pmullw_m2r(var,reg) mmx_m2r (pmullw, var, reg) | 126 | #define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg) |
127 | #define pmullw_r2r(regs,regd) mmx_r2r (pmullw, regs, regd) | 127 | #define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd) |
128 | 128 | ||
129 | #define por_m2r(var,reg) mmx_m2r (por, var, reg) | 129 | #define por_m2r(var, reg) mmx_m2r(por, var, reg) |
130 | #define por_r2r(regs,regd) mmx_r2r (por, regs, regd) | 130 | #define por_r2r(regs, regd) mmx_r2r(por, regs, regd) |
131 | 131 | ||
132 | #define pslld_i2r(imm,reg) mmx_i2r (pslld, imm, reg) | 132 | #define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg) |
133 | #define pslld_m2r(var,reg) mmx_m2r (pslld, var, reg) | 133 | #define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg) |
134 | #define pslld_r2r(regs,regd) mmx_r2r (pslld, regs, regd) | 134 | #define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd) |
135 | #define psllq_i2r(imm,reg) mmx_i2r (psllq, imm, reg) | 135 | #define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg) |
136 | #define psllq_m2r(var,reg) mmx_m2r (psllq, var, reg) | 136 | #define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg) |
137 | #define psllq_r2r(regs,regd) mmx_r2r (psllq, regs, regd) | 137 | #define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd) |
138 | #define psllw_i2r(imm,reg) mmx_i2r (psllw, imm, reg) | 138 | #define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) |
139 | #define psllw_m2r(var,reg) mmx_m2r (psllw, var, reg) | 139 | #define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg) |
140 | #define psllw_r2r(regs,regd) mmx_r2r (psllw, regs, regd) | 140 | #define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd) |
141 | 141 | ||
142 | #define psrad_i2r(imm,reg) mmx_i2r (psrad, imm, reg) | 142 | #define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) |
143 | #define psrad_m2r(var,reg) mmx_m2r (psrad, var, reg) | 143 | #define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg) |
144 | #define psrad_r2r(regs,regd) mmx_r2r (psrad, regs, regd) | 144 | #define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd) |
145 | #define psraw_i2r(imm,reg) mmx_i2r (psraw, imm, reg) | 145 | #define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) |
146 | #define psraw_m2r(var,reg) mmx_m2r (psraw, var, reg) | 146 | #define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg) |
147 | #define psraw_r2r(regs,regd) mmx_r2r (psraw, regs, regd) | 147 | #define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd) |
148 | 148 | ||
149 | #define psrld_i2r(imm,reg) mmx_i2r (psrld, imm, reg) | 149 | #define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg) |
150 | #define psrld_m2r(var,reg) mmx_m2r (psrld, var, reg) | 150 | #define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg) |
151 | #define psrld_r2r(regs,regd) mmx_r2r (psrld, regs, regd) | 151 | #define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd) |
152 | #define psrlq_i2r(imm,reg) mmx_i2r (psrlq, imm, reg) | 152 | #define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg) |
153 | #define psrlq_m2r(var,reg) mmx_m2r (psrlq, var, reg) | 153 | #define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg) |
154 | #define psrlq_r2r(regs,regd) mmx_r2r (psrlq, regs, regd) | 154 | #define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd) |
155 | #define psrlw_i2r(imm,reg) mmx_i2r (psrlw, imm, reg) | 155 | #define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg) |
156 | #define psrlw_m2r(var,reg) mmx_m2r (psrlw, var, reg) | 156 | #define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg) |
157 | #define psrlw_r2r(regs,regd) mmx_r2r (psrlw, regs, regd) | 157 | #define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd) |
158 | 158 | ||
159 | #define psubb_m2r(var,reg) mmx_m2r (psubb, var, reg) | 159 | #define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg) |
160 | #define psubb_r2r(regs,regd) mmx_r2r (psubb, regs, regd) | 160 | #define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd) |
161 | #define psubd_m2r(var,reg) mmx_m2r (psubd, var, reg) | 161 | #define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg) |
162 | #define psubd_r2r(regs,regd) mmx_r2r (psubd, regs, regd) | 162 | #define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd) |
163 | #define psubw_m2r(var,reg) mmx_m2r (psubw, var, reg) | 163 | #define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) |
164 | #define psubw_r2r(regs,regd) mmx_r2r (psubw, regs, regd) | 164 | #define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) |
165 | 165 | ||
166 | #define psubsb_m2r(var,reg) mmx_m2r (psubsb, var, reg) | 166 | #define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg) |
167 | #define psubsb_r2r(regs,regd) mmx_r2r (psubsb, regs, regd) | 167 | #define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd) |
168 | #define psubsw_m2r(var,reg) mmx_m2r (psubsw, var, reg) | 168 | #define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg) |
169 | #define psubsw_r2r(regs,regd) mmx_r2r (psubsw, regs, regd) | 169 | #define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) |
170 | 170 | ||
171 | #define psubusb_m2r(var,reg) mmx_m2r (psubusb, var, reg) | 171 | #define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg) |
172 | #define psubusb_r2r(regs,regd) mmx_r2r (psubusb, regs, regd) | 172 | #define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd) |
173 | #define psubusw_m2r(var,reg) mmx_m2r (psubusw, var, reg) | 173 | #define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg) |
174 | #define psubusw_r2r(regs,regd) mmx_r2r (psubusw, regs, regd) | 174 | #define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd) |
175 | 175 | ||
176 | #define punpckhbw_m2r(var,reg) mmx_m2r (punpckhbw, var, reg) | 176 | #define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg) |
177 | #define punpckhbw_r2r(regs,regd) mmx_r2r (punpckhbw, regs, regd) | 177 | #define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) |
178 | #define punpckhdq_m2r(var,reg) mmx_m2r (punpckhdq, var, reg) | 178 | #define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg) |
179 | #define punpckhdq_r2r(regs,regd) mmx_r2r (punpckhdq, regs, regd) | 179 | #define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) |
180 | #define punpckhwd_m2r(var,reg) mmx_m2r (punpckhwd, var, reg) | 180 | #define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) |
181 | #define punpckhwd_r2r(regs,regd) mmx_r2r (punpckhwd, regs, regd) | 181 | #define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) |
182 | 182 | ||
183 | #define punpcklbw_m2r(var,reg) mmx_m2r (punpcklbw, var, reg) | 183 | #define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg) |
184 | #define punpcklbw_r2r(regs,regd) mmx_r2r (punpcklbw, regs, regd) | 184 | #define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) |
185 | #define punpckldq_m2r(var,reg) mmx_m2r (punpckldq, var, reg) | 185 | #define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg) |
186 | #define punpckldq_r2r(regs,regd) mmx_r2r (punpckldq, regs, regd) | 186 | #define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) |
187 | #define punpcklwd_m2r(var,reg) mmx_m2r (punpcklwd, var, reg) | 187 | #define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) |
188 | #define punpcklwd_r2r(regs,regd) mmx_r2r (punpcklwd, regs, regd) | 188 | #define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) |
189 | 189 | ||
190 | #define pxor_m2r(var,reg) mmx_m2r (pxor, var, reg) | 190 | #define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg) |
191 | #define pxor_r2r(regs,regd) mmx_r2r (pxor, regs, regd) | 191 | #define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) |
192 | 192 | ||
193 | /* 3DNOW extensions */ | 193 | /* 3DNOW extensions */ |
194 | 194 | ||
195 | #define pavgusb_m2r(var,reg) mmx_m2r (pavgusb, var, reg) | 195 | #define pavgusb_m2r(var, reg) mmx_m2r(pavgusb, var, reg) |
196 | #define pavgusb_r2r(regs,regd) mmx_r2r (pavgusb, regs, regd) | 196 | #define pavgusb_r2r(regs, regd) mmx_r2r(pavgusb, regs, regd) |
197 | 197 | ||
198 | /* AMD MMX extensions - also available in intel SSE */ | 198 | /* AMD MMX extensions - also available in intel SSE */ |
199 | 199 | ||
200 | #define mmx_m2ri(op,mem,reg,imm) \ | 200 | #define mmx_m2ri(op, mem, reg, imm) \ |
201 | __asm__ __volatile__ (#op " %1, %0, %%" #reg \ | 201 | __asm__ __volatile__ (#op " %1, %0, %%" #reg \ |
202 | : /* nothing */ \ | 202 | : /* nothing */ \ |
203 | : "m" (mem), "i" (imm)) | 203 | : "m" (mem), "i" (imm)) |
204 | #define mmx_r2ri(op,regs,regd,imm) \ | 204 | #define mmx_r2ri(op, regs, regd, imm) \ |
205 | __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \ | 205 | __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \ |
206 | : /* nothing */ \ | 206 | : /* nothing */ \ |
207 | : "i" (imm) ) | 207 | : "i" (imm)) |
208 | 208 | ||
209 | #define mmx_fetch(mem,hint) \ | 209 | #define mmx_fetch(mem, hint) \ |
210 | __asm__ __volatile__ ("prefetch" #hint " %0" \ | 210 | __asm__ __volatile__ ("prefetch" #hint " %0" \ |
211 | : /* nothing */ \ | 211 | : /* nothing */ \ |
212 | : "m" (mem)) | 212 | : "m" (mem)) |
213 | 213 | ||
214 | #define maskmovq(regs,maskreg) mmx_r2ri (maskmovq, regs, maskreg) | 214 | #define maskmovq(regs, maskreg) mmx_r2ri(maskmovq, regs, maskreg) |
215 | 215 | ||
216 | #define movntq_r2m(mmreg,var) mmx_r2m (movntq, mmreg, var) | 216 | #define movntq_r2m(mmreg, var) mmx_r2m(movntq, mmreg, var) |
217 | 217 | ||
218 | #define pavgb_m2r(var,reg) mmx_m2r (pavgb, var, reg) | 218 | #define pavgb_m2r(var, reg) mmx_m2r(pavgb, var, reg) |
219 | #define pavgb_r2r(regs,regd) mmx_r2r (pavgb, regs, regd) | 219 | #define pavgb_r2r(regs, regd) mmx_r2r(pavgb, regs, regd) |
220 | #define pavgw_m2r(var,reg) mmx_m2r (pavgw, var, reg) | 220 | #define pavgw_m2r(var, reg) mmx_m2r(pavgw, var, reg) |
221 | #define pavgw_r2r(regs,regd) mmx_r2r (pavgw, regs, regd) | 221 | #define pavgw_r2r(regs, regd) mmx_r2r(pavgw, regs, regd) |
222 | 222 | ||
223 | #define pextrw_r2r(mmreg,reg,imm) mmx_r2ri (pextrw, mmreg, reg, imm) | 223 | #define pextrw_r2r(mmreg, reg, imm) mmx_r2ri(pextrw, mmreg, reg, imm) |
224 | 224 | ||
225 | #define pinsrw_r2r(reg,mmreg,imm) mmx_r2ri (pinsrw, reg, mmreg, imm) | 225 | #define pinsrw_r2r(reg, mmreg, imm) mmx_r2ri(pinsrw, reg, mmreg, imm) |
226 | 226 | ||
227 | #define pmaxsw_m2r(var,reg) mmx_m2r (pmaxsw, var, reg) | 227 | #define pmaxsw_m2r(var, reg) mmx_m2r(pmaxsw, var, reg) |
228 | #define pmaxsw_r2r(regs,regd) mmx_r2r (pmaxsw, regs, regd) | 228 | #define pmaxsw_r2r(regs, regd) mmx_r2r(pmaxsw, regs, regd) |
229 | 229 | ||
230 | #define pmaxub_m2r(var,reg) mmx_m2r (pmaxub, var, reg) | 230 | #define pmaxub_m2r(var, reg) mmx_m2r(pmaxub, var, reg) |
231 | #define pmaxub_r2r(regs,regd) mmx_r2r (pmaxub, regs, regd) | 231 | #define pmaxub_r2r(regs, regd) mmx_r2r(pmaxub, regs, regd) |
232 | 232 | ||
233 | #define pminsw_m2r(var,reg) mmx_m2r (pminsw, var, reg) | 233 | #define pminsw_m2r(var, reg) mmx_m2r(pminsw, var, reg) |
234 | #define pminsw_r2r(regs,regd) mmx_r2r (pminsw, regs, regd) | 234 | #define pminsw_r2r(regs, regd) mmx_r2r(pminsw, regs, regd) |
235 | 235 | ||
236 | #define pminub_m2r(var,reg) mmx_m2r (pminub, var, reg) | 236 | #define pminub_m2r(var, reg) mmx_m2r(pminub, var, reg) |
237 | #define pminub_r2r(regs,regd) mmx_r2r (pminub, regs, regd) | 237 | #define pminub_r2r(regs, regd) mmx_r2r(pminub, regs, regd) |
238 | 238 | ||
239 | #define pmovmskb(mmreg,reg) \ | 239 | #define pmovmskb(mmreg, reg) \ |
240 | __asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg) | 240 | __asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg) |
241 | 241 | ||
242 | #define pmulhuw_m2r(var,reg) mmx_m2r (pmulhuw, var, reg) | 242 | #define pmulhuw_m2r(var, reg) mmx_m2r(pmulhuw, var, reg) |
243 | #define pmulhuw_r2r(regs,regd) mmx_r2r (pmulhuw, regs, regd) | 243 | #define pmulhuw_r2r(regs, regd) mmx_r2r(pmulhuw, regs, regd) |
244 | 244 | ||
245 | #define prefetcht0(mem) mmx_fetch (mem, t0) | 245 | #define prefetcht0(mem) mmx_fetch(mem, t0) |
246 | #define prefetcht1(mem) mmx_fetch (mem, t1) | 246 | #define prefetcht1(mem) mmx_fetch(mem, t1) |
247 | #define prefetcht2(mem) mmx_fetch (mem, t2) | 247 | #define prefetcht2(mem) mmx_fetch(mem, t2) |
248 | #define prefetchnta(mem) mmx_fetch (mem, nta) | 248 | #define prefetchnta(mem) mmx_fetch(mem, nta) |
249 | 249 | ||
250 | #define psadbw_m2r(var,reg) mmx_m2r (psadbw, var, reg) | 250 | #define psadbw_m2r(var, reg) mmx_m2r(psadbw, var, reg) |
251 | #define psadbw_r2r(regs,regd) mmx_r2r (psadbw, regs, regd) | 251 | #define psadbw_r2r(regs, regd) mmx_r2r(psadbw, regs, regd) |
252 | 252 | ||
253 | #define pshufw_m2r(var,reg,imm) mmx_m2ri(pshufw, var, reg, imm) | 253 | #define pshufw_m2r(var, reg, imm) mmx_m2ri(pshufw, var, reg, imm) |
254 | #define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm) | 254 | #define pshufw_r2r(regs, regd, imm) mmx_r2ri(pshufw, regs, regd, imm) |
255 | 255 | ||
256 | #define sfence() __asm__ __volatile__ ("sfence\n\t") | 256 | #define sfence() __asm__ __volatile__ ("sfence\n\t") |
257 | 257 | ||
258 | /* SSE2 */ | 258 | /* SSE2 */ |
259 | #define pshufhw_m2r(var,reg,imm) mmx_m2ri(pshufhw, var, reg, imm) | 259 | #define pshufhw_m2r(var, reg, imm) mmx_m2ri(pshufhw, var, reg, imm) |
260 | #define pshufhw_r2r(regs,regd,imm) mmx_r2ri(pshufhw, regs, regd, imm) | 260 | #define pshufhw_r2r(regs, regd, imm) mmx_r2ri(pshufhw, regs, regd, imm) |
261 | #define pshuflw_m2r(var,reg,imm) mmx_m2ri(pshuflw, var, reg, imm) | 261 | #define pshuflw_m2r(var, reg, imm) mmx_m2ri(pshuflw, var, reg, imm) |
262 | #define pshuflw_r2r(regs,regd,imm) mmx_r2ri(pshuflw, regs, regd, imm) | 262 | #define pshuflw_r2r(regs, regd, imm) mmx_r2ri(pshuflw, regs, regd, imm) |
263 | 263 | ||
264 | #define pshufd_r2r(regs,regd,imm) mmx_r2ri(pshufd, regs, regd, imm) | 264 | #define pshufd_r2r(regs, regd, imm) mmx_r2ri(pshufd, regs, regd, imm) |
265 | 265 | ||
266 | #define movdqa_m2r(var,reg) mmx_m2r (movdqa, var, reg) | 266 | #define movdqa_m2r(var, reg) mmx_m2r(movdqa, var, reg) |
267 | #define movdqa_r2m(reg,var) mmx_r2m (movdqa, reg, var) | 267 | #define movdqa_r2m(reg, var) mmx_r2m(movdqa, reg, var) |
268 | #define movdqa_r2r(regs,regd) mmx_r2r (movdqa, regs, regd) | 268 | #define movdqa_r2r(regs, regd) mmx_r2r(movdqa, regs, regd) |
269 | #define movdqu_m2r(var,reg) mmx_m2r (movdqu, var, reg) | 269 | #define movdqu_m2r(var, reg) mmx_m2r(movdqu, var, reg) |
270 | #define movdqu_r2m(reg,var) mmx_r2m (movdqu, reg, var) | 270 | #define movdqu_r2m(reg, var) mmx_r2m(movdqu, reg, var) |
271 | #define movdqu_r2r(regs,regd) mmx_r2r (movdqu, regs, regd) | 271 | #define movdqu_r2r(regs, regd) mmx_r2r(movdqu, regs, regd) |
272 | 272 | ||
273 | #define pmullw_r2m(reg,var) mmx_r2m (pmullw, reg, var) | 273 | #define pmullw_r2m(reg, var) mmx_r2m(pmullw, reg, var) |
274 | 274 | ||
275 | #define pslldq_i2r(imm,reg) mmx_i2r (pslldq, imm, reg) | 275 | #define pslldq_i2r(imm, reg) mmx_i2r(pslldq, imm, reg) |
276 | #define psrldq_i2r(imm,reg) mmx_i2r (psrldq, imm, reg) | 276 | #define psrldq_i2r(imm, reg) mmx_i2r(psrldq, imm, reg) |
277 | 277 | ||
278 | #define punpcklqdq_r2r(regs,regd) mmx_r2r (punpcklqdq, regs, regd) | 278 | #define punpcklqdq_r2r(regs, regd) mmx_r2r(punpcklqdq, regs, regd) |
279 | #define punpckhqdq_r2r(regs,regd) mmx_r2r (punpckhqdq, regs, regd) | 279 | #define punpckhqdq_r2r(regs, regd) mmx_r2r(punpckhqdq, regs, regd) |
280 | 280 | ||
281 | #endif /* AVCODEC_I386MMX_H */ | 281 | #endif /* AVCODEC_I386MMX_H */ |