about summary refs log tree commit diff stats
path: root/reproducers
diff options
context:
space:
mode:
Diffstat (limited to 'reproducers')
-rw-r--r--reproducers/issue-1373.c6
-rw-r--r--reproducers/issue-1376.c5
-rw-r--r--reproducers/issue-1377.c30
-rw-r--r--reproducers/issue-1832422.c3
-rw-r--r--reproducers/issue-1861404.c29
-rw-r--r--reproducers/issue-2495.c32
6 files changed, 105 insertions, 0 deletions
diff --git a/reproducers/issue-1373.c b/reproducers/issue-1373.c
new file mode 100644
index 0000000..b9f100e
--- /dev/null
+++ b/reproducers/issue-1373.c
@@ -0,0 +1,6 @@
+void main() {
+    asm("push 512; popfq;");
+    asm("mov rax, 0xffffffff84fdbf24");
+    asm("mov rbx, 0xb197d26043bec15d");
+    asm("adox eax, ebx");
+}
diff --git a/reproducers/issue-1376.c b/reproducers/issue-1376.c
new file mode 100644
index 0000000..8611c95
--- /dev/null
+++ b/reproducers/issue-1376.c
@@ -0,0 +1,5 @@
+void main() {
+    asm("mov rax, 0xa02e698e741f5a6a");
+    asm("mov rbx, 0x20959ddd7a0aef");
+    asm("lsl ax, bx");
+}
diff --git a/reproducers/issue-1377.c b/reproducers/issue-1377.c
new file mode 100644
index 0000000..b6b1309
--- /dev/null
+++ b/reproducers/issue-1377.c
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<sys/mman.h>
+__attribute__((naked,noinline)) void* f(void* dst, void* p) {
+  __asm__(
+    "\n  pushq   %rbp"
+    "\n  movq    %rsp, %rbp"
+    "\n  movq    %rdi, %rax"
+    "\n  movq    $0x0, (%rdi)"
+    "\n  movl    $0x140a, (%rdi)         # imm = 0x140A"
+    "\n  movb    $0x4, 0x5(%rdi)"
+    "\n  cvtps2pd        (%rsi), %xmm0"
+    "\n  movups  %xmm0, 0x8(%rdi)"
+    "\n  cvtps2pd        0x8(%rsi), %xmm0"
+    "\n  movups  %xmm0, 0x18(%rdi)"
+    "\n  popq    %rbp"
+    "\n  retq"
+  );
+}
+int main() {
+  char dst[1000];
+  int page = 4096;
+  char* buf = mmap(NULL, page*2, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+  // mprotect(buf+page, page, 0);
+  
+  float* src = (float*)(buf+0x40);
+  printf("src: %p\n", src);
+  
+  void* r = f(dst, src);
+  printf("res: %p\n", r);
+}
diff --git a/reproducers/issue-1832422.c b/reproducers/issue-1832422.c
new file mode 100644
index 0000000..108b661
--- /dev/null
+++ b/reproducers/issue-1832422.c
@@ -0,0 +1,3 @@
+void main() {
+    asm("cmppd xmm0,xmm0,0xd1");
+}
diff --git a/reproducers/issue-1861404.c b/reproducers/issue-1861404.c
new file mode 100644
index 0000000..c83dbc2
--- /dev/null
+++ b/reproducers/issue-1861404.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <string.h>
+
+#define YMM_SIZE (32) // bytes
+
+void hex_dump(unsigned char *data, unsigned int len) {
+    for(unsigned int i=0; i<len; i++) {
+        printf("%02X ", data[i]);
+    }
+    printf("\n");
+}
+
+void set_ymm0(unsigned char m[YMM_SIZE]) {
+}
+
+void get_ymm0(unsigned char m[YMM_SIZE]) {
+    __asm__ __volatile__ ("vmovdqu %%ymm0, (%0);"::"r"(m):);
+}
+
+int main() {
+    unsigned char src[YMM_SIZE] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f};
+    unsigned char dst[YMM_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+    __asm__ __volatile__ ("vmovdqu (%0), %%ymm0;"::"r"(src):);
+
+    hex_dump(dst, YMM_SIZE);
+
+    return 0;
+}
diff --git a/reproducers/issue-2495.c b/reproducers/issue-2495.c
new file mode 100644
index 0000000..3648c1a
--- /dev/null
+++ b/reproducers/issue-2495.c
@@ -0,0 +1,32 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+uint8_t i_R8[8] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
+uint8_t i_MM0[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+uint8_t o_R8[8];
+
+void __attribute__ ((noinline)) show_state() {
+    printf("R8: ");
+    for (int i = 0; i < 8; i++) {
+        printf("%02x ", o_R8[i]);
+    }
+    printf("\n");
+}
+
+void __attribute__ ((noinline)) run() {
+    __asm__ (
+        ".intel_syntax noprefix\n"
+        "mov r8, qword ptr [rip + i_R8]\n"
+        "movq mm0, qword ptr [rip + i_MM0]\n"
+        ".byte 0x4f, 0x0f, 0x7e, 0xc0\n"
+        "mov qword ptr [rip + o_R8], r8\n"
+        ".att_syntax\n"
+    );
+}
+
+int main(int argc, char **argv) {
+    run();
+    show_state();
+    return 0;
+}