formatting

This commit is contained in:
JanLJL
2022-08-29 11:30:46 +02:00
parent 671f7f5591
commit 76542782c8
2 changed files with 23 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from collections import OrderedDict, defaultdict from collections import defaultdict
from fractions import Fraction from fractions import Fraction
@@ -42,7 +42,9 @@ class EntryBuilder:
description += ' scale: "*"\n' description += ' scale: "*"\n'
else: else:
if "{k}" in ot: if "{k}" in ot:
description += " - class: register\n name: {}\n mask: True\n".format(ot.replace("{k}", "")) description += " - class: register\n name: {}\n mask: True\n".format(
ot.replace("{k}", "")
)
else: else:
description += " - class: register\n name: {}\n".format(ot) description += " - class: register\n name: {}\n".format(ot)
@@ -107,15 +109,13 @@ class EntryBuilderIntelPort9(EntryBuilder):
port_pressure = port_pressure + [[1, "79"], [1, "48"]] port_pressure = port_pressure + [[1, "79"], [1, "48"]]
operands = ["mem" if o == "mem" else o for o in operand_types] operands = ["mem" if o == "mem" else o for o in operand_types]
latency += 0 latency += 0
return ( return EntryBuilder.build_description(
EntryBuilder.build_description( self,
self, instruction_name,
instruction_name, operands,
operands, port_pressure,
port_pressure, latency,
latency, "with store",
"with store",
)
) )
# Register only: # Register only:
@@ -132,9 +132,7 @@ def get_description(instruction_form, port_pressure, latency, rhs_comment=None):
commented_entry = "" commented_entry = ""
for line in entry.split("\n"): for line in entry.split("\n"):
commented_entry += ("{:<" + str(max_length) + "} # {}\n").format( commented_entry += ("{:<" + str(max_length) + "} # {}\n").format(line, rhs_comment)
line, rhs_comment
)
entry = commented_entry entry = commented_entry
return entry return entry

View File

@@ -126,15 +126,13 @@ class MOVEntryBuilderIntelPort9(MOVEntryBuilder):
port_pressure = port_pressure + [[1, "79"], [1, "48"]] port_pressure = port_pressure + [[1, "79"], [1, "48"]]
operands = ["mem" if o == "mem" else o for o in operand_types] operands = ["mem" if o == "mem" else o for o in operand_types]
latency += 0 latency += 0
return ( return MOVEntryBuilder.build_description(
MOVEntryBuilder.build_description( self,
self, instruction_name,
instruction_name, operands,
operands, port_pressure,
port_pressure, latency,
latency, "with store",
"with store",
)
) )
# Register only: # Register only:
@@ -243,7 +241,7 @@ icx_mov_instructions = [
("vmovdqa64 zmm zmm", ("1*p05", 1)), ("vmovdqa64 zmm zmm", ("1*p05", 1)),
("vmovdqa64 mem zmm", ("", 0)), ("vmovdqa64 mem zmm", ("", 0)),
("vmovdqa64 zmm mem", ("", 0)), ("vmovdqa64 zmm mem", ("", 0)),
# https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64 # https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64
("movdqu xmm xmm", ("1*p015", 1)), ("movdqu xmm xmm", ("1*p015", 1)),
("movdqu mem xmm", ("", 0)), ("movdqu mem xmm", ("", 0)),
("movdqu xmm mem", ("", 0)), ("movdqu xmm mem", ("", 0)),
@@ -330,9 +328,9 @@ icx_mov_instructions = [
("vmovntdq zmm mem", ("", 0)), # TODO NT-store: what latency to use? ("vmovntdq zmm mem", ("", 0)), # TODO NT-store: what latency to use?
# https://www.felixcloutier.com/x86/movntdqa # https://www.felixcloutier.com/x86/movntdqa
("movntdqa mem xmm", ("", 0)), # TODO NT-store: what latency to use? ("movntdqa mem xmm", ("", 0)), # TODO NT-store: what latency to use?
("vmovntdqa mem xmm", ("", 0)), # TODO NT-store: what latency to use? ("vmovntdqa mem xmm", ("", 0)), # TODO NT-store: what latency to use?
("vmovntdqa mem ymm", ("", 0)), # TODO NT-store: what latency to use? ("vmovntdqa mem ymm", ("", 0)), # TODO NT-store: what latency to use?
("vmovntdqa mem zmm", ("", 0)), # TODO NT-store: what latency to use? ("vmovntdqa mem zmm", ("", 0)), # TODO NT-store: what latency to use?
# https://www.felixcloutier.com/x86/movnti # https://www.felixcloutier.com/x86/movnti
("movnti gpr mem", ("", 0)), # TODO NT-store: what latency to use? ("movnti gpr mem", ("", 0)), # TODO NT-store: what latency to use?
# https://www.felixcloutier.com/x86/movntpd # https://www.felixcloutier.com/x86/movntpd