Permalink
Browse files

Removed lots of code from the old native code backend that the new on…

…e does not need

This includes options for dumping intermediate data as well es the data
structures used to represent that data.  In particular Mach and
Linearize are replaced by a variante used for generating LLVM IR.  Any
code used for register allocation as well as a lot of amd64-specific
code are removed completely.
  • Loading branch information...
colinbenner committed Mar 1, 2012
1 parent 2cbc262 commit ecf488c6a8351091aed20cbfdf39728d21b92435
Showing with 1,351 additions and 8,521 deletions.
  1. +2 −78 src/asmcomp/amd64/arch.ml
  2. +14 −735 src/asmcomp/amd64/emit.mlp
  3. +0 −179 src/asmcomp/amd64/proc.ml
  4. +0 −211 src/asmcomp/amd64/proc_nt.ml
  5. +0 −127 src/asmcomp/amd64/reload.ml
  6. +0 −20 src/asmcomp/amd64/scheduling.ml
  7. +0 −235 src/asmcomp/amd64/selection.ml
  8. +36 −65 src/asmcomp/asmgen.ml
  9. +4 −0 src/asmcomp/asmgen.mli
  10. +4 −9 src/asmcomp/asmlink.ml
  11. +35 −0 src/asmcomp/aux.ml
  12. +1 −1 src/asmcomp/cmmgen.ml
  13. +0 −278 src/asmcomp/coloring.ml
  14. +0 −17 src/asmcomp/coloring.mli
  15. +0 −90 src/asmcomp/comballoc.ml
  16. +0 −17 src/asmcomp/comballoc.mli
  17. +0 −802 src/asmcomp/emit.ml
  18. +6 −5 src/asmcomp/emit.mli
  19. +34 −162 src/asmcomp/{llvmemit.ml → emit_common.ml}
  20. +5 −6 src/asmcomp/{llvmemit.mli → emit_common.mli}
  21. +11 −11 src/asmcomp/emitaux.ml
  22. +0 −173 src/asmcomp/interf.ml
  23. +0 −18 src/asmcomp/interf.mli
  24. +0 −187 src/asmcomp/interval.ml
  25. +0 −35 src/asmcomp/interval.mli
  26. +386 −232 src/asmcomp/linearize.ml
  27. +30 −37 src/asmcomp/linearize.mli
  28. +0 −192 src/asmcomp/linscan.ml
  29. +0 −16 src/asmcomp/linscan.mli
  30. +0 −120 src/asmcomp/liveness.ml
  31. +0 −20 src/asmcomp/liveness.mli
  32. +0 −90 src/asmcomp/llvm_aux.ml
  33. +0 −13 src/asmcomp/llvm_aux.mli
  34. +0 −397 src/asmcomp/llvm_linearize.ml
  35. +0 −45 src/asmcomp/llvm_linearize.mli
  36. +0 −163 src/asmcomp/llvm_mach.ml
  37. +0 −102 src/asmcomp/llvm_mach.mli
  38. +0 −456 src/asmcomp/llvm_selectgen.ml
  39. +0 −38 src/asmcomp/llvmcompile.ml
  40. +0 −20 src/asmcomp/llvmcompile.mli
  41. +85 −105 src/asmcomp/mach.ml
  42. +38 −78 src/asmcomp/mach.mli
  43. +0 −77 src/asmcomp/printlinear.ml
  44. +0 −21 src/asmcomp/printlinear.mli
  45. +36 −0 src/asmcomp/printlinearize.ml
  46. +69 −228 src/asmcomp/printmach.ml
  47. +0 −32 src/asmcomp/printmach.mli
  48. +0 −34 src/asmcomp/proc.mli
  49. +67 −150 src/asmcomp/reg.ml
  50. +48 −57 src/asmcomp/reg.mli
  51. +0 −17 src/asmcomp/reload.mli
  52. +0 −140 src/asmcomp/reloadgen.ml
  53. +0 −26 src/asmcomp/reloadgen.mli
  54. +0 −356 src/asmcomp/schedgen.ml
  55. +0 −46 src/asmcomp/schedgen.mli
  56. +0 −17 src/asmcomp/scheduling.mli
  57. +440 −834 src/asmcomp/selectgen.ml
  58. +0 −80 src/asmcomp/selectgen.mli
  59. +0 −18 src/asmcomp/selection.mli
  60. +0 −402 src/asmcomp/spill.ml
  61. +0 −18 src/asmcomp/spill.mli
  62. +0 −210 src/asmcomp/split.ml
  63. +0 −17 src/asmcomp/split.mli
  64. +0 −93 src/driver/main_args.ml
  65. +0 −24 src/driver/main_args.mli
  66. +0 −12 src/driver/optmain.ml
  67. +0 −14 src/utils/clflags.ml
  68. +0 −13 src/utils/clflags.mli
