diff --git a/scripts/march-to-cpu-opt b/scripts/march-to-cpu-opt index 44511eabd7f..0f3f08de2a6 100755 --- a/scripts/march-to-cpu-opt +++ b/scripts/march-to-cpu-opt @@ -103,10 +103,10 @@ def get_vlen(ext_dict): if ext == 'v': vlen = max(vlen, 128) elif (ext.startswith('zvl') and ext[-1] == 'b'): - zvlen = int(arch[3:-1]) + zvlen = int(ext[3:-1]) vlen = max(vlen, zvlen) elif ext.startswith("zve"): - zvelen = int(arch[3:-1]) + zvelen = int(ext[3:-1]) vlen = max(vlen, zvelen) return vlen