View Single Post
Old 06 March 2013, 04:46   #15
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
/* Must set rounding mode before using floating point MULH() and MUL64()
	fmove.l #$20,fpcr	;set rounding mode Toward Minus Infinitiy (RM) */

static inline int MULH(int a, int b) 
 int hi; 
 "fmove.s #796917760,fp0 \n\t"
 "fmul.l %0,fp0 \n\t"
 "fmul.l %1,fp0 \n\t"
 "fmove.l fp0,%0 \n\t"
 :"0"(a), "dm"(b) 
 return hi; 

static inline int64_t MUL64(int a, int b) 
 int lo, hi;
 "fmove.l %0,fp0 \n\t"
 "muls.l %1,%0 \n\t"
 "bvs.b 0f \n\t"
 "smi %1 \n\t"
 "extb.l %1 \n\t"
 "bra.b 1f \n\t"
 "0: \n\t"
 "fmul.s #796917760,fp0 \n\t"
 "fmul.l %1,fp0 \n\t"
 "fmove.l fp0,%1 \n\t"
 "1: \n\t"
 :"=d"(lo), "=d"(hi) 
 :"0"(a), "1"(b) 
 return ((uint64_t)hi <<32) | lo;
That looks a lot like my 68060 fp code for ffmpeg .

Originally Posted by lantus360 View Post
AmiDevCpp - GCC 3.4

ive also got Cubic IDE and make a build for GCC 2.94 -i've heard it produces better code but in my real world tests its exactly the same performance as 3.4
GCC 2.95.3 does generally generate better code. GCC 3.4.0 has some flaws like putting an extra instruction inside of some loops. GCC 3.4.0 does use the utility.library math functions and the exec.libary memory copy routines so if these are patched with CPU specific versions then it can make a quite noticable improvement. It depends on the code in the end.

Oh. Howdy neighbor! It's kind of funny finding an Amiga programmer that lives so close on a forum so far away .
I'm looking forward to playing Strife. It looks like you're making good progress. Well, off to DosBox debugging I go.
matthey is offline  
Page generated in 0.04123 seconds with 10 queries