Skip to content

Commit

Permalink
Add SHA3 instructions to AArch64 model
Browse files Browse the repository at this point in the history
  • Loading branch information
hanno-becker committed Oct 2, 2024
1 parent 45eaa8c commit d1ec964
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions slothy/targets/aarch64/aarch64_neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2438,19 +2438,37 @@ class mov_d01(AArch64Instruction): # pylint: disable=missing-docstring,invalid-n
inputs = ["Va"]
in_outs=["Vd"]

class AArch64NeonLogical(AArch64Instruction): # pylint: disable=missing-docstring,invalid-name
class SHA3Instruction(AArch64Instruction): # pylint: disable=missing-docstring,invalid-name
pass

class veor(AArch64NeonLogical): # pylint: disable=missing-docstring,invalid-name
pattern = "eor <Vd>.<dt0>, <Va>.<dt1>, <Vb>.<dt2>"
class vrax1(SHA3Instruction): # pylint: disable=missing-docstring,invalid-name
pattern = "rax1 <Vd>.<dt0>, <Va>.<dt1>, <Vb>.<dt2>"
inputs = ["Va", "Vb"]
outputs = ["Vd"]

class veor3(AArch64Instruction): # pylint: disable=missing-docstring,invalid-name
class veor3(SHA3Instruction): # pylint: disable=missing-docstring,invalid-name
pattern = "eor3 <Vd>.<dt0>, <Va>.<dt1>, <Vb>.<dt2>, <Vc>.<dt3>"
inputs = ["Va", "Vb", "Vc"]
outputs = ["Vd"]

class vbcax(SHA3Instruction): # pylint: disable=missing-docstring,invalid-name
pattern = "bcax <Vd>.<dt0>, <Va>.<dt1>, <Vb>.<dt2>, <Vc>.<dt3>"
inputs = ["Va", "Vb", "Vc"]
outputs = ["Vd"]

class vxar(SHA3Instruction): # pylint: disable=missing-docstring,invalid-name
pattern = "xar <Vd>.<dt0>, <Va>.<dt1>, <Vb>.<dt2>, <imm>"
inputs = ["Va", "Vb"]
outputs = ["Vd"]

class AArch64NeonLogical(AArch64Instruction): # pylint: disable=missing-docstring,invalid-name
pass

class veor(AArch64NeonLogical): # pylint: disable=missing-docstring,invalid-name
pattern = "eor <Vd>.<dt0>, <Va>.<dt1>, <Vb>.<dt2>"
inputs = ["Va", "Vb"]
outputs = ["Vd"]

class vbif(AArch64NeonLogical): # pylint: disable=missing-docstring,invalid-name
pattern = "bif <Vd>.<dt0>, <Va>.<dt1>, <Vb>.<dt2>"
inputs = ["Va", "Vb"]
Expand Down

0 comments on commit d1ec964

Please sign in to comment.