Detect AltiVec support on AmigaOS 4
authorChris Young <chris@unsatisfactorysoftware.co.uk>
Fri, 18 Nov 2016 19:03:28 +0000 (19:03 +0000)
committerDRC <information@virtualgl.org>
Fri, 18 Nov 2016 19:03:28 +0000 (13:03 -0600)
simd/jsimd_powerpc.c

index 42dc1e0868ddbd8e7cb2594d4869696d186aa38f..f447bf678889c6c2ae07893d83c5c543c31b14e4 100644 (file)
  * PowerPC architecture.
  */
 
+#ifdef __amigaos4__
+/* This must be defined first as it re-defines GLOBAL otherwise */
+#include <proto/exec.h>
+#endif
+
 #define JPEG_INTERNALS
 #include "../jinclude.h"
 #include "../jpeglib.h"
@@ -116,6 +121,11 @@ init_simd (void)
     if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)
       break;
   }
+#elif defined(__amigaos4__)
+  uint32 altivec = 0;
+  IExec->GetCPUInfoTags(GCIT_VectorUnit, &altivec, TAG_DONE);
+  if(altivec == VECTORTYPE_ALTIVEC)
+    simd_support |= JSIMD_ALTIVEC;
 #endif
 
   /* Force different settings through environment variables */