Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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), | 63 def NACL_CALL32d : NaClPI32<(outs), (ins i32imm_pcrel:$dst), |
| 64 "naclcall\t$dst">; | 64 "call\t$dst">; |
|
jvoung (off chromium)
2014/10/14 15:30:23
How does this affect the asm parser, if someone wa
Derek Schuff
2014/10/14 23:39:32
I had thought that it would work by making CALLpcr
| |
| 65 def NACL_CALL32r : NaClPI32<(outs), (ins GR32:$dst), | 65 def NACL_CALL32r : NaClPI32<(outs), (ins GR32:$dst), |
| 66 "naclcall\t$dst">; | 66 "naclcall\t$dst">; |
| 67 } | 67 } |
| 68 | 68 |
| 69 // nacltlsaddr32 gets rewritten to: | 69 // nacltlsaddr32 gets rewritten to: |
| 70 // .bundle_align_end | 70 // .bundle_align_end |
| 71 // .bundle_lock | 71 // .bundle_lock |
| 72 // leal\t$sym@TLSGD, %eax | 72 // leal\t$sym@TLSGD, %eax |
| 73 // call\t___tls_get_addr@PLT | 73 // call\t___tls_get_addr@PLT |
| 74 // .bundle_unlock | 74 // .bundle_unlock |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 98 isAsmParserOnly = 1 in { | 98 isAsmParserOnly = 1 in { |
| 99 def NACL_JMP64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP), | 99 def NACL_JMP64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP), |
| 100 "nacljmp\t{$dst, $rZP|$rZP, $dst}">; | 100 "nacljmp\t{$dst, $rZP|$rZP, $dst}">; |
| 101 def NACL_JMP64z : NaClPI64<(outs), (ins GR32:$dst), | 101 def NACL_JMP64z : NaClPI64<(outs), (ins GR32:$dst), |
| 102 "nacljmp\t$dst">; | 102 "nacljmp\t$dst">; |
| 103 } | 103 } |
| 104 | 104 |
| 105 | 105 |
| 106 let isCall = 1, isAsmParserOnly = 1 in { | 106 let isCall = 1, isAsmParserOnly = 1 in { |
| 107 def NACL_CALL64d : NaClPI64<(outs), (ins i32imm_pcrel:$dst), | 107 def NACL_CALL64d : NaClPI64<(outs), (ins i32imm_pcrel:$dst), |
| 108 "naclcall\t$dst">; | 108 "call\t$dst">; |
| 109 def NACL_CALL64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP), | 109 def NACL_CALL64r : NaClPI64<(outs), (ins GR32:$dst, GR64:$rZP), |
| 110 "naclcall\t$dst,$rZP">; | 110 "naclcall\t$dst,$rZP">; |
| 111 } | 111 } |
| 112 | 112 |
| 113 let Defs = [RSP, EFLAGS], Uses = [RSP], isAsmParserOnly = 1 in { | 113 let Defs = [RSP, EFLAGS], Uses = [RSP], isAsmParserOnly = 1 in { |
| 114 def NACL_ASPi8 : NaClPI64<(outs), (ins i64i8imm:$off, GR64:$rZP), | 114 def NACL_ASPi8 : NaClPI64<(outs), (ins i64i8imm:$off, GR64:$rZP), |
| 115 "naclasp{q}\t{$off, $rZP|$rZP, $off}">; | 115 "naclasp{q}\t{$off, $rZP|$rZP, $off}">; |
| 116 | 116 |
| 117 def NACL_ASPi32: NaClPI64<(outs), (ins i64i32imm:$off, GR64:$rZP), | 117 def NACL_ASPi32: NaClPI64<(outs), (ins i64i32imm:$off, GR64:$rZP), |
| 118 "naclasp{q}\t{$off, $rZP|$rZP, $off}">; | 118 "naclasp{q}\t{$off, $rZP|$rZP, $off}">; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 [(brind GR32:$dst)]>, | 180 [(brind GR32:$dst)]>, |
| 181 Requires<[IsNaCl, In64BitMode]>; | 181 Requires<[IsNaCl, In64BitMode]>; |
| 182 } | 182 } |
| 183 | 183 |
| 184 // RSP is marked as a use to prevent stack-pointer assignments that appear | 184 // RSP is marked as a use to prevent stack-pointer assignments that appear |
| 185 // immediately before calls from potentially appearing dead. Uses for argument | 185 // immediately before calls from potentially appearing dead. Uses for argument |
| 186 // registers are added manually. | 186 // registers are added manually. |
| 187 let isCall = 1, Uses = [RSP] in { | 187 let isCall = 1, Uses = [RSP] in { |
| 188 def NACL_CG_CALL64pcrel32 : I<0, Pseudo, (outs), | 188 def NACL_CG_CALL64pcrel32 : I<0, Pseudo, (outs), |
| 189 (ins i32imm_pcrel:$dst), | 189 (ins i32imm_pcrel:$dst), |
| 190 "naclcall\t$dst", []>, | 190 "call\t$dst", []>, |
| 191 Requires<[IsNaCl, In64BitMode]>; | 191 Requires<[IsNaCl, In64BitMode]>; |
| 192 | 192 |
| 193 def NACL_CG_CALL64r : I<0, Pseudo, (outs), (ins GR32:$dst), | 193 def NACL_CG_CALL64r : I<0, Pseudo, (outs), (ins GR32:$dst), |
| 194 "naclcall\t$dst,%r15", | 194 "naclcall\t$dst,%r15", |
| 195 [(X86call GR32:$dst)]>, | 195 [(X86call GR32:$dst)]>, |
| 196 Requires<[IsNaCl, In64BitMode]>; | 196 Requires<[IsNaCl, In64BitMode]>; |
| 197 } | 197 } |
| 198 | 198 |
| 199 def : Pat<(X86call (i32 tglobaladdr:$dst)), | 199 def : Pat<(X86call (i32 tglobaladdr:$dst)), |
| 200 (NACL_CG_CALL64pcrel32 tglobaladdr:$dst)>, | 200 (NACL_CG_CALL64pcrel32 tglobaladdr:$dst)>, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 | 283 |
| 284 let usesCustomInserter = 1, Defs = [EFLAGS] in | 284 let usesCustomInserter = 1, Defs = [EFLAGS] in |
| 285 def NACL_CG_VAARG_64 : I<0, Pseudo, | 285 def NACL_CG_VAARG_64 : I<0, Pseudo, |
| 286 (outs GR32:$dst), | 286 (outs GR32:$dst), |
| 287 (ins i8mem:$ap, i32imm:$size, i8imm:$mode, i32imm:$align), | 287 (ins i8mem:$ap, i32imm:$size, i8imm:$mode, i32imm:$align), |
| 288 "#NACL_VAARG_64 $dst, $ap, $size, $mode, $align", | 288 "#NACL_VAARG_64 $dst, $ap, $size, $mode, $align", |
| 289 [(set GR32:$dst, | 289 [(set GR32:$dst, |
| 290 (X86vaarg64 addr:$ap, imm:$size, imm:$mode, imm:$align)), | 290 (X86vaarg64 addr:$ap, imm:$size, imm:$mode, imm:$align)), |
| 291 (implicit EFLAGS)]>, | 291 (implicit EFLAGS)]>, |
| 292 Requires<[IsNaCl, In64BitMode]>; | 292 Requires<[IsNaCl, In64BitMode]>; |
| OLD | NEW |