@@ -12,8 +12,8 @@ class ArithmeticOp:
1212 may be required for the operations.
1313 The following operators are covered:
1414 add, sub, mul, neg,
15- add_saturate_s, add_saturate_u ,
16- sub_saturate_s, sub_saturate_u ,
15+ add_sat_s, add_sat_u ,
16+ sub_sat_s, sub_sat_u ,
1717 min_s, min_u, max_s, max_u, avgr_u, abs
1818 """
1919 def __init__ (self , op : str ):
@@ -45,7 +45,7 @@ def _saturate(self, operand1: int, operand2: int, lane: LaneValue) -> int:
4545 """Get the result of saturating arithmetic operation on 2 operands.
4646 The operands can be both signed or unsigned. The following ops
4747 are covered:
48- add_saturate_s, sub_saturate_s, add_saturate_u, sub_saturate_u ,
48+ add_sat_s, sub_sat_s, add_sat_u, sub_sat_u ,
4949
5050 Saturating arithmetic can make sure:
5151 When the operation result is less than the minimum, return the minimum.
@@ -56,7 +56,7 @@ def _saturate(self, operand1: int, operand2: int, lane: LaneValue) -> int:
5656 :param lane: the LaneValue instance of a lane in v128
5757 :return: the result of the saturating arithmetic operation
5858 """
59- if self .op .endswith ('saturate_s ' ):
59+ if self .op .endswith ('sat_s ' ):
6060 if operand1 > lane .max :
6161 operand1 -= lane .mod
6262 if operand2 > lane .max :
@@ -72,7 +72,7 @@ def _saturate(self, operand1: int, operand2: int, lane: LaneValue) -> int:
7272 if value < lane .min :
7373 return lane .min
7474
75- if self .op .endswith ('saturate_u ' ):
75+ if self .op .endswith ('sat_u ' ):
7676 if operand1 < 0 :
7777 operand1 += lane .mod
7878 if operand2 < 0 :
@@ -127,8 +127,8 @@ def binary_op(self, operand1, operand2, lane):
127127
128128 Supported ops:
129129 add, sub, mul,
130- add_saturate_s, add_saturate_u ,
131- sub_saturate_s, sub_saturate_u ,
130+ add_sat_s, add_sat_u ,
131+ sub_sat_s, sub_sat_u ,
132132 min_s, min_u, max_s, max_u, avgr_u
133133
134134 :param operand1: the operand 1, integer or literal string in hex or decimal format
@@ -155,7 +155,7 @@ def binary_op(self, operand1, operand2, lane):
155155 value = v1 - v2
156156 elif self .op == 'mul' :
157157 value = v1 * v2
158- elif 'saturate ' in self .op :
158+ elif 'sat ' in self .op :
159159 value = self ._saturate (v1 , v2 , lane )
160160 if self .op .endswith ('_u' ):
161161 result_signed = False
0 commit comments