Skip to content

Commit

Permalink
Added More Vector Arithmetic Instruction Support (#190)
Browse files Browse the repository at this point in the history
Added support for even more vector arithmetic instructions:
- Vector Single-Width Shift Instructions
- Vector Narrowing Integer Right Shift Instructions
- Vector Single-Width Integer Multiply-Add Instructions
- Vector Widening Integer Multiply-Add Instructions
- Vector Integer Merge Instructions
- Vector Integer Move Instructions
  • Loading branch information
kathlenemagnus authored Aug 1, 2024
1 parent 3313738 commit a318f23
Show file tree
Hide file tree
Showing 16 changed files with 497 additions and 307 deletions.
86 changes: 79 additions & 7 deletions arches/isa_json/gen_uarch_rv64v_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,32 @@
"vwsub.wx" : {"pipe" : "vint", "uop_gen" : "ARITH_WIDE_DEST", "latency" : 1},

# TODO: Vector Integer Arithmetic Instructions: Vector Integer Extension
# TODO: Vector Integer Arithmetic Instructions: Vector Integer Add-with-Carry/Subtract-with-Borrow Instructions
# FIXME: Requires Mavis fix to support correctly
# "vzext.vf2" : {"pipe" : "vint", "uop_gen" : "ARITH_EXT", "latency" : 1},
# "vsext.vf2" : {"pipe" : "vint", "uop_gen" : "ARITH_EXT", "latency" : 1},
# "vzext.vf4" : {"pipe" : "vint", "uop_gen" : "ARITH_EXT", "latency" : 1},
# "vsext.vf4" : {"pipe" : "vint", "uop_gen" : "ARITH_EXT", "latency" : 1},
# "vzext.vf8" : {"pipe" : "vint", "uop_gen" : "ARITH_EXT", "latency" : 1},
# "vsext.vf8" : {"pipe" : "vint", "uop_gen" : "ARITH_EXT", "latency" : 1},

# Vector Integer Arithmetic Instructions: Vector Integer Add-with-Carry/Subtract-with-Borrow Instructions
# FIXME: Requires Mavis fix to include vector mask
"vadc.vvm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vadc.vxm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vadc.vim" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmadc.vvm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmadc.vxm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmadc.vim" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmadc.vv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmadc.vx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmadc.vi" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsbc.vvm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsbc.vxm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmsbc.vvm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmsbc.vxm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmsbc.vv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmsbc.vx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},

# Vector Integer Arithmetic Instructions: Vector Bitwise Logical Instructions
"vand.vv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vand.vx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
Expand All @@ -59,8 +84,25 @@
"vxor.vx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vxor.vi" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},

# TODO: Vector Integer Arithmetic Instructions: Vector Single-Width Shift Instructions
# TODO: Vector Integer Arithmetic Instructions: Vector Narrowing Integer Right Shift Instructions
# Vector Integer Arithmetic Instructions: Vector Single-Width Shift Instructions
"vsll.vv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsll.vx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsll.vi" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsrl.vv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsrl.vx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsrl.vi" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsra.vv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsra.vx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vsra.vi" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},

# Vector Integer Arithmetic Instructions: Vector Narrowing Integer Right Shift Instructions
"vnsrl.wv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vnsrl.wx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vnsrl.wi" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vnsra.wv" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vnsra.wx" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vnsra.wi" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},

# Vector Integer Arithmetic Instructions: Vector Integer Compare Instructions
"vmseq.vv" : {"pipe" : "vint", "uop_gen" : "ARITH_SINGLE_DEST", "latency" : 1},
"vmseq.vx" : {"pipe" : "vint", "uop_gen" : "ARITH_SINGLE_DEST", "latency" : 1},
Expand Down Expand Up @@ -121,10 +163,36 @@
"vwmulsu.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_WIDE_DEST", "latency" : 3},
"vwmulsu.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_WIDE_DEST", "latency" : 3},

