__attribute__((visibility ("hidden")))
mono_hwcap_arch_init ()
{
  struct sigaction sa;
  struct sigaction * old_sa;

  try
    {
      mono_hwcap_s390x_has_ld = 1;
      sa.__sigaction_handler.sa_sigaction = catch_sigill;
      sigemptyset (&sa.sa_mask);
      sa.sa_flags = 4;
      sigaction (4, &sa, old_sa);
      __asm__ __volatile__("LGHI	0,1
	LA	1,%0
	.byte	0xe3,0x00,0x10,0x00,0x00,0x50
	" : "=m" mono_hwcap_s390x_has_ld :  : "1", "0");
      sigaction (4, old_sa, 0B);
    }
  finally
    {
      sa = {CLOBBER};
    }
}


catch_sigill (int sig_no, struct siginfo_t * info, void * act)
{
  mono_hwcap_s390x_has_ld = 0;
}


__attribute__((visibility ("hidden")))
mono_hwcap_print (struct FILE * f)
{
  int mono_hwcap_s390x_has_ld.0;

  mono_hwcap_s390x_has_ld.0 = mono_hwcap_s390x_has_ld;
  monoeg_g_fprintf (f, "mono_hwcap_s390x_has_ld = %i\n", mono_hwcap_s390x_has_ld.0);
}


