diff options
author | Jun FURUSE / 古瀬 淳 <jun.furuse@gmail.com> | 2008-01-28 05:29:20 +0000 |
---|---|---|
committer | Jun FURUSE / 古瀬 淳 <jun.furuse@gmail.com> | 2008-01-28 05:29:20 +0000 |
commit | 3f4a98da0fbf8a87c674d6737d8c6cec7e8567e5 (patch) | |
tree | f5aa13505824d708414ece1f00219b811315c44a /asmcomp/amd64 | |
parent | 30f3fa2c5bc27f8c59930741aa1b6dd5a34a6b40 (diff) | |
download | ocaml-gcaml3090.tar.gz |
3.09.1 updategcaml3090
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gcaml3090@8792 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmcomp/amd64')
-rw-r--r-- | asmcomp/amd64/emit.mlp | 7 | ||||
-rw-r--r-- | asmcomp/amd64/proc.ml | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp index a5ef1dcdd0..74ce9c24ab 100644 --- a/asmcomp/amd64/emit.mlp +++ b/asmcomp/amd64/emit.mlp @@ -534,7 +534,12 @@ let emit_instr fallthrough i = end | Lswitch jumptbl -> let lbl = new_label() in - ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`; + if !pic_code then begin + ` leaq {emit_label lbl}(%rip), %r11\n`; + ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n` + end else begin + ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n` + end; ` .section .rodata\n`; emit_align 8; `{emit_label lbl}:`; diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml index 856e4655a6..0e274b4f4e 100644 --- a/asmcomp/amd64/proc.ml +++ b/asmcomp/amd64/proc.ml @@ -92,6 +92,7 @@ let phys_reg n = let rax = phys_reg 0 let rcx = phys_reg 5 let rdx = phys_reg 4 +let r11 = phys_reg 9 let rxmm15 = phys_reg 115 let stack_slot slot ty = @@ -169,6 +170,7 @@ let destroyed_at_oper = function | Iop(Istore(Single, _)) -> [| rxmm15 |] | Iop(Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)) -> [| rax |] + | Iswitch(_, _) when !pic_code -> [| r11 |] | _ -> [||] let destroyed_at_raise = all_phys_regs |