From 6f319004f335567b383bc1b8b0a2af52f038f690 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 7 Jul 2009 18:56:37 -0700 Subject: [PATCH] c: Fix shruw and mulhuw --- orc/opcodes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)") -- 2.7.4