daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -aur ocaml-4.00.1.pristine/asmcomp/arm/emit.mlp ocaml-4.00.1.new/asmcomp/arm/emit.mlp
  2. --- ocaml-4.00.1.pristine/asmcomp/arm/emit.mlp  2012-07-30 20:59:07.000000000 +0200
  3. +++ ocaml-4.00.1.new/asmcomp/arm/emit.mlp   2012-10-26 07:48:21.446772796 +0200
  4. @@ -608,17 +608,21 @@
  5.          `  mov {emit_reg r}, {emit_reg r}, asr #{emit_int l}\n`; 5
  6.      | Lop(Iintop_imm(Imod, n)) -> (* n is a power of 2 *)
  7.          let l = Misc.log2 n in
  8. -        let a = i.arg.(0) in
  9.          let r = i.res.(0) in
  10. -        let lbl = new_label() in
  11. -        `  cmp {emit_reg a}, #0\n`;
  12. -        `  mov {emit_reg r}, {emit_reg a}, lsl #{emit_int (32-l)}\n`;
  13. -        `  mov {emit_reg r}, {emit_reg r}, lsr #{emit_int (32-l)}\n`;
  14. -        `  bpl {emit_label lbl}\n`;
  15. -        `  cmp {emit_reg r}, #0\n`;
  16. -        `  it  ne\n`;
  17. -        `  subne   {emit_reg r}, {emit_reg r}, #{emit_int n}\n`;
  18. -        `{emit_label lbl}:\n`; 7
  19. +        if l = 0 then begin
  20. +          ` movs {emit_reg r}, #{emit_int 0}\n`; 1
  21. +        end else begin
  22. +          let a = i.arg.(0) in
  23. +          let lbl = new_label() in
  24. +          `    cmp {emit_reg a}, #0\n`;
  25. +          `    mov {emit_reg r}, {emit_reg a}, lsl #{emit_int (32-l)}\n`;
  26. +          `    mov {emit_reg r}, {emit_reg r}, lsr #{emit_int (32-l)}\n`;
  27. +          `    bpl {emit_label lbl}\n`;
  28. +          `    cmp {emit_reg r}, #0\n`;
  29. +          `    it  ne\n`;
  30. +          `    subne   {emit_reg r}, {emit_reg r}, #{emit_int n}\n`;
  31. +          `{emit_label lbl}:\n`; 7
  32. +        end
  33.      | Lop(Iintop_imm((Ilsl | Ilsr | Iasr as op), n)) ->
  34.          let shift = name_for_shift_operation op in
  35.          `  mov {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_string shift} #{emit_int n}\n`; 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top