1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

cmake SIMD test programs: avoid possible core dumps by catching SIGILL

This commit is contained in:
f4exb 2019-04-23 09:43:07 +02:00
parent af7e95e226
commit 547ee8444f
8 changed files with 56 additions and 0 deletions

View File

@ -1,6 +1,13 @@
#include <signal.h>
#include <immintrin.h> #include <immintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
__m256d x = _mm256_setzero_pd(); __m256d x = _mm256_setzero_pd();
x=_mm256_addsub_pd(x,x); x=_mm256_addsub_pd(x,x);
return 0; return 0;

View File

@ -1,6 +1,13 @@
#include <signal.h>
#include <immintrin.h> #include <immintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
__m256i x = _mm256_setzero_si256(); __m256i x = _mm256_setzero_si256();
x=_mm256_add_epi64 (x,x); x=_mm256_add_epi64 (x,x);
return 0; return 0;

View File

@ -1,7 +1,14 @@
#include <stdint.h> #include <stdint.h>
#include <signal.h>
#include <immintrin.h> #include <immintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
uint64_t x[8] = {0}; uint64_t x[8] = {0};
__m512i y = _mm512_loadu_si512((__m512i*)x); __m512i y = _mm512_loadu_si512((__m512i*)x);
return 0; return 0;

View File

@ -1,6 +1,13 @@
#include <signal.h>
#include <emmintrin.h> #include <emmintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
__m128i x = _mm_setzero_si128(); __m128i x = _mm_setzero_si128();
x=_mm_add_epi64(x,x); x=_mm_add_epi64(x,x);
return 0; return 0;

View File

@ -1,7 +1,14 @@
#include <signal.h>
#include <emmintrin.h> #include <emmintrin.h>
#include <pmmintrin.h> #include <pmmintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
__m128d x = _mm_setzero_pd(); __m128d x = _mm_setzero_pd();
x=_mm_addsub_pd(x,x); x=_mm_addsub_pd(x,x);
return 0; return 0;

View File

@ -1,7 +1,14 @@
#include <signal.h>
#include <emmintrin.h> #include <emmintrin.h>
#include <smmintrin.h> #include <smmintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
__m128i x = _mm_setzero_si128(); __m128i x = _mm_setzero_si128();
__m128i a = _mm_setzero_si128(); __m128i a = _mm_setzero_si128();
__m128i b = _mm_setzero_si128(); __m128i b = _mm_setzero_si128();

View File

@ -1,6 +1,13 @@
#include <signal.h>
#include <nmmintrin.h> #include <nmmintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
unsigned int x=32; unsigned int x=32;
x=_mm_crc32_u8(x,4); x=_mm_crc32_u8(x,4);
return 0; return 0;

View File

@ -1,7 +1,14 @@
#include <signal.h>
#include <emmintrin.h> #include <emmintrin.h>
#include <tmmintrin.h> #include <tmmintrin.h>
void signalHandler(int signum) {
exit(signum); // SIGILL = 4
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
signal(SIGILL, signalHandler);
__m128i x = _mm_setzero_si128(); __m128i x = _mm_setzero_si128();
x=_mm_alignr_epi8(x,x,2); x=_mm_alignr_epi8(x,x,2);
return 0; return 0;