diff options
author | Sasa Stankovic <Sasa.Stankovic@imgtec.com> | 2014-02-07 17:16:40 +0000 |
---|---|---|
committer | Sasa Stankovic <Sasa.Stankovic@imgtec.com> | 2014-02-07 17:16:40 +0000 |
commit | 24e5f9652aff7fc28bb3855d12e9d7506b384ad6 (patch) | |
tree | f359a846c005da9a27d52f092f0802fc3ce0170a /lib/Target/Mips/MipsCallingConv.td | |
parent | 0732e9437825550e65aab45050423cb87da55850 (diff) | |
download | llvm-24e5f9652aff7fc28bb3855d12e9d7506b384ad6.tar.gz llvm-24e5f9652aff7fc28bb3855d12e9d7506b384ad6.tar.bz2 llvm-24e5f9652aff7fc28bb3855d12e9d7506b384ad6.tar.xz |
[mips] Forbid the use of registers t6, t7 and t8 if the target is NaCl.
Differential Revision: http://llvm-reviews.chandlerc.com/D2694
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsCallingConv.td')
-rw-r--r-- | lib/Target/Mips/MipsCallingConv.td | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Target/Mips/MipsCallingConv.td b/lib/Target/Mips/MipsCallingConv.td index bf7162f224..615310fbf7 100644 --- a/lib/Target/Mips/MipsCallingConv.td +++ b/lib/Target/Mips/MipsCallingConv.td @@ -192,8 +192,15 @@ def CC_Mips_FastCC : CallingConv<[ // Integer arguments are passed in integer registers. All scratch registers, // except for AT, V0 and T9, are available to be used as argument registers. - CCIfType<[i32], CCAssignToReg<[A0, A1, A2, A3, T0, T1, T2, T3, T4, T5, T6, - T7, T8, V1]>>, + CCIfType<[i32], CCIfSubtarget<"isNotTargetNaCl()", + CCAssignToReg<[A0, A1, A2, A3, T0, T1, T2, T3, T4, T5, T6, T7, T8, V1]>>>, + + // In NaCl, T6, T7 and T8 are reserved and not available as argument + // registers for fastcc. T6 contains the mask for sandboxing control flow + // (indirect jumps and calls). T7 contains the mask for sandboxing memory + // accesses (loads and stores). T8 contains the thread pointer. + CCIfType<[i32], CCIfSubtarget<"isTargetNaCl()", + CCAssignToReg<[A0, A1, A2, A3, T0, T1, T2, T3, T4, T5, V1]>>>, // f32 arguments are passed in single-precision floating pointer registers. CCIfType<[f32], CCAssignToReg<[F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, |