| Summary: | Callee saved registers listed first for AMD64, X86, and PPC architectures | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Ivo Raisr <ivosh> |
| Component: | vex | Assignee: | Ivo Raisr <ivosh> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ivosh, jseward |
| Priority: | NOR | ||
| Version First Reported In: | 3.14 SVN | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| See Also: |
https://bugs.kde.org/show_bug.cgi?id=384337 https://bugs.kde.org/show_bug.cgi?id=384676 |
||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | patch | ||
|
Description
Ivo Raisr
2017-09-11 08:10:16 UTC
Created attachment 107794 [details]
patch
Mostly looks OK to me, except for the bit below:
* why is it in this patch? It's not related to reordering the allocatable
registers for amd64.
* even if necessary, is it really correct? It removes RAX, RCX, RDX and R11
from the list of caller-saved regs, which will surely cause the allocator
not to preserve them across calls. Maybe I misunderstand?
@@ -1460,18 +1460,12 @@ void getRegUsage_AMD64Instr ( HRegUsage* u, const AMD64Instr* i, Bool mode64 )
/* This is a bit subtle. */
/* First off, claim it trashes all the caller-saved regs
which fall within the register allocator's jurisdiction.
- These I believe to be: rax rcx rdx rsi rdi r8 r9 r10 r11
- and all the xmm registers.
- */
- addHRegUse(u, HRmWrite, hregAMD64_RAX());
- addHRegUse(u, HRmWrite, hregAMD64_RCX());
- addHRegUse(u, HRmWrite, hregAMD64_RDX());
- addHRegUse(u, HRmWrite, hregAMD64_RSI());
+ These are: rdi rsi r8 r9 r10 and all the xmm registers. */
addHRegUse(u, HRmWrite, hregAMD64_RDI());
+ addHRegUse(u, HRmWrite, hregAMD64_RSI());
addHRegUse(u, HRmWrite, hregAMD64_R8());
addHRegUse(u, HRmWrite, hregAMD64_R9());
addHRegUse(u, HRmWrite, hregAMD64_R10());
- addHRegUse(u, HRmWrite, hregAMD64_R11());
addHRegUse(u, HRmWrite, hregAMD64_XMM0());
addHRegUse(u, HRmWrite, hregAMD64_XMM1());
addHRegUse(u, HRmWrite, hregAMD64_XMM3());
(In reply to Julian Seward from comment #2) > Mostly looks OK to me, except for the bit below: [..] Following irc chat with Ivo, it seems I misunderstood this part of the patch. Sorry about that. So -- to me it looks fine now. The part with %rax, %rcx, %rdx, %r11 removal from getRegUsage_AMD64Instr() will be removed from the patch. The reason is explained in greater detail in: Bug 384676 - VEX AMD64 backend should list more real registers as available for the register allocator https://bugs.kde.org/show_bug.cgi?id=384676 Committed as 00d4667295a821fef9eb198abcb0c942dffb6045. https://sourceware.org/git/?p=valgrind.git;a=commitdiff;h=00d4667295a821fef9eb198abcb0c942dffb6045 At the end only %r11 was removed from the list in getRegUsage_AMD64Instr() because it's used overall as a temporary register for destination address. %rax, %rcx, %rdx could in theory be used as allocatable but performance measurements did not prove it worthwhile (see bug 384676). |