Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: lib/Target/X86/X86InstrNaCl.td

Issue 647443005: Change usage of naclcall and nacljmp pseudo-instructions to match x86 gas (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: remove NACL_call32d and auto-align bare call Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //====- X86InstrNaCl.td - Describe NaCl Instructions ----*- tablegen -*-===// 1 //====- X86InstrNaCl.td - Describe NaCl Instructions ----*- tablegen -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file describes the modifications to the X86 instruction set needed for 10 // This file describes the modifications to the X86 instruction set needed for
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 def NACL_RET32 : NaClPI32<(outs), (ins), "naclret">; 53 def NACL_RET32 : NaClPI32<(outs), (ins), "naclret">;
54 def NACL_RETI32 : NaClPI32<(outs), (ins i16imm:$amt), "naclreti\t$amt">; 54 def NACL_RETI32 : NaClPI32<(outs), (ins i16imm:$amt), "naclreti\t$amt">;
55 } 55 }
56 56
57 let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1, 57 let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1,
58 isAsmParserOnly = 1 in { 58 isAsmParserOnly = 1 in {
59 def NACL_JMP32r : NaClPI32<(outs), (ins GR32:$dst), "nacljmp\t$dst">; 59 def NACL_JMP32r : NaClPI32<(outs), (ins GR32:$dst), "nacljmp\t$dst">;
60 } 60 }
61 61
62 let isCall = 1, isAsmParserOnly = 1 in { 62 let isCall = 1, isAsmParserOnly = 1 in {
63 def NACL_CALL32d : NaClPI32<(outs), (ins i32imm_pcrel:$dst),
64 "naclcall\t$dst">;
65 def NACL_CALL32r : NaClPI32<(outs), (ins GR32:$dst), 63 def NACL_CALL32r : NaClPI32<(outs), (ins GR32:$dst),
66 "naclcall\t$dst">; 64 "naclcall\t$dst">;
67 } 65 }
68 66
69 // nacltlsaddr32 gets rewritten to: 67 // nacltlsaddr32 gets rewritten to:
70 // .bundle_align_end 68 // .bundle_align_end
71 // .bundle_lock 69 // .bundle_lock
72 // leal\t$sym@TLSGD, %eax 70 // leal\t$sym@TLSGD, %eax
73 // call\t___tls_get_addr@PLT 71 // call\t___tls_get_addr@PLT
74 // .bundle_unlock 72 // .bundle_unlock
(...skipping 23 matching lines...) Expand all
98 isAsmParserOnly = 1 in { 96 isAsmParserOnly = 1 in {
99 def NACL_JMP64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP), 97 def NACL_JMP64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP),
100 "nacljmp\t{$dst, $rZP|$rZP, $dst}">; 98 "nacljmp\t{$dst, $rZP|$rZP, $dst}">;
101 def NACL_JMP64z : NaClPI64<(outs), (ins GR32:$dst), 99 def NACL_JMP64z : NaClPI64<(outs), (ins GR32:$dst),
102 "nacljmp\t$dst">; 100 "nacljmp\t$dst">;
103 } 101 }
104 102
105 103
106 let isCall = 1, isAsmParserOnly = 1 in { 104 let isCall = 1, isAsmParserOnly = 1 in {
107 def NACL_CALL64d : NaClPI64<(outs), (ins i32imm_pcrel:$dst), 105 def NACL_CALL64d : NaClPI64<(outs), (ins i32imm_pcrel:$dst),
108 "naclcall\t$dst">; 106 "call\t$dst">;
jvoung (off chromium) 2014/10/15 00:38:14 Hmm, interesting -- is there no problem w/ this be
Derek Schuff 2014/10/15 17:14:13 No, there doesn't seem to be; I assume that's the
109 def NACL_CALL64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP), 107 def NACL_CALL64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP),
110 "naclcall\t$dst,$rZP">; 108 "naclcall\t$dst,$rZP">;
111 } 109 }
112 110
113 let Defs = [RSP, EFLAGS], Uses = [RSP], isAsmParserOnly = 1 in { 111 let Defs = [RSP, EFLAGS], Uses = [RSP], isAsmParserOnly = 1 in {
114 def NACL_ASPi8 : NaClPI64<(outs), (ins i64i8imm:$off, GR64:$rZP), 112 def NACL_ASPi8 : NaClPI64<(outs), (ins i64i8imm:$off, GR64:$rZP),
115 "naclasp{q}\t{$off, $rZP|$rZP, $off}">; 113 "naclasp{q}\t{$off, $rZP|$rZP, $off}">;
116 114
117 def NACL_ASPi32: NaClPI64<(outs), (ins i64i32imm:$off, GR64:$rZP), 115 def NACL_ASPi32: NaClPI64<(outs), (ins i64i32imm:$off, GR64:$rZP),
118 "naclasp{q}\t{$off, $rZP|$rZP, $off}">; 116 "naclasp{q}\t{$off, $rZP|$rZP, $off}">;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 [(brind GR32:$dst)]>, 178 [(brind GR32:$dst)]>,
181 Requires<[IsNaCl, In64BitMode]>; 179 Requires<[IsNaCl, In64BitMode]>;
182 } 180 }
183 181
184 // RSP is marked as a use to prevent stack-pointer assignments that appear 182 // RSP is marked as a use to prevent stack-pointer assignments that appear
185 // immediately before calls from potentially appearing dead. Uses for argument 183 // immediately before calls from potentially appearing dead. Uses for argument
186 // registers are added manually. 184 // registers are added manually.
187 let isCall = 1, Uses = [RSP] in { 185 let isCall = 1, Uses = [RSP] in {
188 def NACL_CG_CALL64pcrel32 : I<0, Pseudo, (outs), 186 def NACL_CG_CALL64pcrel32 : I<0, Pseudo, (outs),
189 (ins i32imm_pcrel:$dst), 187 (ins i32imm_pcrel:$dst),
190 "naclcall\t$dst", []>, 188 "call\t$dst", []>,
191 Requires<[IsNaCl, In64BitMode]>; 189 Requires<[IsNaCl, In64BitMode]>;
192 190
193 def NACL_CG_CALL64r : I<0, Pseudo, (outs), (ins GR32:$dst), 191 def NACL_CG_CALL64r : I<0, Pseudo, (outs), (ins GR32:$dst),
194 "naclcall\t$dst,%r15", 192 "naclcall\t$dst,%r15",
195 [(X86call GR32:$dst)]>, 193 [(X86call GR32:$dst)]>,
196 Requires<[IsNaCl, In64BitMode]>; 194 Requires<[IsNaCl, In64BitMode]>;
197 } 195 }
198 196
199 def : Pat<(X86call (i32 tglobaladdr:$dst)), 197 def : Pat<(X86call (i32 tglobaladdr:$dst)),
200 (NACL_CG_CALL64pcrel32 tglobaladdr:$dst)>, 198 (NACL_CG_CALL64pcrel32 tglobaladdr:$dst)>,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 281
284 let usesCustomInserter = 1, Defs = [EFLAGS] in 282 let usesCustomInserter = 1, Defs = [EFLAGS] in
285 def NACL_CG_VAARG_64 : I<0, Pseudo, 283 def NACL_CG_VAARG_64 : I<0, Pseudo,
286 (outs GR32:$dst), 284 (outs GR32:$dst),
287 (ins i8mem:$ap, i32imm:$size, i8imm:$mode, i32imm:$align), 285 (ins i8mem:$ap, i32imm:$size, i8imm:$mode, i32imm:$align),
288 "#NACL_VAARG_64 $dst, $ap, $size, $mode, $align", 286 "#NACL_VAARG_64 $dst, $ap, $size, $mode, $align",
289 [(set GR32:$dst, 287 [(set GR32:$dst,
290 (X86vaarg64 addr:$ap, imm:$size, imm:$mode, imm:$align)), 288 (X86vaarg64 addr:$ap, imm:$size, imm:$mode, imm:$align)),
291 (implicit EFLAGS)]>, 289 (implicit EFLAGS)]>,
292 Requires<[IsNaCl, In64BitMode]>; 290 Requires<[IsNaCl, In64BitMode]>;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698