From 66cfdc2835f962d72b7bae4275ec78ffb96f16ce Mon Sep 17 00:00:00 2001 From: yulong Date: Sun, 8 Oct 2023 15:49:53 +0800 Subject: [PATCH] Update checker for gnu auto generated test cases --- auto-generated/gnu-api-tests/vcreate.c | 2 +- auto-generated/gnu-api-tests/vget.c | 2 +- auto-generated/gnu-api-tests/vmv.c | 2 +- auto-generated/gnu-api-tests/vreinterpret.c | 2 +- auto-generated/gnu-api-tests/vset.c | 2 +- auto-generated/gnu-overloaded-tests/vget.c | 2 +- auto-generated/gnu-overloaded-tests/vmv.c | 2 +- .../gnu-overloaded-tests/vreinterpret.c | 2 +- auto-generated/gnu-overloaded-tests/vset.c | 2 +- .../policy_funcs/gnu-api-tests/vle16.c | 2 +- .../policy_funcs/gnu-api-tests/vmv.c | 2 +- .../policy_funcs/gnu-overloaded-tests/vle16.c | 2 +- .../policy_funcs/gnu-overloaded-tests/vmv.c | 2 +- .../rvv_intrinsic_gen/generator.py | 39 ++++++++++++++----- 14 files changed, 43 insertions(+), 22 deletions(-) diff --git a/auto-generated/gnu-api-tests/vcreate.c b/auto-generated/gnu-api-tests/vcreate.c index f4e14fb9e..c540b58fa 100644 --- a/auto-generated/gnu-api-tests/vcreate.c +++ b/auto-generated/gnu-api-tests/vcreate.c @@ -910,4 +910,4 @@ vuint64m4x2_t test_vcreate_v_u64m4x2(vuint64m4_t v0, vuint64m4_t v1) { return __riscv_vcreate_v_u64m4x2(v0, v1); } -/* { dg-final { scan-assembler-times {vseti?vli\s+[a-z0-9]+,\s*[a-z0-9]+,\s*e[0-9]+,\s*mf?[1248],\s*t[au],\s*m[au]\s+vcreate\.[ivxfswum.]+\s+} 226 } } */ +/* { dg-final { scan-assembler-times {vl[124]re[0-9]*\.v\s+v[124],0\([a-z0-9]*\)\s+vs[124]r\.+[ivxfswum.]*\s+} 506 } } */ diff --git a/auto-generated/gnu-api-tests/vget.c b/auto-generated/gnu-api-tests/vget.c index 8c6b4b456..9aa22ec7a 100644 --- a/auto-generated/gnu-api-tests/vget.c +++ b/auto-generated/gnu-api-tests/vget.c @@ -1174,4 +1174,4 @@ vuint64m4_t test_vget_v_u64m4x2_u64m4(vuint64m4x2_t src, size_t index) { return __riscv_vget_v_u64m4x2_u64m4(src, 0); } -/* { dg-final { scan-assembler-times {vl[124]re[0-9]*\.v\s+v[124],0\([a-z0-9]*\)\s+vs[124]r\.+[ivxfswum.]*\s+} 292 } } */ +/* { dg-final { scan-assembler-times {vl[124]re[0-9]*\.v\s+v[124],0\([a-z0-9]*\)\s+vs[124]r\.+[ivxfswum.]*\s+} 187 } } */ diff --git a/auto-generated/gnu-api-tests/vmv.c b/auto-generated/gnu-api-tests/vmv.c index af5513c27..288da82e3 100644 --- a/auto-generated/gnu-api-tests/vmv.c +++ b/auto-generated/gnu-api-tests/vmv.c @@ -770,4 +770,4 @@ vuint64m8_t test_vmv_s_x_u64m8(uint64_t src, size_t vl) { return __riscv_vmv_s_x_u64m8(src, vl); } -/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 191 } } */ +/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 218 } } */ diff --git a/auto-generated/gnu-api-tests/vreinterpret.c b/auto-generated/gnu-api-tests/vreinterpret.c index 22bbe3694..d2a2282f0 100644 --- a/auto-generated/gnu-api-tests/vreinterpret.c +++ b/auto-generated/gnu-api-tests/vreinterpret.c @@ -1222,4 +1222,4 @@ vuint64m1_t test_vreinterpret_v_b8_u64m1(vbool8_t src) { return __riscv_vreinterpret_v_b8_u64m1(src); } -/* { dg-final { scan-assembler-times {vs[1248e][r123468]+\.[ivxfswum.]+\s+[,\sa-x0-9()]+} 304 } } */ +/* { dg-final { scan-assembler-times {vs[1248e][r123468]+\.[ivxfswum.]+\s+[,\sa-x0-9()]+} 260 } } */ diff --git a/auto-generated/gnu-api-tests/vset.c b/auto-generated/gnu-api-tests/vset.c index fe80481f2..6afcfb9dd 100644 --- a/auto-generated/gnu-api-tests/vset.c +++ b/auto-generated/gnu-api-tests/vset.c @@ -1174,4 +1174,4 @@ vuint64m4x2_t test_vset_v_u64m4_u64m4x2(vuint64m4x2_t dest, size_t index, vuint6 return __riscv_vset_v_u64m4_u64m4x2(dest, 0, val); } -/* { dg-final { scan-assembler-times {vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)\s+vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)+[ivxfswum.]*\s+} 292 } } */ +/* { dg-final { scan-assembler-times {vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)\s+vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)+[ivxfswum.]*\s+} 66 } } */ diff --git a/auto-generated/gnu-overloaded-tests/vget.c b/auto-generated/gnu-overloaded-tests/vget.c index abf84dfea..6ab49ffb0 100644 --- a/auto-generated/gnu-overloaded-tests/vget.c +++ b/auto-generated/gnu-overloaded-tests/vget.c @@ -1174,4 +1174,4 @@ vuint64m4_t test_vget_v_u64m4x2_u64m4(vuint64m4x2_t src, size_t index) { return __riscv_vget_u64m4(src, 0); } -/* { dg-final { scan-assembler-times {vl[124]re[0-9]*\.v\s+v[124],0\([a-z0-9]*\)\s+vs[124]r\.+[ivxfswum.]*\s+} 292 } } */ +/* { dg-final { scan-assembler-times {vl[124]re[0-9]*\.v\s+v[124],0\([a-z0-9]*\)\s+vs[124]r\.+[ivxfswum.]*\s+} 187 } } */ diff --git a/auto-generated/gnu-overloaded-tests/vmv.c b/auto-generated/gnu-overloaded-tests/vmv.c index 7ec2977a6..651238917 100644 --- a/auto-generated/gnu-overloaded-tests/vmv.c +++ b/auto-generated/gnu-overloaded-tests/vmv.c @@ -418,4 +418,4 @@ uint64_t test_vmv_x_s_u64m8_u64(vuint64m8_t src) { return __riscv_vmv_x(src); } -/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 103 } } */ +/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 130 } } */ diff --git a/auto-generated/gnu-overloaded-tests/vreinterpret.c b/auto-generated/gnu-overloaded-tests/vreinterpret.c index 458e79d9e..33e776e02 100644 --- a/auto-generated/gnu-overloaded-tests/vreinterpret.c +++ b/auto-generated/gnu-overloaded-tests/vreinterpret.c @@ -1222,4 +1222,4 @@ vuint64m1_t test_vreinterpret_v_b8_u64m1(vbool8_t src) { return __riscv_vreinterpret_u64m1(src); } -/* { dg-final { scan-assembler-times {vs[1248e][r123468]+\.[ivxfswum.]+\s+[,\sa-x0-9()]+} 304 } } */ +/* { dg-final { scan-assembler-times {vs[1248e][r123468]+\.[ivxfswum.]+\s+[,\sa-x0-9()]+} 260 } } */ diff --git a/auto-generated/gnu-overloaded-tests/vset.c b/auto-generated/gnu-overloaded-tests/vset.c index 1911be057..87b6e6b85 100644 --- a/auto-generated/gnu-overloaded-tests/vset.c +++ b/auto-generated/gnu-overloaded-tests/vset.c @@ -1174,4 +1174,4 @@ vuint64m4x2_t test_vset_v_u64m4_u64m4x2(vuint64m4x2_t dest, size_t index, vuint6 return __riscv_vset(dest, 0, val); } -/* { dg-final { scan-assembler-times {vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)\s+vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)+[ivxfswum.]*\s+} 292 } } */ +/* { dg-final { scan-assembler-times {vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)\s+vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)+[ivxfswum.]*\s+} 66 } } */ diff --git a/auto-generated/policy_funcs/gnu-api-tests/vle16.c b/auto-generated/policy_funcs/gnu-api-tests/vle16.c index 74b7ce5bf..cc189fcd6 100644 --- a/auto-generated/policy_funcs/gnu-api-tests/vle16.c +++ b/auto-generated/policy_funcs/gnu-api-tests/vle16.c @@ -294,4 +294,4 @@ vuint16m8_t test_vle16_v_u16m8_mu(vbool2_t mask, vuint16m8_t maskedoff, const ui return __riscv_vle16_v_u16m8_mu(mask, maskedoff, base, vl); } -/* { dg-final { scan-assembler-times {vseti?vli\s+[a-z0-9]+,\s*[a-z0-9]+,\s*e[0-9]+,\s*mf?[1248],\s*t[au],\s*m[au]\s+vle16\.[ivxfswum.]+\s+} 52 } } */ +/* { dg-final { scan-assembler-times {vseti?vli\s+[a-z0-9]+,\s*[a-z0-9]+,\s*e[0-9]+,\s*mf?[1248],\s*t[au],\s*m[au]\s+vle16\.[ivxfswum.]+\s+} 78 } } */ diff --git a/auto-generated/policy_funcs/gnu-api-tests/vmv.c b/auto-generated/policy_funcs/gnu-api-tests/vmv.c index 6a10fb985..39a2ca340 100644 --- a/auto-generated/policy_funcs/gnu-api-tests/vmv.c +++ b/auto-generated/policy_funcs/gnu-api-tests/vmv.c @@ -594,4 +594,4 @@ vuint64m8_t test_vmv_s_x_u64m8_tu(vuint64m8_t maskedoff, uint64_t src, size_t vl return __riscv_vmv_s_x_u64m8_tu(maskedoff, src, vl); } -/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 147 } } */ +/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 201 } } */ diff --git a/auto-generated/policy_funcs/gnu-overloaded-tests/vle16.c b/auto-generated/policy_funcs/gnu-overloaded-tests/vle16.c index 682e00e9b..b33f1a25d 100644 --- a/auto-generated/policy_funcs/gnu-overloaded-tests/vle16.c +++ b/auto-generated/policy_funcs/gnu-overloaded-tests/vle16.c @@ -294,4 +294,4 @@ vuint16m8_t test_vle16_v_u16m8_mu(vbool2_t mask, vuint16m8_t maskedoff, const ui return __riscv_vle16_mu(mask, maskedoff, base, vl); } -/* { dg-final { scan-assembler-times {vseti?vli\s+[a-z0-9]+,\s*[a-z0-9]+,\s*e[0-9]+,\s*mf?[1248],\s*t[au],\s*m[au]\s+vle16\.[ivxfswum.]+\s+} 52 } } */ +/* { dg-final { scan-assembler-times {vseti?vli\s+[a-z0-9]+,\s*[a-z0-9]+,\s*e[0-9]+,\s*mf?[1248],\s*t[au],\s*m[au]\s+vle16\.[ivxfswum.]+\s+} 78 } } */ diff --git a/auto-generated/policy_funcs/gnu-overloaded-tests/vmv.c b/auto-generated/policy_funcs/gnu-overloaded-tests/vmv.c index bedfdec1b..a5509687c 100644 --- a/auto-generated/policy_funcs/gnu-overloaded-tests/vmv.c +++ b/auto-generated/policy_funcs/gnu-overloaded-tests/vmv.c @@ -594,4 +594,4 @@ vuint64m8_t test_vmv_s_x_u64m8_tu(vuint64m8_t maskedoff, uint64_t src, size_t vl return __riscv_vmv_s_tu(maskedoff, src, vl); } -/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 147 } } */ +/* { dg-final { scan-assembler-times {v[ml][s]*[ve][0-9]*\.[ivxfswum.]+\s+} 201 } } */ diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py index 7f5c77b75..ed5250b34 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py @@ -141,14 +141,38 @@ def is_support_overloaded(name, **kwargs): # ________________________________ # | vle32 | 63 | # ________________________________ + # | vreinterpret | 260 | + # ________________________________ + # | vget | 187 | + # ________________________________ + # | vset | 66 | + # ________________________________ + # | vcreate | 506 | + # ________________________________ + # | vmv | 218 | + # ________________________________ @staticmethod - def adjust_gnu_api_count(api_count, test_file, has_policy): + def adjust_api_count_for_vle(api_count, test_file, has_policy, is_overloaded): if test_file == "vle8.c": api_count = 62 if has_policy else api_count if test_file == "vle16.c": - api_count = 52 if has_policy else api_count + api_count = 78 if has_policy else api_count if test_file == "vle32.c": api_count = 63 if has_policy else api_count + if test_file == "vreinterpret.c": + api_count = 260 + if test_file == "vget.c": + api_count = 187 + if test_file == "vset.c": + api_count = 66 + if test_file == "vcreate.c": + api_count = 506 + if test_file == "vmv.c": + api_count = 218 + if is_overloaded and not has_policy: + api_count = 130 + if has_policy: + api_count = 201 return api_count @staticmethod @@ -175,7 +199,7 @@ def adjust_gnu_pattern_str(opcode): pattern_str = "vms[gl][et]" elif opcode in ["vmsgeu", "vmsltu"]: pattern_str = "vms[gl][et]u" - elif opcode == "vget": + elif opcode in ["vget", "vcreate"]: pattern_str = r"vl[124]re[0-9]*\.v\s+v[124],0\([a-z0-9]*\)\s+vs[124]r\.+" elif opcode == "vset": pattern_str = r"vl[1248]re[0-9]*\.v\s+v[1248],0\([a-z0-9]*\)\s+" \ @@ -208,11 +232,7 @@ def gen_gnu_dg_pattern_str(opcode, pattern_str, api_count): elif opcode in ["vmv", "vxor", "vsub", "vsbc", "vrsub", "vremu", "vrem", "vor", "vnmsub", "vnmsac", \ "vmul", "vmsne", "vmsltu", "vmslt", "vmsleu", "vmsle", "vmsgtu", "vmsgt", "vmsgeu", \ "vmsge", "vmseq", "vmsbc", "vminu", "vmin", "vmerge", "vmaxu", "vmax", "vmadd", "vmadc", \ - "vmacc", "vdivu", "vdiv", "vand", "vadd", "vadc"]: - return rf"/* {{ dg-final {{ scan-assembler-times {{{pattern_str}\s+}} {api_count} }} }} */" + "\n" - elif opcode == "vget": - return rf"/* {{ dg-final {{ scan-assembler-times {{{pattern_str}\s+}} {api_count} }} }} */" + "\n" - elif opcode == "vset": + "vmacc", "vdivu", "vdiv", "vand", "vadd", "vadc", "vget", "vset", "vcreate"]: return rf"/* {{ dg-final {{ scan-assembler-times {{{pattern_str}\s+}} {api_count} }} }} */" + "\n" else: #pylint: disable=line-too-long @@ -559,10 +579,11 @@ def post_gen(self): api_count = self.fd.read().count("__riscv_") self.fd.close() - api_count = Generator.adjust_gnu_api_count( + api_count = Generator.adjust_api_count_for_vle( api_count, test_file, self.has_tail_policy, + self.is_overloaded, ) opcode = test_file[:-2]