[Mono-devel-list] Question regarding ASM in mini-x86.c

Paolo Molaro lupus at ximian.com
Sun Feb 13 10:58:39 EST 2005


On 02/12/05 J Lothian wrote:
> Ah, much thanks,  it compiles, which may not be saying much at this
> point, but I can work out bugs later when it all links correctly.
> 
> stuck this in the cpu_init, think its going to work, I'm not
> -entirely- sure if it's doing the same thing ( I may be way off here)
> #ifndef _MSC_VER
> 	__asm__  __volatile__ ("fnstcw %0\n": "=m" (fpcw));
> 	fpcw &= ~X86_FPCW_PRECC_MASK;
> 	fpcw |= X86_FPCW_PREC_DOUBLE;
> 	__asm__  __volatile__ ("fldcw %0\n": : "m" (fpcw));
> 	__asm__  __volatile__ ("fnstcw %0\n": "=m" (fpcw));
> #else
> 	_control87( _PC_64, MCW_PC );
> #endif

You could try using:
	__asm {fnstcw fpcw};
 	fpcw &= ~X86_FPCW_PRECC_MASK;
 	fpcw |= X86_FPCW_PREC_DOUBLE;
 	__asm {fldcw fpcw};
 	__asm {fnstcw fpcw};

Note: I haven't tested and I never used the MS compiler, so be warned:-)
You can also disable the code, it's not important for now
(same for the cpuid detection).

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list