[mcs] Accept and ignore command line args supported by csc that we don't
[mono.git] / mono / utils / mono-hwcap-s390x.c
index 889df8aebf6816896ef5592ed86f2b5ea8d5c768..d5c9d254c3c95cd31648f2e6a44fb66fd1d2e483 100644 (file)
  */
 
 #include "mono/utils/mono-hwcap-s390x.h"
-
 #include <signal.h>
 
-gboolean mono_hwcap_s390x_has_ld = FALSE;
-
-#if defined(MONO_CROSS_COMPILE)
-void
-mono_hwcap_arch_init (void)
-{
-}
-#else
-static void
-catch_sigill (int sig_no, siginfo_t *info, gpointer act)
-{
-       mono_hwcap_s390x_has_ld = FALSE;
-}
+facilityList_t facs;
 
 void
 mono_hwcap_arch_init (void)
 {
-       mono_hwcap_s390x_has_ld = TRUE;
-
-       struct sigaction sa, *old_sa;
-
-       /* Determine if we have a long displacement facility
-        * by executing the STY instruction. If it fails, we
-        * catch the SIGILL and assume the answer is no.
-        */
-       sa.sa_sigaction = catch_sigill;
-       sigemptyset (&sa.sa_mask);
-       sa.sa_flags = SA_SIGINFO;
-
-       sigaction (SIGILL, &sa, old_sa);
-
-       __asm__ __volatile__ (
-               "LGHI\t0,1\n\t"
-               "LA\t1,%0\n\t"
-               ".byte\t0xe3,0x00,0x10,0x00,0x00,0x50\n\t"
-               : "=m" (mono_hwcap_s390x_has_ld)
-               :
-               : "0", "1"
-       );
+       int lFacs = sizeof(facs) / 8;
 
-       sigaction (SIGILL, old_sa, NULL);
+       __asm__ ("      lgfr    0,%1\n"
+                "      .insn   s,0xb2b00000,%0\n"
+                : "=m" (facs) : "r" (lFacs) : "0", "cc");
 }
-#endif
 
 void
 mono_hwcap_print (FILE *f)
 {
-       g_fprintf (f, "mono_hwcap_s390x_has_ld = %i\n", mono_hwcap_s390x_has_ld);
 }