diff --git a/BDMatch/BDMatch.aps b/BDMatch/BDMatch.aps index 9ccf225..5c99642 100644 Binary files a/BDMatch/BDMatch.aps and b/BDMatch/BDMatch.aps differ diff --git a/BDMatch/BDMatch.rc b/BDMatch/BDMatch.rc index bc6cf43..2a68f34 100644 Binary files a/BDMatch/BDMatch.rc and b/BDMatch/BDMatch.rc differ 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 a8ce14d..aa37d47 100644 Binary files a/BDMatchCore/BDMatchCore.aps and b/BDMatchCore/BDMatchCore.aps differ diff --git a/BDMatchCore/BDMatchCore.rc b/BDMatchCore/BDMatchCore.rc index 88edd78..276bcfa 100644 Binary files a/BDMatchCore/BDMatchCore.rc and b/BDMatchCore/BDMatchCore.rc differ 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);