diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py index bb905fb79..8fbadc8e3 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py @@ -55,8 +55,16 @@ def inst_group_epilogue(self): def func(self, inst_info, name, return_type, **kwargs): return NotImplemented - def function_group(self, template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=None): + def function_group(self, + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=None): # pylint: disable=unused-argument # NOTE: 'title' and 'link' are only used in DocGenerator and # OverloadedDocGenerator. Probably need some decoupling here. @@ -342,8 +350,16 @@ def inst_group_epilogue(self): self.write(s) return s - def function_group(self, template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=None): + def function_group(self, + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=None): self.write_title(title, link) if self.has_tail_policy and len(decorator_list) == 0: s = "Intrinsics here don't have a policy variant.\n" @@ -353,8 +369,16 @@ def function_group(self, template, title, link, op_list, type_list, sew_list, self.write("Intrinsics here don't have an overloaded variant.\n") return - super().function_group(template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=description) + super().function_group( + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=description) def func(self, inst_info, name, return_type, **kwargs): name = Generator.func_name(name) @@ -389,7 +413,8 @@ def start_group(self, group_name): def emit_function_group_description(self, description): if description: - self.write(f"{description}\n"); + self.write(f"{description}\n") + class OverloadedDocGenerator(DocGenerator): """ @@ -403,14 +428,30 @@ def write_title(self, text, link): else: self.fd.write("\n[[overloaded-" + link + "]]\n==== " + text + "\n") - def function_group(self, template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=None): + def function_group(self, + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=None): self.do_not_have_overloaded_variant = True for op in op_list: if Generator.is_support_overloaded(op): self.do_not_have_overloaded_variant = False - super().function_group(template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=description) + super().function_group( + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=description) def func(self, inst_info, name, return_type, **kwargs): func_name = Generator.func_name(name) @@ -664,8 +705,16 @@ def post_gen(self): self.fd.write(dg_pattern_str) self.fd.close() - def function_group(self, template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=None): + def function_group(self, + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=None): self.test_file_names = op_list template.render( G=self, @@ -673,7 +722,8 @@ def function_group(self, template, title, link, op_list, type_list, sew_list, type_list=type_list, sew_list=sew_list, lmul_list=lmul_list, - decorator_list=decorator_list, description=description) + decorator_list=decorator_list, + description=description) class Grouper(Generator): @@ -719,8 +769,16 @@ def func(self, inst_info, name, return_type, **kwargs): def query_group_desc(self, func_name): return self.func_group[func_name] - def function_group(self, template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=None): + def function_group(self, + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=None): self.op_list = op_list self.groups[self.current_group].append(title) self.current_sub_group = title @@ -869,12 +927,28 @@ def inst_group_prologue(self): def inst_group_epilogue(self): return "" - def function_group(self, template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=None): + def function_group(self, + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=None): if self.has_tail_policy and len(decorator_list) == 0: return - super().function_group(template, title, link, op_list, type_list, sew_list, - lmul_list, decorator_list, description=description) + super().function_group( + template, + title, + link, + op_list, + type_list, + sew_list, + lmul_list, + decorator_list, + description=description) @staticmethod def is_policy_func(inst_info): diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/inst.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/inst.py index cb969ef28..4acb6701f 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/inst.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/inst.py @@ -237,13 +237,16 @@ def gen(g): #################################################################### g.start_group("Vector Fixed-Point Arithmetic Intrinsics") vxsat_description = "After executing an intrinsic in this section, " + \ - "the `vxsat` CSR assumes an UNSPECIFIED value."; + "the `vxsat` CSR assumes an UNSPECIFIED value." g.function_group( binary_op_template, "Vector Single-Width Saturating Add and Subtract Intrinsics", "vector-single-width-saturating-add-and-subtract", ["sadd", "ssub"], - ITYPES, SEWS, LMULS, decorators.has_masking_maskedoff_policy, + ITYPES, + SEWS, + LMULS, + decorators.has_masking_maskedoff_policy, description=vxsat_description) g.function_group(binary_op_template, @@ -257,7 +260,9 @@ def gen(g): "Vector Single-Width Fractional Multiply with Rounding and Saturation" + "Intrinsics", "vector-single-width-fractional-multiply-with-rounding-and-" + - "saturation", ["smul"], ["int"], SEWS, LMULS, + "saturation", ["smul"], ["int"], + SEWS, + LMULS, decorators.has_masking_maskedoff_policy_vxrm, description=vxsat_description) @@ -267,11 +272,15 @@ def gen(g): ITYPES, SEWS, LMULS, decorators.has_masking_maskedoff_policy_vxrm) - g.function_group(binary_nop_template, - "Vector Narrowing Fixed-Point Clip Intrinsics", - "vector-narrowing-fixed-point-clip", ["nclip"], ITYPES, - WSEWS, WLMULS, decorators.has_masking_maskedoff_policy_vxrm, - description=vxsat_description) + g.function_group( + binary_nop_template, + "Vector Narrowing Fixed-Point Clip Intrinsics", + "vector-narrowing-fixed-point-clip", ["nclip"], + ITYPES, + WSEWS, + WLMULS, + decorators.has_masking_maskedoff_policy_vxrm, + description=vxsat_description) #################################################################### g.start_group("Vector Floating-Point Intrinsics") diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_intcarry_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_intcarry_template.py index 5e4881af0..12143face 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_intcarry_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_intcarry_template.py @@ -26,7 +26,8 @@ from enums import InstType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_nop_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_nop_template.py index 905666f74..1ca61715e 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_nop_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_nop_template.py @@ -32,7 +32,8 @@ def must_int_type(**kargs): # narrowing op template -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_op_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_op_template.py index d126537ac..0f356f962 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_op_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_op_template.py @@ -28,7 +28,8 @@ from enums import ExtraAttr -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_wop_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_wop_template.py index 4b840d02d..3e68d3c8c 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_wop_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/binary_wop_template.py @@ -26,7 +26,8 @@ from enums import InstType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cmp_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cmp_template.py index 410a709fb..61361648f 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cmp_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cmp_template.py @@ -26,7 +26,8 @@ from enums import InstType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cvt_op_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cvt_op_template.py index ab3da1d23..eee862dd6 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cvt_op_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/cvt_op_template.py @@ -28,7 +28,8 @@ from constants import ITYPES -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name, unused-argument # FIXME: Renaming 'G' to 'g' all in once later. # FIXME: Argument 'type_list' is unused but required for interface diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/get_set_diff_lmul_op_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/get_set_diff_lmul_op_template.py index bef8f07f6..06e980d0d 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/get_set_diff_lmul_op_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/get_set_diff_lmul_op_template.py @@ -50,7 +50,8 @@ def vset_constraint(**kargs): and int(kargs["LMUL"]) > int(kargs["SRC_LMUL"]) -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/load_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/load_template.py index 683ae16e1..574e0d882 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/load_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/load_template.py @@ -29,7 +29,8 @@ from enums import ExtraAttr -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mac_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mac_template.py index e258480e1..490695b67 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mac_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mac_template.py @@ -27,7 +27,8 @@ from enums import ExtraAttr -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_load_store_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_load_store_template.py index d426732c7..7981a07e3 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_load_store_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_load_store_template.py @@ -26,7 +26,8 @@ from enums import InstType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name, unused-argument # FIXME: Renaming 'G' to 'g' all in once later. # FIXME: Argument 'lmul_list' is unused but required for interface diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_template.py index 20997c508..8baed1b5a 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/mask_template.py @@ -25,7 +25,8 @@ from enums import InstType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/misc_op_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/misc_op_template.py index 66153e9c1..fd36bc3d3 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/misc_op_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/misc_op_template.py @@ -30,7 +30,8 @@ from generator import CompatibleHeaderGenerator -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/permute_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/permute_template.py index 4f8a00be6..ca0de2f30 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/permute_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/permute_template.py @@ -26,7 +26,8 @@ from enums import InstType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reduction_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reduction_template.py index 20fbf44cc..3f61bf497 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reduction_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reduction_template.py @@ -27,7 +27,8 @@ from enums import ExtraAttr -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reint_op_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reint_op_template.py index 8c78e5528..a2e653880 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reint_op_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/reint_op_template.py @@ -27,7 +27,8 @@ from generator import CompatibleHeaderGenerator -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name, unused-argument # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_load_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_load_template.py index 93de5585d..9e52fd0f8 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_load_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_load_template.py @@ -32,7 +32,8 @@ from generator import CompatibleHeaderGenerator -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_store_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_store_template.py index 3cb32c427..4ea46f031 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_store_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/seg_store_template.py @@ -32,7 +32,8 @@ from generator import CompatibleHeaderGenerator -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/setvl_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/setvl_template.py index 64c9286aa..43d2f3691 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/setvl_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/setvl_template.py @@ -25,7 +25,8 @@ from enums import InstType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name, unused-argument # FIXME: Renaming 'G' to 'g' all in once later. # FIXME: Argument 'type_list', 'decorator_list' is unused but required for diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/store_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/store_template.py index 6f299e299..524cf1134 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/store_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/store_template.py @@ -28,7 +28,8 @@ from enums import MemType -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/unary_op_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/unary_op_template.py index 41023c94e..e69752b5c 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/unary_op_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/unary_op_template.py @@ -28,7 +28,8 @@ import copy -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description) diff --git a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/vector_crypto_template.py b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/vector_crypto_template.py index 60c866805..429269e29 100644 --- a/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/vector_crypto_template.py +++ b/rvv-intrinsic-generator/rvv_intrinsic_gen/templates/vector_crypto_template.py @@ -74,7 +74,8 @@ def has_rs1_input(name): return name in has_rs1_input_inst_set -def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, description): +def render(G, op_list, type_list, sew_list, lmul_list, decorator_list, + description): #pylint: disable=invalid-name # FIXME: Renaming 'G' to 'g' all in once later. G.emit_function_group_description(description)