On 2015-12-31 20:14:23 +0200, Martin Storsjö wrote:
> On Thu, 31 Dec 2015, Janne Grunau wrote:
> 
> >On 2015-12-31 17:00:40 +0200, Martin Storsjö wrote:
> >>On Thu, 31 Dec 2015, Janne Grunau wrote:
> >>
> >>>On 2015-12-31 12:46:39 +0200, Martin Storsjö wrote:
> >>>>Use two separate functions, depending on whether neon is available.
> >>>
> >>>should be neon or vfp
> >>
> >>Ah, yes, so if either NEON or VFPv3 is available (or just check for
> >>VFPv3?).
> >
> >vfp(v2). I don't think is possible to build a CPU without VFP and with
> >NEON (at least using ARM's CPU design). But since it's possible to
> >configure with --disable-vfp --enable-neon the correct check is
> >'cpu_flags & (VFP | NEON)'
> 
> Right, ok.
> 
> Btw, somewhat similar to emms, should we also add a check to see
> that the short vector mode and similar things have been disabled on
> return? (I guess that could be a separate patch later.)

That would be nice to have but less important than emms. There is no 
fixup required since all functions are expected to keep/reset fpscr 
in/to its original state. So we can just check if it is unnmodified.

> >>>>diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
> >>>>index d6f8ffc..2c0bbbe 100644
> >>>>--- a/tests/checkasm/checkasm.c
> >>>>+++ b/tests/checkasm/checkasm.c
> >>>>@@ -53,6 +53,10 @@
> >>>>#define isatty(fd) 1
> >>>>#endif
> >>>>
> >>>>+#if HAVE_ARMV5TE
> >>>>+void (*checkasm_checked_call)(void *func, ...) = 
> >>>>checkasm_checked_call_noneon;
> >>>>+#endif
> >>>>+
> >>>>/* List of tests to invoke */
> >>>>static const struct {
> >>>>    const char *name;
> >>>>@@ -463,6 +467,11 @@ int main(int argc, char *argv[])
> >>>>{
> >>>>    int i, seed, ret = 0;
> >>>>
> >>>>+#if HAVE_ARMV5TE && HAVE_NEON
> >>>>+    if (av_get_cpu_flags() & AV_CPU_FLAG_NEON)
> >>>>+        checkasm_checked_call = checkasm_checked_call_neon;
> >>>>+#endif
> >>>
> >>>I think it would be cleaner to have this in a single ARCH_ARM block here
> >>
> >>Hmm, can you elaborate a little? We need to have at least an ifdef
> >>check for HAVE_NEON (or rather VFPV3) to avoid undefined references
> >>- is there some existing ARCH_ARM block you suggest I should merge
> >>it into?
> >
> >I missed the function pointer definition in the first added
> >'#if HAVE_ARMV5TE' so the comment is mostly void. I still would prefer
> >'#if ARCH_ARM && HAVE_ARMV5TE_EXTERNAL' though.
> 
> That'd be ok, but it'd still require an '&& (HAVE_VFP || HAVE_NEON)'
> or similar, since we can build the general register clobber test as
> long as the baseline is >= armv5te, but not the vfp/neon one. So for
> the cases where we're targeting e.g. armv5/6 but without runtime
> detection, we'd still get the general register clobbering tested.

You could use have_neon/have_vfp from arm/cpu.h and rely on dead code 
elimination like we do in dsp init functions. Not sure which approach is 
nicer. Do as you prefer.

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to