View
@@ -22,27 +22,6 @@ let command_line_options =
"-fno-PIC", Arg.Clear pic_code,
" Generate position-dependent machine code" ]
-(* Specific operations for the AMD64 processor *)
-
-open Format
-
-type addressing_mode =
- Ibased of string * int (* symbol + displ *)
- | Iindexed of int (* reg + displ *)
- | Iindexed2 of int (* reg + reg + displ *)
- | Iscaled of int * int (* reg * scale + displ *)
- | Iindexed2scaled of int * int (* reg + reg * scale + displ *)
-
-type specific_operation =
- Ilea of addressing_mode (* "lea" gives scaled adds *)
- | Istore_int of nativeint * addressing_mode (* Store an integer constant *)
- | Istore_symbol of string * addressing_mode (* Store a symbol *)
- | Ioffset_loc of int * addressing_mode (* Add a constant to a location *)
- | Ifloatarithmem of float_operation * addressing_mode
- (* Float arith operation with memory *)
-and float_operation =
- Ifloatadd | Ifloatsub | Ifloatmul | Ifloatdiv
-
(* Sizes, endianness *)
let big_endian = false
@@ -51,61 +30,6 @@ let size_addr = 8
let size_int = 8
let size_float = 8
-(* Operations on addressing modes *)
-
-let identity_addressing = Iindexed 0
-
-let offset_addressing addr delta =
- match addr with
- Ibased(s, n) -> Ibased(s, n + delta)
- | Iindexed n -> Iindexed(n + delta)
- | Iindexed2 n -> Iindexed2(n + delta)
- | Iscaled(scale, n) -> Iscaled(scale, n + delta)
- | Iindexed2scaled(scale, n) -> Iindexed2scaled(scale, n + delta)
-
-let num_args_addressing = function
- Ibased(s, n) -> 0
- | Iindexed n -> 1
- | Iindexed2 n -> 2
- | Iscaled(scale, n) -> 1
- | Iindexed2scaled(scale, n) -> 2
-
-(* Printing operations and addressing modes *)
-
-let print_addressing printreg addr ppf arg =
- match addr with
- | Ibased(s, 0) ->
- fprintf ppf "\"%s\"" s
- | Ibased(s, n) ->
- fprintf ppf "\"%s\" + %i" s n
- | Iindexed n ->
- let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
- fprintf ppf "%a%s" printreg arg.(0) idx
- | Iindexed2 n ->
- let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
- fprintf ppf "%a + %a%s" printreg arg.(0) printreg arg.(1) idx
- | Iscaled(scale, n) ->
- let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
- fprintf ppf "%a * %i%s" printreg arg.(0) scale idx
- | Iindexed2scaled(scale, n) ->
- let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
- fprintf ppf "%a + %a * %i%s" printreg arg.(0) printreg arg.(1) scale idx
+(* Instruction selection *)
-let print_specific_operation printreg op ppf arg =
- match op with
- | Ilea addr -> print_addressing printreg addr ppf arg
- | Istore_int(n, addr) ->
- fprintf ppf "[%a] := %nd" (print_addressing printreg addr) arg n
- | Istore_symbol(lbl, addr) ->
- fprintf ppf "[%a] := \"%s\"" (print_addressing printreg addr) arg lbl
- | Ioffset_loc(n, addr) ->
- fprintf ppf "[%a] +:= %i" (print_addressing printreg addr) arg n
- | Ifloatarithmem(op, addr) ->
- let op_name = function
- | Ifloatadd -> "+f"
- | Ifloatsub -> "-f"
- | Ifloatmul -> "*f"
- | Ifloatdiv -> "/f" in
- fprintf ppf "%a %s float64[%a]" printreg arg.(0) (op_name op)
- (print_addressing printreg addr)
- (Array.sub arg 1 (Array.length arg - 1))
+let word_addressed = false
Oops, something went wrong.

0 comments on commit ecf488c

Please sign in to comment.