On 09/08/2016 03:31 PM, Michael Rolnik wrote:
+target_ulong helper_norm(CPUARCState *env, uint32_t src1)
+{
+    if (src1 == 0x00000000 || src1 == 0xffffffff) {
+        return 31;
+    } else {
+        if ((src1 & 0x80000000) == 0x80000000) {
+            src1 = ~src1;
+        }
+        return clz32(src1) - 1;
+    }


This is clrsb32.

+target_ulong helper_normw(CPUARCState *env, uint32_t src1)
+{
+    src1 &= 0xffff;
+
+    if (src1 == 0x0000 || src1 == 0xffff) {
+        return 15;
+    } else {
+        if ((src1 & 0x8000) == 0x8000) {
+            src1 = ~src1 & 0xffff;
+        }
+        return clz32(src1) - 17;
+    }

clrsb32((int16_t)src1) - 16


r~

Reply via email to