Skip to content

Commit

Permalink
update simd and simd.math
Browse files Browse the repository at this point in the history
  • Loading branch information
HWWH123 committed Jul 23, 2024
1 parent 67f05cc commit e130d67
Show file tree
Hide file tree
Showing 17 changed files with 6,488 additions and 2,306 deletions.
1,737 changes: 1,445 additions & 292 deletions libcxx/include/experimental/simd

Large diffs are not rendered by default.

2,543 changes: 2,543 additions & 0 deletions libcxx/test/std/experimental/simd/simd.math/simd_math.aptest.pass.cpp

Large diffs are not rendered by default.

819 changes: 819 additions & 0 deletions libcxx/test/std/experimental/simd/simd.math/simd_math.pass.cpp

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

#include "simd_math_head.h"

int main()
{
/////////////////////// ACC /////////////////////////////

{
cout << "\n" << "***Erf float***" << "\n" << endl;
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::erf, erf>, vml_test_single<float, float, erf>>(1);
cout << "\n" << "***Erf double***" << "\n" << endl;
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::erf, erf>, vml_test_single<double, double, erf>>(1);
cout << "\n" << "***Erf long double***" << "\n" << endl;
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1);
}

{
cout << "\n" << "***Erfc float***" << "\n" << endl;
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::erfc, erfc>, vml_test_single<float, float, erfc>>(1);
cout << "\n" << "***Erfc double***" << "\n" << endl;
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::erfc, erfc>, vml_test_single<double, double, erfc>>(1);
cout << "\n" << "***Erfc long double***" << "\n" << endl;
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1);
}



/////////////////////// ULP /////////////////////////////

{
cout << "\n" << "***Erf float***" << "\n" << endl;
ulp_test_accuracy_for_single<float, float, double, double, llvm_test_single<float, float, ex::erf, erf>, vml_test_single<double, double, erf>>(1);
cout << "\n" << "***Erf double***" << "\n" << endl;
ulp_test_accuracy_for_single<double, double, long double, long double, llvm_test_single<double, double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1);
cout << "\n" << "***Erf long double***" << "\n" << endl;
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::erf, erf>, vml_test_single<long double, long double, erf>>(1);
}

{
cout << "\n" << "***Erfc float***" << endl;
ulp_test_accuracy_for_single<float, float, double, double, llvm_test_single<float, float, ex::erfc, erfc>, vml_test_single<double, double, erfc>>(1);
cout << "\n" << "***Erfc double***" << endl;
ulp_test_accuracy_for_single<double, double, long double, long double, llvm_test_single<double, double, ex::erfc, erfc>, vml_test_single<long double, long double, erfc>>(1);
cout << "\n" << "***Erfc long double***" << endl;
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::erfc, erfc>, vml_test_single<long double, long double, erfc>>(1);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "simd_math_head.h"


int main()
{
/////////////////////// ACC /////////////////////////////

{
cout << "\n" << "***Exp long double***" << "\n" << endl;
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::exp, exp>, vml_test_single<long double, long double, exp>>(1);
}

{
cout << "\n" << "***Exp2 long double***" << "\n" << endl;
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::exp2, exp2>, vml_test_single<long double, long double, exp2>>(1);
}

{
cout << "\n" << "***Expm1 float***" << "\n" << endl;
test_accuracy_for_single<float, float, llvm_test_single<float, float, ex::expm1, expm1>, vml_test_single<float, float, expm1>>(1);
cout << "\n" << "***Expm1 double***" << "\n" << endl;
test_accuracy_for_single<double, double, llvm_test_single<double, double, ex::expm1, expm1>, vml_test_single<double, double, expm1>>(1);
cout << "\n" << "***Expm1 long double***" << "\n" << endl;
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::expm1, expm1>, vml_test_single<long double, long double, expm1>>(1);
}


/////////////////////// ULP /////////////////////////////


{
cout << "\n" << "***Exp long double***" << "\n" << endl;
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::exp, exp>, vml_test_single<long double, long double, exp>>(1);
}

{
cout << "\n" << "***Exp2 long double***" << "\n" << endl;
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::exp2, exp2>, vml_test_single<long double, long double, exp2>>(1,1);
}

{
cout << "\n" << "***Expm1 float***" << "\n" << endl;
ulp_test_accuracy_for_single<float, float, double, double, llvm_test_single<float, float, ex::expm1, expm1>, vml_test_single<double, double, expm1>>(1);
cout << "\n" << "***Expm1 double***" << "\n" << endl;
ulp_test_accuracy_for_single<double, double, long double, long double, llvm_test_single<double, double, ex::expm1, expm1>, vml_test_single<long double, long double, expm1>>(1);
cout << "\n" << "***Expm1 long double***" << "\n" << endl;
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::expm1, expm1>, vml_test_single<long double, long double, expm1>>(1);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

#include "simd_math_head.h"

int main()
{
/////////////////////// ACC /////////////////////////////

{
cout << "\n" << "***Lgamma float***" << endl;
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::lgamma, lgamma>, vml_test_single<float, float, lgamma>>(1);
cout << "\n" << "***Lgamma double***" << endl;
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::lgamma, lgamma>, vml_test_single<double, double, lgamma>>(1);
cout << "\n" << "***Lgamma long double***" << endl;
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::lgamma, lgamma>, vml_test_single<long double, long double, lgamma>>(1);
}

{
cout << "\n" << "***Tgamma float***" << "\n" << endl;
test_accuracy_for_single<float,float, llvm_test_single<float, float, ex::tgamma, tgamma>, vml_test_single<float, float, tgamma>>(1);
cout << "\n" << "***Tgamma double***" << endl;
test_accuracy_for_single<double,double, llvm_test_single<double, double, ex::tgamma, tgamma>, vml_test_single<double, double, tgamma>>(1);
cout << "\n" << "***Tgamma long double***" << endl;
test_accuracy_for_single<long double, long double, llvm_test_single<long double, long double, ex::tgamma, tgamma>, vml_test_single<long double, long double, tgamma>>(1);
}

/////////////////////// ULP /////////////////////////////


{
cout << "\n" << "***Tgamma float***" << endl;
ulp_test_accuracy_for_single<float,float, double, double, llvm_test_single<float, float, ex::tgamma, tgamma>, vml_test_single<double,double, tgamma>>(1);
cout << "\n" << "***Tgamma double***" << endl;
ulp_test_accuracy_for_single<double,double, long double, long double, llvm_test_single<double, double, ex::tgamma, tgamma>, vml_test_single<long double, long double, tgamma>>(1);
cout << "\n" << "***Tgamma long double***" << endl;
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::tgamma, tgamma>, vml_test_single<long double, long double, tgamma>>(1);
}

{
cout << "\n" << "***Lgamma float***" << endl;
ulp_test_accuracy_for_single<float,float, double,double,llvm_test_single<float, float, ex::lgamma, lgamma>, vml_test_single<double,double, lgamma>>(1);
cout << "\n" << "***Lgamma double***" << endl;
ulp_test_accuracy_for_single<double,double,long double, long double, llvm_test_single<double, double, ex::lgamma, lgamma>, vml_test_single<long double, long double, lgamma>>(1);
cout << "\n" << "***Lgamma long double***" << endl;
ulp_test_accuracy_for_single<long double, long double, long double, long double, llvm_test_single<long double, long double, ex::lgamma, lgamma>, vml_test_single<long double, long double, lgamma>>(1);
}


}
Loading

0 comments on commit e130d67

Please sign in to comment.