This causes detected hardware features to be printed to stdout.
Enables the maximum JIT verbosity for the specified method. This is
very helpfull to diagnose a miscompilation problems of a specific
method.
+.TP
+\fBMONO_VERBOSE_HWCAP\fR
+If set, makes the JIT output information about detected CPU features
+(such as SSE, CMOV, FCMOV, etc) to stdout.
.SH VALGRIND
If you want to use Valgrind, you will find the file `mono.supp'
useful, it contains the suppressions for the GC which trigger
/* TODO: Find a way to detect features like Thumb and VFP. */
#endif
}
+
+void
+mono_hwcap_print(FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_arm_is_v5 = %i\n", mono_hwcap_arm_is_v5);
+ g_fprintf (f, "mono_hwcap_arm_is_v6 = %i\n", mono_hwcap_arm_is_v6);
+ g_fprintf (f, "mono_hwcap_arm_is_v7 = %i\n", mono_hwcap_arm_is_v7);
+ g_fprintf (f, "mono_hwcap_arm_is_v7s = %i\n", mono_hwcap_arm_is_v7s);
+ g_fprintf (f, "mono_hwcap_arm_has_vfp = %i\n", mono_hwcap_arm_has_vfp);
+ g_fprintf (f, "mono_hwcap_arm_has_thumb = %i\n", mono_hwcap_arm_has_thumb);
+ g_fprintf (f, "mono_hwcap_arm_has_thumb2 = %i\n", mono_hwcap_arm_has_thumb2);
+}
* mono-hwcap-$TARGET.c file in Makefile.am.
*/
}
+
+void
+mono_hwcap_print (FILE *f)
+{
+}
{
/* Nothing needed here yet. */
}
+
+void
+mono_hwcap_print (FILE *f)
+{
+}
{
/* Nothing needed here yet. */
}
+
+void
+mono_hwcap_print (FILE *f)
+{
+}
}
#endif
}
+
+void
+mono_hwcap_print (FILE* f)
+{
+ g_fprintf (f, "mono_hwcap_ppc_has_icache_snoop = %i\n", mono_hwcap_ppc_has_icache_snoop);
+ g_fprintf (f, "mono_hwcap_ppc_is_isa_2x = %i\n", mono_hwcap_ppc_is_isa_2x);
+ g_fprintf (f, "mono_hwcap_ppc_is_isa_64 = %i\n", mono_hwcap_ppc_is_isa_64);
+ g_fprintf (f, "mono_hwcap_ppc_has_move_fpr_gpr = %i\n", mono_hwcap_ppc_has_move_fpr_gpr);
+ g_fprintf (f, "mono_hwcap_ppc_has_multiple_ls_units = %i\n", mono_hwcap_ppc_has_multiple_ls_units);
+}
sigaction (SIGILL, old_sa, NULL);
}
+
+void
+mono_hwcap_print (FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_s390x_has_ld = %i\n", mono_hwcap_s390x_has_ld);
+}
mono_hwcap_sparc_is_v9 = strstr (buf, "sparcv9");
}
+
+void
+mono_hwcap_print (FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_sparc_is_v9 = %i\n", mono_hwcap_sparc_is_v9);
+}
mono_hwcap_x86_is_xen = !access ("/proc/xen", F_OK);
#endif
}
+
+void
+mono_hwcap_print (FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_x86_is_xen = %i\n", mono_hwcap_x86_is_xen);
+ g_fprintf (f, "mono_hwcap_x86_has_cmov = %i\n", mono_hwcap_x86_has_cmov);
+ g_fprintf (f, "mono_hwcap_x86_has_fcmov = %i\n", mono_hwcap_x86_has_fcmov);
+ g_fprintf (f, "mono_hwcap_x86_has_sse1 = %i\n", mono_hwcap_x86_has_sse1);
+ g_fprintf (f, "mono_hwcap_x86_has_sse2 = %i\n", mono_hwcap_x86_has_sse2);
+ g_fprintf (f, "mono_hwcap_x86_has_sse3 = %i\n", mono_hwcap_x86_has_sse3);
+ g_fprintf (f, "mono_hwcap_x86_has_ssse3 = %i\n", mono_hwcap_x86_has_ssse3);
+ g_fprintf (f, "mono_hwcap_x86_has_sse41 = %i\n", mono_hwcap_x86_has_sse41);
+ g_fprintf (f, "mono_hwcap_x86_has_sse42 = %i\n", mono_hwcap_x86_has_sse42);
+ g_fprintf (f, "mono_hwcap_x86_has_sse4a = %i\n", mono_hwcap_x86_has_sse4a);
+}
* Copyright 2011-2013 Xamarin Inc
*/
+#include <stdlib.h>
+
#include "mono/utils/mono-hwcap.h"
static gboolean hwcap_inited = FALSE;
void
mono_hwcap_init (void)
{
+ const char *verbose = getenv ("MONO_VERBOSE_HWCAP");
+
if (hwcap_inited)
return;
mono_hwcap_arch_init ();
+
+ if (verbose)
+ mono_hwcap_print (stdout);
}
#ifndef __MONO_UTILS_HWCAP_H__
#define __MONO_UTILS_HWCAP_H__
+#include <stdio.h>
#include <glib.h>
#include "config.h"
/* Implemented in mono-hwcap-$TARGET.c. Do not call. */
void mono_hwcap_arch_init (void) MONO_INTERNAL;
+/* Print detected features to the given file. */
+void mono_hwcap_print (FILE *f) MONO_INTERNAL;
+
/* Please note: If you're going to use the Linux auxiliary vector
* to detect CPU features, don't use any of the constant names in
* the hwcap.h header. This ties us to a particular version of the