From bde420ba4bc5e3370c8826b5472e64c09ea095d7 Mon Sep 17 00:00:00 2001 From: Thomasys <31862942+Thomasyse@users.noreply.github.com> Date: Mon, 11 May 2020 03:36:29 -0500 Subject: [PATCH] 1.5.18 Address a compatibility issue on some machines with some old CPUs. Address a compatibility issue of UI on Windows with other languages. --- BDMatch/BDMatch.aps | Bin 161592 -> 161592 bytes BDMatch/BDMatch.rc | Bin 5092 -> 5092 bytes BDMatch/MyForm.cpp | 9 +++++---- BDMatch/MyForm.h | 1 + BDMatchCore/BDMatchCore.aps | Bin 2696 -> 2696 bytes BDMatchCore/BDMatchCore.rc | Bin 4558 -> 4558 bytes BDMatchCore/BDMatchCoreAPI.cpp | 2 +- BDMatchCore/CLI.cpp | 2 +- BDMatchCore/decoder.cpp | 12 ++++++++---- 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/BDMatch/BDMatch.aps b/BDMatch/BDMatch.aps index 9ccf2250090168649f858a8e3e6c6cd5e8f1f2c3..5c99642c83efc6cf2fe339b0e5eb2a505ae75d9b 100644 GIT binary patch delta 45 zcmdn-j&sL5&JBF*oI(t&42%p63__E|+21o-Y-Z<>W@NNzR_1J1=49Ni%*iC02LK8{ B3K9SS delta 45 zcmdn-j&sL5&JBF*oPrFj42%p641$xz+21poZ)WF^W@I#PR_1J1=49Ni%*iC02LK7* B3Jw4O diff --git a/BDMatch/BDMatch.rc b/BDMatch/BDMatch.rc index bc6cf433552ed8a5612d82c1572e16b76f9f91b6..2a68f34371fdef710529036ebf0630635ae56a77 100644 GIT binary patch delta 42 xcmaE&{zQF42M43Yw3auW4FEB44Hf_Z delta 42 xcmaE&{zQF42M441kIj%CXnltDz7)(~=)!lrAdj}&>w3auW4FEA04H5tV diff --git a/BDMatch/MyForm.cpp b/BDMatch/MyForm.cpp index 7d10a56..587f673 100644 --- a/BDMatch/MyForm.cpp +++ b/BDMatch/MyForm.cpp @@ -5,7 +5,7 @@ #pragma managed #include -#define appversion "1.5.17" +#define appversion "1.5.18" #define secpurple 45 #define setintnum 5 #define MaxdB 20.0 @@ -789,7 +789,7 @@ int BDMatch::MyForm::search_ISA() switch (ISA_mode) { case 3: - Result->Text += ":使用AVX、AVX2指令集加速。"; + Result->Text += ":使用AVX、AVX2、FMA指令集加速。"; break; case 2: Result->Text += ":使用SSE2、SSSE3、SSE4.1、AVX指令集加速。"; @@ -825,8 +825,9 @@ int BDMatch::MyForm::match_control(bool val) Subtext->Enabled = val; TVtext->Enabled = val; BDtext->Enabled = val; Subfind->Enabled = val; TVfind->Enabled = val; BDfind->Enabled = val; settings->Enabled = val; - if(val)Match->Text = "匹配"; + if (val)Match->Text = "匹配"; else Match->Text = "停止"; + processing = !val; return 0; } @@ -900,7 +901,7 @@ void BDMatch::MyForm::feedback(const char* input, const long long len) System::Void BDMatch::MyForm::Match_Click(System::Object ^ sender, System::EventArgs ^ e) { using namespace System::Threading::Tasks; - if (Match->Text == "匹配") { + if (!processing) { if (Subtext->Text == "debug mode") { debug_mode = !debug_mode; Result->Text = debug_mode ? "调试模式打开。" : "调试模式关闭"; diff --git a/BDMatch/MyForm.h b/BDMatch/MyForm.h index edf22ef..cd977ac 100644 --- a/BDMatch/MyForm.h +++ b/BDMatch/MyForm.h @@ -57,6 +57,7 @@ namespace BDMatch { unsigned int match_num = 0, fin_match_num = 0, matches_num = 0, fin_matches_num = 0; String^ output_path = ""; bool debug_mode = false; + bool processing = false; System::Threading::CancellationTokenSource^ cancel_source; TaskBar *taskbar; diff --git a/BDMatchCore/BDMatchCore.aps b/BDMatchCore/BDMatchCore.aps index a8ce14d9a9270a04c75a1d29702cf3d1ddb683eb..aa37d47237fc400562c2d9d2aa4f7e06560d8f4b 100644 GIT binary patch delta 35 ncmeAW?GW9d$Hpndz`(!=#6pwJ*}gMcY}RKFW&~2r9IQ+LeZmI_ delta 35 ncmeAW?GW9d$Hpnhz`(!=#DbH}*}gNHZ`NlIW&~2r9IQ+LeSrrA diff --git a/BDMatchCore/BDMatchCore.rc b/BDMatchCore/BDMatchCore.rc index 88edd78a21431659ebf10422fb2d32a8a197da08..276bcfafcb5c7c107688069a3963eca23db86c4e 100644 GIT binary patch delta 42 wcmX@7d`@{o2M43YkIqovCnltDz7))m5)!lrC`vW6Llvj`i04hxk?f?J) diff --git a/BDMatchCore/BDMatchCoreAPI.cpp b/BDMatchCore/BDMatchCoreAPI.cpp index 2a3b64d..f169a49 100644 --- a/BDMatchCore/BDMatchCoreAPI.cpp +++ b/BDMatchCore/BDMatchCoreAPI.cpp @@ -102,7 +102,7 @@ BDMatchCore_API int BDMatchCoreAPI::stop_process() int BDMatchCoreAPI::cal_ISA_mode() { - if (InstructionSet::AVX2() && InstructionSet::AVX())ISA_mode = 3; + if (InstructionSet::AVX2() && InstructionSet::AVX() && InstructionSet::FMA())ISA_mode = 3; else if (InstructionSet::AVX())ISA_mode = 2; else if (InstructionSet::SSE41() && InstructionSet::SSE2() && InstructionSet::SSSE3())ISA_mode = 1; else ISA_mode = 0; diff --git a/BDMatchCore/CLI.cpp b/BDMatchCore/CLI.cpp index 27e3da6..4f525b8 100644 --- a/BDMatchCore/CLI.cpp +++ b/BDMatchCore/CLI.cpp @@ -8,7 +8,7 @@ A simple example of command line usage of BDMatchCore #include #include "headers/BDMatchCore.h" -constexpr const char* version = "1.0.17"; +constexpr const char* version = "1.0.18"; void print(const char* in, const long long len) { std::cout << in; diff --git a/BDMatchCore/decoder.cpp b/BDMatchCore/decoder.cpp index e71246b..bf2ced7 100644 --- a/BDMatchCore/decoder.cpp +++ b/BDMatchCore/decoder.cpp @@ -767,8 +767,10 @@ int Decode::Decode_SSE::FD8(double * inseq, DataStruct::node * outseq) seq2 = _mm_mul_pd(seq2, seq2); __m128d temp = _mm_hadd_pd(seq1, seq2); temp = _mm_log10_pd_cmpt(temp); - temp = _mm_fmsub_pd(temp, const10, const_maxdb); - temp = _mm_fmadd_pd(temp, const_mindb, const127); + temp = _mm_mul_pd(temp, const10); + temp = _mm_sub_pd(temp, const_maxdb); + temp = _mm_mul_pd(temp, const_mindb); + temp = _mm_add_pd(temp, const127); temp = _mm_min_pd(temp, const127); temp = _mm_max_pd(temp, constm128); temp = _mm_round_pd(temp, _MM_FROUND_TO_NEAREST_INT); @@ -819,8 +821,10 @@ int Decode::Decode_AVX::FD8(double * inseq, DataStruct::node * outseq) seq2 = _mm256_mul_pd(seq2, seq2); __m256d temp = _mm256_hadd_pd(seq1, seq2); temp = _mm256_log10_pd_cmpt(temp); - temp = _mm256_fmsub_pd(temp, const10, const_maxdb); - temp = _mm256_fmadd_pd(temp, const_mindb, const127); + temp = _mm256_mul_pd(temp, const10); + temp = _mm256_sub_pd(temp, const_maxdb); + temp = _mm256_mul_pd(temp, const_mindb); + temp = _mm256_add_pd(temp, const127); temp = _mm256_max_pd(temp, constm128); temp = _mm256_min_pd(temp, const127); temp = _mm256_round_pd(temp, _MM_FROUND_TO_NEAREST_INT);