This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
inline int fixp_mul_32s_nX( int a, int b, char n ) { int res, tmp; int p = 32-n; __asm__ __volatile__ ( "smull %0, %1, %2, %3 \n\t" "movs %0, %0, lsr %4 \n\t" "adc %1, %0, %1, lsl %5 \n\t" : "=&r" (res), "=&r" (tmp) : "r" (a), "r" (b), "rM" (n), "rM" (p) ); return res; }
This allows the compiler to use a register or a constant in the range 0-31. But it's quite possible that you will always get a register passed in this case.
inline int fixp_mul_32s_nX( int a, int b ) { int res, tmp; const char n = 8; const char m = 32 - n; __asm__ __volatile__ ( "smull %0, %1, %2, %3 \n\t" "movs %0, %0, lsr %4 \n\t" "adc %1, %0, %1, lsl %5 \n\t" : "=&r" (tmp), "=&r" (res) : "r" (a), "r" (b), "M" (n), "M" (m) ); return res; }
Thanks, - Bryce
-- Bryce Schober Design Engineer Dynon Avionics, Inc. www.dynonavionics.com
--- [This E-mail scanned for viruses by digiposs.com]
------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |