[Mono-dev] arm fpu runtime selection
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:
#define COMPILE_SOFT_FLOAT(cfg) ((cfg)->use_soft_float)
#define COMPILE_SOFT_FLOAT(cfg) 0
And then on mini_method_compile:
cfg->use_soft_float = mono_arch_is_soft_float () && !COMPILE_LLVM (cfg);
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?
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list