]> git.proxmox.com Git - qemu.git/blobdiff - target-xtensa/op_helper.c
target-xtensa: implement shifts (ST1 and RST1 groups)
[qemu.git] / target-xtensa / op_helper.c
index 0392fbe6bb06b7497411d8aefb2beb95f1c3ced1..c1cfd2ea7bbabf9df4394da087f6ba18cd8f2bfe 100644 (file)
@@ -28,6 +28,7 @@
 #include "cpu.h"
 #include "dyngen-exec.h"
 #include "helpers.h"
+#include "host-utils.h"
 
 #define MMUSUFFIX _mmu
 
@@ -57,3 +58,16 @@ void HELPER(exception)(uint32_t excp)
     env->exception_index = excp;
     cpu_loop_exit(env);
 }
+
+uint32_t HELPER(nsa)(uint32_t v)
+{
+    if (v & 0x80000000) {
+        v = ~v;
+    }
+    return v ? clz32(v) - 1 : 31;
+}
+
+uint32_t HELPER(nsau)(uint32_t v)
+{
+    return v ? clz32(v) : 32;
+}