Skip to content

Commit

Permalink
1.5.18
Browse files Browse the repository at this point in the history
Address a compatibility issue on some machines with some old CPUs.
Address a compatibility issue of UI on Windows with other languages.
  • Loading branch information
Thomasyse committed May 11, 2020
1 parent 18312fe commit bde420b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
Binary file modified BDMatch/BDMatch.aps
Binary file not shown.
Binary file modified BDMatch/BDMatch.rc
Binary file not shown.
9 changes: 5 additions & 4 deletions BDMatch/MyForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma managed
#include <msclr\marshal_cppstd.h>

#define appversion "1.5.17"
#define appversion "1.5.18"
#define secpurple 45
#define setintnum 5
#define MaxdB 20.0
Expand Down Expand Up @@ -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指令集加速。";
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 ? "调试模式打开。" : "调试模式关闭";
Expand Down
1 change: 1 addition & 0 deletions BDMatch/MyForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Binary file modified BDMatchCore/BDMatchCore.aps
Binary file not shown.
Binary file modified BDMatchCore/BDMatchCore.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion BDMatchCore/BDMatchCoreAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion BDMatchCore/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A simple example of command line usage of BDMatchCore
#include <iostream>
#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;
Expand Down
12 changes: 8 additions & 4 deletions BDMatchCore/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bde420b

Please sign in to comment.