From a733290359ba1758902fb75f3ccc62ca51e9866d Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 31 Aug 2016 16:47:07 +0000 Subject: [PATCH] arch: bring back clobbers for input operands. This reverts a part of 365e40b. While it is not legal to clobber the output register, it is legal and necessary to do this for inputs, since we do not preserve them, and LLVM could have decided to reuse them. Thanks to @Amanieu for discovering this. --- src/arch/or1k.rs | 2 +- src/arch/x86.rs | 2 +- src/arch/x86_64.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/arch/or1k.rs b/src/arch/or1k.rs index fa48967..ab94d0b 100644 --- a/src/arch/or1k.rs +++ b/src/arch/or1k.rs @@ -156,7 +156,7 @@ pub unsafe fn swap(arg: usize, old_sp: &mut StackPointer, new_sp: &StackPointer, "{r4}" (old_sp) "{r5}" (new_sp) "{r6}" (new_cfa) - :/*"r0", "r1", "r2", "r3", "r4", "r5", "r6",*/"r7", + :/*"r0", "r1", "r2", "r3",*/"r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", diff --git a/src/arch/x86.rs b/src/arch/x86.rs index dbbdd67..3753506 100644 --- a/src/arch/x86.rs +++ b/src/arch/x86.rs @@ -151,7 +151,7 @@ pub unsafe fn swap(arg: usize, old_sp: &mut StackPointer, new_sp: &StackPointer, "{esi}" (old_sp) "{edx}" (new_sp) "{edi}" (new_cfa) - :/*"eax",*/"ebx", "ecx",/*"edx", "esi", "edi", "ebp", "esp",*/ + :/*"eax",*/"ebx", "ecx", "edx", "esi", "edi",/*"ebp", "esp",*/ "mmx0", "mmx1", "mmx2", "mmx3", "mmx4", "mmx5", "mmx6", "mmx7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "cc", "fpsr", "flags", "memory" diff --git a/src/arch/x86_64.rs b/src/arch/x86_64.rs index 7f3cb22..7290951 100644 --- a/src/arch/x86_64.rs +++ b/src/arch/x86_64.rs @@ -153,7 +153,7 @@ pub unsafe fn swap(arg: usize, old_sp: &mut StackPointer, new_sp: &StackPointer, "{rsi}" (old_sp) "{rdx}" (new_sp) "{rcx}" (new_cfa) - : "rax", "rbx", /*"rcx", "rdx", "rsi", "rdi", "rbp", "rsp",*/ + : "rax", "rbx", "rcx", "rdx", "rsi", /*"rdi", "rbp", "rsp",*/ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",