From: David Schleef Date: Wed, 8 Jul 2009 01:56:37 +0000 (-0700) Subject: c: Fix shruw and mulhuw X-Git-Tag: orc-0.4.2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1a3cc4718f2efd20fbc2eaeae7923af1646cd3a;p=platform%2Fupstream%2Forc.git c: Fix shruw and mulhuw --- diff --git a/orc/opcodes.h b/orc/opcodes.h index 0c74aaf..2e0e738 100644 --- a/orc/opcodes.h +++ b/orc/opcodes.h @@ -43,11 +43,11 @@ BINARY_SW(minsw, "ORC_MIN(%s, %s)") BINARY_UW(minuw, "ORC_MIN(%s, %s)") BINARY_SW(mullw, "(%s * %s) & 0xffff") BINARY_SW(mulhsw, "(%s * %s) >> 16") -BINARY_UW(mulhuw, "(%s * %s) >> 16") +BINARY_UW(mulhuw, "((uint32_t)((uint16_t)%s) * (uint32_t)((uint16_t)%s)) >> 16") BINARY_SW(orw, "%s | %s") BINARY_SW(shlw, "%s << %s") BINARY_SW(shrsw, "%s >> %s") -BINARY_UW(shruw, "%s >> %s") +BINARY_UW(shruw, "((uint16_t)%s) >> %s") UNARY_SW(signw, "ORC_CLAMP(%s,-1,1)") BINARY_SW(subw, "%s - %s") BINARY_SW(subssw, "ORC_CLAMP_SW(%s - %s)")