Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Fix pylint errors #339

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions rvv-intrinsic-generator/rvv_intrinsic_gen/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ def __init__(self):
pass

def write(self, text):
return NotImplemented
raise NotImplementedError

def write_title(self, text, link):
return NotImplemented
raise NotImplementedError

def gen_prologue(self):
return NotImplemented
raise NotImplementedError

def inst_group_prologue(self):
return NotImplemented
raise NotImplementedError

def inst_group_epilogue(self):
return NotImplemented
raise NotImplementedError

@abstractmethod
def func(self, inst_info, name, return_type, **kwargs):
Expand All @@ -69,7 +69,7 @@ def function_group(self, template, title, link, op_list, type_list, sew_list,
decorator_list=decorator_list)

def start_group(self, group_name):
return NotImplemented
raise NotImplementedError

@staticmethod
def func_name(name):
Expand Down Expand Up @@ -291,7 +291,7 @@ def report_summary(self):
\x1b[0mfunctions")

def post_gen(self):
return NotImplemented
raise NotImplementedError


class DocGenerator(Generator):
Expand Down Expand Up @@ -446,27 +446,27 @@ def __init__(self, f, is_overloaded, toolchain_type, has_tail_policy):

def write_file_header(self, has_float_type, has_bfloat16_type):
#pylint: disable=line-too-long
int_llvm_header = (r"""// REQUIRES: riscv-registered-target
int_llvm_header = r"""// REQUIRES: riscv-registered-target
// RUN: %clang_cc1 -triple riscv64 -target-feature +v -disable-O0-optnone \
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \
// RUN: FileCheck --check-prefix=CHECK-RV64 %s

""")
float_llvm_header = (r"""// REQUIRES: riscv-registered-target
"""
float_llvm_header = r"""// REQUIRES: riscv-registered-target
// RUN: %clang_cc1 -triple riscv64 -target-feature +v -target-feature +zfh \
// RUN: -target-feature +experimental-zvfh -disable-O0-optnone \
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \
// RUN: FileCheck --check-prefix=CHECK-RV64 %s

""")
bfloat16_llvm_header = (r"""// REQUIRES: riscv-registered-target
"""
bfloat16_llvm_header = r"""// REQUIRES: riscv-registered-target
// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
// RUN: -target-feature +experimental-zvfbfmin \
// RUN: -target-feature +experimental-zvfbfwma -disable-O0-optnone \
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \
// RUN: FileCheck --check-prefix=CHECK-RV64 %s

""")
"""
gnu_header = (
r"""/* { dg-do compile } */
/* { dg-options """ + '"' + "-march=rv64gcv_zvfh -mabi=lp64d" +
Expand Down Expand Up @@ -518,7 +518,8 @@ def func(self, inst_info, name, return_type, **kwargs):
os.path.join(self.folder, test_file_name), mode, encoding="utf-8")

stripped_prefix_non_overloaded_func_name = non_overloaded_func_name[8:]
non_overloaded_func_name = "test_" + stripped_prefix_non_overloaded_func_name
non_overloaded_func_name = "test_" + \
stripped_prefix_non_overloaded_func_name
self.generated_functions_set.add(non_overloaded_func_name)
args = ", ".join(map(lambda a: f"{a[1]} {a[0]}", kwargs.items()))
# "T * name" to "T *name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def render(G, op_list, type_list, sew_list, lmul_list, decorator_list):

type_helper = TypeHelper(**args)

s_op2 = None
if (op in ["mulhsu", "ssra", "sra"] and data_type == "uint") or \
(op in ["ssrl", "srl"] and data_type == "int"):
# Unsigned mulhsu and ssra are unsupported, signed ssrl is unsupported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def render(G, op_list, type_list, sew_list, lmul_list, decorator_list):
break
decorator.write_text_header(G)

inst_type = None
for args in prod(OP=op_list, TYPE=type_list, SEW=sew_list, LMUL=lmul_list):
type_helper = TypeHelper(**args)
if args["OP"] not in ["vundefined"]:
Expand Down
Loading