summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--orc/opcodes.h6
-rw-r--r--orc/orcemulateopcodes.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/orc/opcodes.h b/orc/opcodes.h
index 568f2d6..350e949 100644
--- a/orc/opcodes.h
+++ b/orc/opcodes.h
@@ -101,8 +101,8 @@ UNARY_WB(convwb, "%s")
UNARY_WB(convhwb, "((orc_uint16)%s)>>8")
UNARY_WB(convssswb, "ORC_CLAMP_SB(%s)")
UNARY_WB(convsuswb, "ORC_CLAMP_UB(%s)")
-UNARY_WB(convusswb, "ORC_CLAMP_SB((orc_uint16)%s)")
-UNARY_WB(convuuswb, "ORC_CLAMP_UB((orc_uint16)%s)")
+UNARY_WB(convusswb, "ORC_MIN((orc_uint16)%s,ORC_SB_MAX)")
+UNARY_WB(convuuswb, "ORC_MIN((orc_uint16)%s,ORC_UB_MAX)")
UNARY_WL(convswl, "%s")
UNARY_WL(convuwl, "(orc_uint16)%s")
@@ -110,7 +110,7 @@ UNARY_LW(convlw, "%s")
UNARY_WB(convhlw, "((orc_uint32)%s)>>16")
UNARY_LW(convssslw, "ORC_CLAMP_SW(%s)")
UNARY_LW(convsuslw, "ORC_CLAMP_UW(%s)")
-UNARY_LW(convusslw, "ORC_CLAMP_SW((orc_uint32)%s)")
+UNARY_LW(convusslw, "ORC_CLAMP((orc_uint32)%s,0,ORC_SW_MAX)")
UNARY_LW(convuuslw, "ORC_CLAMP_UW((orc_uint32)%s)")
UNARY_LQ(convslq, "%s")
diff --git a/orc/orcemulateopcodes.c b/orc/orcemulateopcodes.c
index b524667..fcc1e14 100644
--- a/orc/orcemulateopcodes.c
+++ b/orc/orcemulateopcodes.c
@@ -3462,7 +3462,7 @@ emulate_convusswb (OrcOpcodeExecutor *ex, int offset, int n)
/* 0: loadw */
var32 = ptr4[i];
/* 1: convusswb */
- var33 = ORC_CLAMP_SB((orc_uint16)var32.i);
+ var33 = ORC_MIN((orc_uint16)var32.i,ORC_SB_MAX);
/* 2: storeb */
ptr0[i] = var33;
}
@@ -3486,7 +3486,7 @@ emulate_convuuswb (OrcOpcodeExecutor *ex, int offset, int n)
/* 0: loadw */
var32 = ptr4[i];
/* 1: convuuswb */
- var33 = ORC_CLAMP_UB((orc_uint16)var32.i);
+ var33 = ORC_MIN((orc_uint16)var32.i,ORC_UB_MAX);
/* 2: storeb */
ptr0[i] = var33;
}
@@ -3606,7 +3606,7 @@ emulate_convusslw (OrcOpcodeExecutor *ex, int offset, int n)
/* 0: loadl */
var32 = ptr4[i];
/* 1: convusslw */
- var33.i = ORC_CLAMP_SW((orc_uint32)var32.i);
+ var33.i = ORC_CLAMP((orc_uint32)var32.i,0,ORC_SW_MAX);
/* 2: storew */
ptr0[i] = var33;
}