# TODO: Vector Integer Arithmetic Instructions: Vector Single-Width Integer Multiply-Add Instructions
# TODO: Vector Integer Arithmetic Instructions: Vector Widening Integer Multiply-Add Instructions
# TODO: Vector Integer Arithmetic Instructions: Vector Integer Merge Instructions
# TODO: Vector Integer Arithmetic Instructions: Vector Integer Move Instructions
# Vector Integer Arithmetic Instructions: Vector Single-Width Integer Multiply-Add Instructions
"vmacc.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},
"vmacc.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},
"vnmsac.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},
"vnmsac.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},
"vmadd.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},
"vmadd.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},
"vnmsub.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},
"vnmsub.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC", "latency" : 3},

# Vector Integer Arithmetic Instructions: Vector Widening Integer Multiply-Add Instructions
"vwmaccu.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC_WIDE_DEST", "latency" : 3},
"vwmaccu.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC_WIDE_DEST", "latency" : 3},
"vwmacc.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC_WIDE_DEST", "latency" : 3},
"vwmacc.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC_WIDE_DEST", "latency" : 3},
"vwmaccsu.vv" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC_WIDE_DEST", "latency" : 3},
"vwmaccsu.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC_WIDE_DEST", "latency" : 3},
"vwmaccus.vx" : {"pipe" : "vmul", "uop_gen" : "ARITH_MAC_WIDE_DEST", "latency" : 3},

# Vector Integer Arithmetic Instructions: Vector Integer Merge Instructions
# FIXME: Requires Mavis fix to include vector mask
"vmerge.vvm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmerge.vxm" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmerge.vim" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},

# Vector Integer Arithmetic Instructions: Vector Integer Move Instructions
"vmv.v.v" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmv.v.x" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},
"vmv.v.i" : {"pipe" : "vint", "uop_gen" : "ARITH", "latency" : 1},

# TODO: Vector Fixed-Point Arithmetic Instructions: Vector Single-Width Saturating Add and Subtract
# TODO: Vector Fixed-Point Arithmetic Instructions: Vector Single-Width Averaging Add and Subtract
# Vector Fixed-Point Arithmetic Instructions: Vector Single-Width Fractional Multiply with Rounding and Saturation
Expand All @@ -133,6 +201,7 @@

# TODO: Vector Fixed-Point Arithmetic Instructions: Vector Single-Width Scaling Shift Instructions
# TODO: Vector Fixed-Point Arithmetic Instructions: Vector Narrowing Fixed-Point Clip Instructions

# TODO: Vector Floating-Point Instructions: Vector Floating-Point Exception Flags
# TODO: Vector Floating-Point Instructions: Vector Single-Width Floating-Point Add/Subtract Instructions
# TODO: Vector Floating-Point Instructions: Vector Widening Floating-Point Add/Subtract Instructions
Expand All @@ -152,10 +221,12 @@
# TODO: Vector Floating-Point Instructions: Single-Width Floating-Point/Integer Type-Convert Instructions
# TODO: Vector Floating-Point Instructions: Widening Floating-Point/Integer Type-Convert Instructions
# TODO: Vector Floating-Point Instructions: Narrowing Floating-Point/Integer Type-Convert Instructions

# TODO: Vector Reduction Operations: Vector Single-Width Integer Reduction Instructions
# TODO: Vector Reduction Operations: Vector Widening Integer Reduction Instructions
# TODO: Vector Reduction Operations: Vector Single-Width Floating-Point Reduction Instructions
# TODO: Vector Reduction Operations: Vector Widening Floating-Point Reduction Instructions

# Vector Mask Instructions: Vector Mask-Register Logical Instructions
"vmandn.mm" : {"pipe" : "vmask", "uop_gen" : "NONE", "latency" : 1},
"vmand.mm" : {"pipe" : "vmask", "uop_gen" : "NONE", "latency" : 1},
Expand All @@ -173,6 +244,7 @@
# TODO: Vector Mask Instructions: vmsof.m set-only-rst mask bit
# TODO: Vector Mask Instructions: Vector Iota Instruction
# TODO: Vector Mask Instructions: Vector Element Index Instruction

# TODO: Vector Permutation Instructions: Integer Scalar Move Instructions
# TODO: Vector Permutation Instructions: Floating-Point Scalar Move Instructions
# TODO: Vector Permutation Instructions: Vector Slide Instructions
Expand Down
Loading

0 comments on commit a318f23

Please sign in to comment.