Patchwork [3/3] target-arm : fix parallel saturated subtraction implementation

login
register
mail settings
Submitter cmchao
Date June 28, 2010, 3:54 p.m.
Message ID <1277740446-8603-4-git-send-email-cmchao@gmail.com>
Download mbox | patch
Permalink /patch/57156/
State New
Headers show

Comments

cmchao - June 28, 2010, 3:54 p.m.
Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
---
 target-arm/helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/target-arm/helper.c b/target-arm/helper.c
index 63e5dc7..2dd64d9 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -2047,7 +2047,7 @@  static inline uint16_t add16_usat(uint16_t a, uint16_t b)
 
 static inline uint16_t sub16_usat(uint16_t a, uint16_t b)
 {
-    if (a < b)
+    if (a > b)
         return a - b;
     else
         return 0;
@@ -2064,7 +2064,7 @@  static inline uint8_t add8_usat(uint8_t a, uint8_t b)
 
 static inline uint8_t sub8_usat(uint8_t a, uint8_t b)
 {
-    if (a < b)
+    if (a > b)
         return a - b;
     else
         return 0;