From 52d800437b252ab4d6c4a68fb8863787f66900ec Mon Sep 17 00:00:00 2001 From: tsukumijima Date: Sat, 23 Oct 2021 07:29:40 +0900 Subject: [PATCH] =?UTF-8?q?CMake=20=E3=81=A7=E3=83=93=E3=83=AB=E3=83=89?= =?UTF-8?q?=E3=81=AB=E5=A4=B1=E6=95=97=E3=81=99=E3=82=8B=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20CMake=20=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=81=AE=E3=83=93=E3=83=AB=E3=83=89=E3=81=A7=E3=81=AF=20Haijin?= =?UTF-8?q?W=20=E7=89=88=E7=94=B1=E6=9D=A5=E3=81=AE=20SIMD=20=E5=AE=9F?= =?UTF-8?q?=E8=A3=85=E3=81=8C=E6=9C=89=E5=8A=B9=E5=8C=96=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aribb25/multi2.h | 4 ++++ aribb25/multi2_simd.h | 2 +- aribb25/td.c | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/aribb25/multi2.h b/aribb25/multi2.h index 0e19776..f05ecd3 100644 --- a/aribb25/multi2.h +++ b/aribb25/multi2.h @@ -20,7 +20,11 @@ typedef struct { int (* clear_scramble_key)(void *m2); int (* encrypt)(void *m2, int32_t type, uint8_t *buf, int32_t size); +#ifdef ENABLE_MULTI2_SIMD int (* decrypt)(void *m2, int32_t type, uint8_t *buf, intptr_t size); +#else + int (* decrypt)(void *m2, int32_t type, uint8_t *buf, int32_t size); +#endif } MULTI2; diff --git a/aribb25/multi2_simd.h b/aribb25/multi2_simd.h index a5c1f2c..807bb30 100644 --- a/aribb25/multi2_simd.h +++ b/aribb25/multi2_simd.h @@ -13,7 +13,7 @@ #include "simd_instruction_type.h" #define USE_MULTI2_INTRINSIC // use intrinsic functions -#define ENABLE_MULTI2_SIMD // enable SIMD instructions +// #define ENABLE_MULTI2_SIMD // enable SIMD instructions #ifdef ENABLE_MULTI2_SIMD diff --git a/aribb25/td.c b/aribb25/td.c index 4d23c90..5ec8537 100644 --- a/aribb25/td.c +++ b/aribb25/td.c @@ -41,7 +41,9 @@ typedef struct { int32_t emm; int32_t verbose; int32_t power_ctrl; +#ifdef ENABLE_MULTI2_SIMD int32_t simd_instruction; +#endif int32_t benchmark; } OPTION; @@ -105,12 +107,14 @@ static void show_usage() _ftprintf(stderr, _T(" -v verbose\n")); _ftprintf(stderr, _T(" 0: silent\n")); _ftprintf(stderr, _T(" 1: show processing status (default)\n")); +#ifdef ENABLE_MULTI2_SIMD _ftprintf(stderr, _T(" -i instruction\n")); _ftprintf(stderr, _T(" 0: use no SIMD instruction\n")); _ftprintf(stderr, _T(" 1: use SSE2 instruction if available\n")); _ftprintf(stderr, _T(" 2: use SSSE3 instruction if available\n")); _ftprintf(stderr, _T(" 3: use AVX2 instruction if available (default)\n")); _ftprintf(stderr, _T(" -b MULTI2 benchmark test for SIMD\n")); +#endif _ftprintf(stderr, _T("\n")); } @@ -123,7 +127,9 @@ static int parse_arg(OPTION *dst, int argc, TCHAR **argv) dst->emm = 0; dst->power_ctrl = 1; dst->verbose = 1; +#ifdef ENABLE_MULTI2_SIMD dst->simd_instruction = 3; +#endif dst->benchmark = 0; for(i=1;isimd_instruction = _ttoi(argv[i]+2); @@ -182,6 +189,7 @@ static int parse_arg(OPTION *dst, int argc, TCHAR **argv) case 'b': dst->benchmark = 1; break; +#endif default: _ftprintf(stderr, _T("error - unknown option '-%c'\n"), argv[i][1]); return argc; @@ -257,11 +265,13 @@ static void test_arib_std_b25(const TCHAR *src, const TCHAR *dst, OPTION *opt) goto LAST; } +#ifdef ENABLE_MULTI2_SIMD code = b25->set_simd_mode(b25, opt->simd_instruction); if(code < 0){ _ftprintf(stderr, _T("error - failed on ARIB_STD_B25::set_simd_mode() : code=%d\n"), code); goto LAST; } +#endif bcas = create_b_cas_card(); if(bcas == NULL){