~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to asmcomp/i386/emit_nt.mlp

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
(*                                                                     *)
11
11
(***********************************************************************)
12
12
 
13
 
(* $Id: emit_nt.mlp 9189 2009-03-21 16:15:47Z xleroy $ *)
 
13
(* $Id: emit_nt.mlp 9547 2010-01-22 12:48:24Z doligez $ *)
14
14
 
15
15
(* Emission of Intel 386 assembly code, MASM syntax. *)
16
16
 
49
49
  | Outgoing n ->
50
50
      assert (n >= 0);
51
51
      n
52
 
(* Record symbols used and defined - at the end generate extern for those 
 
52
(* Record symbols used and defined - at the end generate extern for those
53
53
   used but not defined *)
54
54
 
55
55
let symbols_defined = ref StringSet.empty
74
74
(* Output an align directive. *)
75
75
 
76
76
let emit_align n = `    ALIGN   {emit_int n}\n`
77
 
  
 
77
 
78
78
(* Output a pseudo-register *)
79
79
 
80
80
let emit_reg = function
257
257
  | Iunsigned Ceq -> "e"   | Iunsigned Cne -> "ne"
258
258
  | Iunsigned Cle -> "be"  | Iunsigned Cgt -> "a"
259
259
  | Iunsigned Clt -> "b"   | Iunsigned Cge -> "ae"
260
 
    
 
260
 
261
261
(* Output an = 0 or <> 0 test. *)
262
262
 
263
263
let output_test_zero arg =
687
687
            `   cmp     {emit_reg i.arg.(0)},{emit_reg i.arg.(1)}\n`;
688
688
            let b = name_for_cond_branch cmp in
689
689
            `   j{emit_string b}        {emit_label lbl}\n`
690
 
        | Iinttest_imm((Isigned Ceq | Isigned Cne | 
 
690
        | Iinttest_imm((Isigned Ceq | Isigned Cne |
691
691
                        Iunsigned Ceq | Iunsigned Cne) as cmp, 0) ->
692
692
            output_test_zero i.arg.(0);
693
693
            let b = name_for_cond_branch cmp in