diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-01-26 22:59:28 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-01-26 22:59:28 +0000 |
commit | 53fa56e8dc60c8b594f22b888b4fb3c3b0567d82 (patch) | |
tree | 952e37054fb68acdc1139a842e316a015bbf35c9 /lib/Target | |
parent | f26475af976389839c4affdcd2b5ef07ba548a81 (diff) | |
download | external_llvm-53fa56e8dc60c8b594f22b888b4fb3c3b0567d82.zip external_llvm-53fa56e8dc60c8b594f22b888b4fb3c3b0567d82.tar.gz external_llvm-53fa56e8dc60c8b594f22b888b4fb3c3b0567d82.tar.bz2 |
Handle call-clobbered ymm registers on Win64.
The Win64 calling convention has xmm6-15 as callee-saved while still
clobbering all ymm registers.
Add a YMM_HI_6_15 pseudo-register that aliases the clobbered part of the
ymm registers, and mark that as call-clobbered. This allows live xmm
registers across calls.
This hack wouldn't be necessary with RegisterMask operands representing
the call clobbers, but they are not quite operational yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/X86/X86InstrControl.td | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.td | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/X86/X86InstrControl.td b/lib/Target/X86/X86InstrControl.td index e52dcbf..9b167f7 100644 --- a/lib/Target/X86/X86InstrControl.td +++ b/lib/Target/X86/X86InstrControl.td @@ -249,7 +249,7 @@ let isCall = 1, isCodeGenOnly = 1 in let Defs = [RAX, RCX, RDX, R8, R9, R10, R11, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, ST1, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, - XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, EFLAGS], + XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, YMM_HI_6_15, EFLAGS], Uses = [RSP] in { def WINCALL64pcrel32 : Ii32PCRel<0xE8, RawFrm, (outs), (ins i64i32imm_pcrel:$dst, variable_ops), diff --git a/lib/Target/X86/X86RegisterInfo.td b/lib/Target/X86/X86RegisterInfo.td index 5263a49..d98eea3 100644 --- a/lib/Target/X86/X86RegisterInfo.td +++ b/lib/Target/X86/X86RegisterInfo.td @@ -206,6 +206,13 @@ let Namespace = "X86" in { def YMM15: RegisterWithSubRegs<"ymm15", [XMM15]>, DwarfRegAlias<XMM15>; } + // Pseudo-register that aliases the high part of ymm6-ymm15 that is clobbered + // by win64 calls. Doesn't alias the callee-saved xmm6-xmm15. + def YMM_HI_6_15 : Register<"ymmhi-6-15"> { + let Aliases = [YMM6, YMM7, YMM8, YMM9, YMM10, YMM11, YMM12, YMM13, YMM14, + YMM15]; + } + class STRegister<string Name, list<Register> A> : Register<Name> { let Aliases = A; } |