[Mono-dev] arm fpu runtime selection

Rodrigo Kumpera kumpera at gmail.com
Sun Jun 20 01:02:28 EDT 2010


I think we can simplify your approach to a much more localized change:


#ifdef MONO_ARCH_SOFT_FLOAT
#define COMPILE_SOFT_FLOAT(cfg) ((cfg)->use_soft_float)
#else
#define COMPILE_SOFT_FLOAT(cfg) 0
#endif


And then on mini_method_compile:

#ifdef MONO_ARCH_SOFT_FLOAT
cfg->use_soft_float = mono_arch_is_soft_float () && !COMPILE_LLVM (cfg);
#endif

Then it's a matter of replacing all checks for MONO_ARCH_SOFT_FLOAT to
checks for COMPILE_SOFT_FLOAT(cfg).

This approach relies on a minimally decent compiler capable of eliminating
trivial dead code which IMHO is something we
must assume to be true in 2010.

I'm not a big fan of the mono_arch_is_soft_float bit. I would rather cleanup
and unify this with simd and cpu-specific ops into a
single cpu caps thing.

If we unify the above three, supporting AOT would be a matter of changing
the initialization code to read a supplied argument that
override auto-detected caps. This would be a great addition to help testing
those runtime selectable features. I should have done it for Mono.Simd so
our build bot could test it running on less capable hardware.

The only thing that would be very hard would be supporting
runtime-selectable FPU under AOT. Well, not really, that would a minor
enhancement over soft-float.

By the way, what's the use of runtime selectable FPU mode for JIT'd code if
we don't do the same for the runtime itself?



On Sun, Jun 20, 2010 at 1:20 AM, Geoff Norton <gnorton at novell.com> wrote:

> Its valuable for us to be able to jit to different FPU's based on cpu
> capabilities, rather than a runtime compile, particularly on arm.  As such
> I've started porting things over to being runtime selectable.  I've attached
> a patch which reworks most of mini, and am looking for comments on the
> approach before continuing, VFP seems to be working but there are a few
> known issues:
>
> #1: soft float currently has some regressions, I'm still tracking down
> exactly where, if it pops out please let me know
> #2: We dont detect cpu capabilities at runtime yet, its driven off an env
> var, maybe we should emit and test small functions and catch the sigill on
> startup?  input would be nice here
> #3: How do we handle the aot case, perhaps we introduce a new aot flag for
> fpu mode?
>
> Thanks
>
> -g
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100620/9d891eb2/attachment.html 


More information about the Mono-devel-list mailing list