From dab167972bb472935ef6b046cf4e9c1f7697a720 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Thu, 14 Dec 2023 13:53:03 +0800 Subject: [PATCH] Fix bad tests --- code/untested.py | 4 ++++ code/vfcvtl_d_s.cpp | 6 +++--- code/xvpickve_w_f.cpp | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/code/untested.py b/code/untested.py index 0188625c..cb3b3cd3 100644 --- a/code/untested.py +++ b/code/untested.py @@ -3,6 +3,10 @@ for f in sorted(glob.glob("*.h")): src = f.replace(".h", ".cpp") + if os.path.exists(src): + # make sure we are testing the expected instruction + if src.split(".")[0] not in open(src, 'r').read(): + print("Bad test:", src) if not os.path.exists(src): if ( src.startswith("xvf") diff --git a/code/vfcvtl_d_s.cpp b/code/vfcvtl_d_s.cpp index f7a67df0..0fb3e690 100644 --- a/code/vfcvtl_d_s.cpp +++ b/code/vfcvtl_d_s.cpp @@ -1,9 +1,9 @@ #include "common.h" -v128 vfcvth_d_s(v128 a) { +v128 vfcvtl_d_s(v128 a) { v128 dst; -#include "vfcvth_d_s.h" +#include "vfcvtl_d_s.h" return dst; } -void test() { FUZZ1(vfcvth_d_s); } +void test() { FUZZ1(vfcvtl_d_s); } diff --git a/code/xvpickve_w_f.cpp b/code/xvpickve_w_f.cpp index 0aae5091..bfcecd25 100644 --- a/code/xvpickve_w_f.cpp +++ b/code/xvpickve_w_f.cpp @@ -1,14 +1,14 @@ #include "common.h" -v256 xvpickve_w(v256 a, int imm) { +v256 xvpickve_w_f(v256 a, int imm) { v256 dst; -#include "xvpickve_w.h" +#include "xvpickve_w_f.h" return dst; } void test() { - XFUZZ1(xvpickve_w, 0); - XFUZZ1(xvpickve_w, 1); - XFUZZ1(xvpickve_w, 2); - XFUZZ1(xvpickve_w, 3); + XFUZZ1(xvpickve_w_f, 0); + XFUZZ1(xvpickve_w_f, 1); + XFUZZ1(xvpickve_w_f, 2); + XFUZZ1(xvpickve_w_f, 3); }