[x264-devel] x86inc: Prefer r14/r15 over r12/r13 on x86-64

Henrik Gramner git at videolan.org
Mon May 22 00:01:03 CEST 2017


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Sat Apr 22 20:30:35 2017 +0200| [e4b0974a4ea3a727f6cc8941e9accf7ef3ba0637] | committer: Henrik Gramner

x86inc: Prefer r14/r15 over r12/r13 on x86-64

Due to a peculiarity in the ModR/M addressing encoding, the r12 and r13
registers sometimes requires an additional byte when used as a base register.

r14 and r15 doesn't have that issue, so prefer using them.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e4b0974a4ea3a727f6cc8941e9accf7ef3ba0637
---

 common/x86/x86inc.asm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/x86/x86inc.asm b/common/x86/x86inc.asm
index 7c146e54..65fb7933 100644
--- a/common/x86/x86inc.asm
+++ b/common/x86/x86inc.asm
@@ -414,10 +414,10 @@ DECLARE_REG 7,  rdi, 64
 DECLARE_REG 8,  rsi, 72
 DECLARE_REG 9,  rbx, 80
 DECLARE_REG 10, rbp, 88
-DECLARE_REG 11, R12, 96
-DECLARE_REG 12, R13, 104
-DECLARE_REG 13, R14, 112
-DECLARE_REG 14, R15, 120
+DECLARE_REG 11, R14, 96
+DECLARE_REG 12, R15, 104
+DECLARE_REG 13, R12, 112
+DECLARE_REG 14, R13, 120
 
 %macro PROLOGUE 2-5+ 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
     %assign num_args %1
@@ -518,10 +518,10 @@ DECLARE_REG 7,  R10, 16
 DECLARE_REG 8,  R11, 24
 DECLARE_REG 9,  rbx, 32
 DECLARE_REG 10, rbp, 40
-DECLARE_REG 11, R12, 48
-DECLARE_REG 12, R13, 56
-DECLARE_REG 13, R14, 64
-DECLARE_REG 14, R15, 72
+DECLARE_REG 11, R14, 48
+DECLARE_REG 12, R15, 56
+DECLARE_REG 13, R12, 64
+DECLARE_REG 14, R13, 72
 
 %macro PROLOGUE 2-5+ ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
     %assign num_args %1



More information about the x264-devel mailing list