From 27dee8bcd7b4a53840b60818da8d2c819ef199bd Mon Sep 17 00:00:00 2001 From: Mark Mendell Date: Mon, 1 Dec 2014 19:06:12 -0500 Subject: X86_64 QBE: use RIP addressing Take advantage of RIP addressing in 64 bit mode to improve the code generation for accesses to the constant area as well as packed switches. Avoid computing the address of the start of the method, which is needed in 32 bit mode. To do this, we add a new 'pseudo-register' kRIPReg to minimize the changes needed to get the new addressing mode to be generated. Change-Id: Ia28c93f98b09939806d91ff0bd7392e58996d108 Signed-off-by: Mark Mendell --- compiler/dex/quick/codegen_util.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/dex/quick/codegen_util.cc') diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index 00217549b0..066041c6ad 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -538,9 +538,12 @@ void Mir2Lir::InstallSwitchTables() { bx_offset = tab_rec->anchor->offset + 4; break; case kX86: - case kX86_64: bx_offset = 0; break; + case kX86_64: + // RIP relative to switch table. + bx_offset = tab_rec->offset; + break; case kArm64: case kMips: bx_offset = tab_rec->anchor->offset; -- cgit v1.2.3-59-g8ed1b