This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Helper macros for vector shifts. | |
# How to use: | |
# 1) Call macro "vsll_data"/"vsll8_data" in the data segment to define the required constants | |
# 2) Call macro "setup_vsll <VREG>" / "setup_vsll8 <VREG>" in code, passing in one vreg that will hold shift constants | |
# 3) You can now use the following macros: | |
# * "vsll <VREG-DST>, <VREG-SRC>, <QTY>" to perform a left shift from 0 to 7 bits. | |
# * "vsll8 <VREG-DST>, <VREG-SRC>, <QTY>" to perform a left shift from 8 to 15 bits. | |
# * "vsrl <VREG-DST>, <VREG-SRC>, <QTY>" to perform a logical (unsigned) right shift from 0 to 7 bits. | |
# * "vsrl8 <VREG-DST>, <VREG-SRC>, <QTY>" to perform a logical (unsigned) right shift from 8 to 15 bits. | |
# * "vsra <VREG-DST>, <VREG-SRC>, <QTY>" to perform an arithmetic (signed) shift from 0 to 7 bits. |
OlderNewer