summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.h
diff options
context:
space:
mode:
author Mark Mendell <mark.p.mendell@intel.com> 2015-08-21 09:30:05 -0400
committer Mark Mendell <mark.p.mendell@intel.com> 2015-08-26 11:18:40 -0400
commit73f455ecb76d063846a82735eb80596ceee8cee3 (patch)
tree8cbf4d0b94a2d75980481b4542c021da4477373b /compiler/utils/assembler.h
parent9dc601eb65da0cd5f53172699dacd6e5dd38ab44 (diff)
X86: Assembler support for near labels
The optimizing compiler uses 32 bit relative jumps for all forward jumps, just in case the offset is too large to fit in one byte. Some of the generated code knows that the jumps will in fact fit. Add a 'NearLabel' class to the x86 and x86_64 assemblers. This will be used to generate known short forward branches. Add jecxz/jrcxz instructions, which only handle a short offset. They will be used for intrinsics. Add tests for the new instructions and NearLabel. Change-Id: I11177f36394d35d63b32364b0e6289ee6d97de46 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
Diffstat (limited to 'compiler/utils/assembler.h')
-rw-r--r--compiler/utils/assembler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h
index 3097cd55c0..64d76b881d 100644
--- a/compiler/utils/assembler.h
+++ b/compiler/utils/assembler.h
@@ -53,9 +53,11 @@ namespace mips64 {
}
namespace x86 {
class X86Assembler;
+ class NearLabel;
}
namespace x86_64 {
class X86_64Assembler;
+ class NearLabel;
}
class ExternalLabel {
@@ -126,7 +128,9 @@ class Label {
friend class mips::MipsAssembler;
friend class mips64::Mips64Assembler;
friend class x86::X86Assembler;
+ friend class x86::NearLabel;
friend class x86_64::X86_64Assembler;
+ friend class x86_64::NearLabel;
DISALLOW_COPY_AND_ASSIGN(Label);
};