Hello community,

here is the log from the commit of package ocaml for openSUSE:Factory checked 
in at 2014-10-29 21:09:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ocaml (Old)
 and      /work/SRC/openSUSE:Factory/.ocaml.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ocaml"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ocaml/ocaml.changes      2014-10-18 
09:08:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ocaml.new/ocaml.changes 2014-10-29 
21:09:09.000000000 +0100
@@ -1,0 +2,22 @@
+Thu Oct 23 10:49:37 UTC 2014 - oher...@suse.de
+
+- Recognize macros provided by prjconf to disable ocamlopt and
+  run testsuite
+
+-------------------------------------------------------------------
+Thu Oct 23 10:47:28 UTC 2014 - oher...@suse.de
+
+- New subpackage ocaml-rpm-macros
+
+-------------------------------------------------------------------
+Wed Oct 22 14:42:09 UTC 2014 - oher...@suse.de
+
+- update version 4.02.1
+  * http://caml.inria.fr/pub/distrib/ocaml-4.02/notes/Changes
+
+-------------------------------------------------------------------
+Mon Oct 20 09:39:25 UTC 2014 - oher...@suse.de
+
+- Update ppc64/ppc64le patch (bnc#901836)
+
+-------------------------------------------------------------------

Old:
----
  ocaml-4.02.0.tar.xz

New:
----
  ocaml-4.02.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ocaml.spec ++++++
--- /var/tmp/diff_new_pack.LS65P2/_old  2014-10-29 21:09:10.000000000 +0100
+++ /var/tmp/diff_new_pack.LS65P2/_new  2014-10-29 21:09:10.000000000 +0100
@@ -18,17 +18,34 @@
 #
 
 
-%define do_camlp4 0
-%define do_labltk 0
 Name:           ocaml
-Version:        4.02.0
+Version:        4.02.1
 Release:        0
 %define doc_version 4.02
+#
 %define do_opt 0
+# macros to be set in prjconf:
+#Macros:
+#_with_ocaml_force_enable_ocaml_opt 1
+#_with_ocaml_force_disable_ocaml_opt 1
+#_with_ocaml_make_testsuite 1
+%bcond_with ocaml_force_enable_ocaml_opt
+%bcond_with ocaml_force_disable_ocaml_opt
+%bcond_with ocaml_make_testsuite
+%if %{with ocaml_force_enable_ocaml_opt}
+%define do_opt 1
+%endif
+%if %{without ocaml_force_enable_ocaml_opt}
 %ifarch %arm aarch64 %ix86 ppc ppc64 ppc64le x86_64
 %define do_opt 1
 %endif
-# http://caml.inria.fr/pub/distrib/ocaml-%{doc_version}/
+%endif
+#
+%if %{with ocaml_force_disable_ocaml_opt}
+%define do_opt 0
+%endif
+#
+# http://caml.inria.fr/pub/distrib/
 Source0:        
http://caml.inria.fr/pub/distrib/ocaml-%{doc_version}/ocaml-%{version}.tar.xz
 Source1:        ocaml-%{doc_version}-refman-html-0.tar.xz
 Source2:        ocaml-%{doc_version}-refman-html-1.tar.xz
@@ -53,9 +70,8 @@
 
 BuildRequires:  emacs-nox
 BuildRequires:  fdupes
-BuildRequires:  gdbm-devel
 BuildRequires:  ncurses-devel
-BuildRequires:  tk-devel
+BuildRequires:  pkgconfig(x11)
 # This gets ocamlobjinfo to work with .cmxs files
 BuildRequires:  binutils-devel
 %if %{do_opt}
@@ -78,11 +94,23 @@
 system, Lex&Yacc tools, a replay debugger, and a comprehensive library.
 
 
+%package       rpm-macros
+Summary:        RPM macros for building OCaml source packages
+License:        QPL-1.0 and SUSE-LGPL-2.0-with-linking-exception
+Group:          Development/Languages/Other
+
+%description       rpm-macros
+A set of helper macros to unify common code used in ocaml spec files.
+
 %package runtime
 Summary:        The Objective Caml Compiler and Programming Environment
 License:        QPL-1.0
 Group:          Development/Languages/Other
 Provides:       ocaml(runtime) = %{version}
+%if %suse_version < 1210
+# Due to lack of generated requires in old rpm, force this
+Requires:       ocaml-compiler-libs = %{version}
+%endif
 
 %description runtime
 Objective Caml is a high-level, strongly-typed, functional and
@@ -113,75 +141,6 @@
 
 
 
-%if %{do_labltk}
-%package labltk
-Summary:        The Objective Caml Compiler and Programming Environment
-License:        SUSE-LGPL-2.0-with-linking-exception
-Group:          System/Libraries
-Requires:       ocaml = %{version}
-Requires:       ocaml(runtime) = %{version}
-
-%description labltk
-Labltk is a library for interfacing Objective Caml with the scripting
-language Tcl/Tk.
-
-This package contains the runtime files.
-
-
-
-%package labltk-devel
-Summary:        Development files for labltk
-License:        SUSE-LGPL-2.0-with-linking-exception
-Group:          Development/Libraries/Other
-Requires:       %{name}-labltk = %{version}
-Requires:       ocaml = %{version}
-Requires:       tcl-devel
-Requires:       tk-devel
-Requires:       xorg-x11-libX11-devel
-
-%description labltk-devel
-Labltk is a library for interfacing Objective Caml with the scripting
-language Tcl/Tk.
-
-This package contains the development files.  It includes the ocaml
-browser for code editing and library browsing.
-
-
-
-%endif
-%if %{do_camlp4}
-%package camlp4
-Summary:        Pre-Processor-Pretty-Printer for Objective Caml
-License:        SUSE-LGPL-2.0-with-linking-exception
-Group:          Development/Languages/Other
-Requires:       ocaml-runtime = %{version}
-%if %suse_version < 1210
-# Due to lack of generated requires in old rpm, force this
-Requires:       ocaml-compiler-libs
-%endif
-
-%description camlp4
-Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml, parsing a
-source file and printing some result on standard output.
-
-This package contains the runtime files.
-
-
-%package camlp4-devel
-Summary:        Pre-Processor-Pretty-Printer for Objective Caml
-License:        SUSE-LGPL-2.0-with-linking-exception
-Group:          Development/Languages/Other
-Requires:       %{name}-camlp4 = %{version}
-Requires:       ocaml = %{version}
-Provides:       camlp4 = %{version}
-Obsoletes:      camlp4 < %{version}
-
-%description camlp4-devel
-Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml, parsing a
-source file and printing some result on standard output.
-
-This package contains the development files.
-%endif
 
 %package ocamldoc
 Summary:        The Objective Caml Compiler and Programming Environment
@@ -253,6 +212,7 @@
 
 
 %prep
+: do_opt %{do_opt}
 %setup -q -a 1 -a 2 -a 3
 %patch0 -p1
 %patch2 -p1
@@ -262,8 +222,6 @@
 %patch9 -p1
 %patch10 -p1
 
-find -name ".cvsignore" -print -delete
-
 %build
 %ifarch %ix86
 # Default OPT flags for these architectures use -fomit-frame-pointer,
@@ -329,6 +287,24 @@
 cp -a typing/ utils/ parsing/ $RPM_BUILD_ROOT%{_libdir}/ocaml/compiler-libs
 %fdupes $RPM_BUILD_ROOT
 
+mkdir -vp $RPM_BUILD_ROOT%{_sysconfdir}/rpm
+cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.%{name} <<_EOF_
+# get rid of /usr/lib/rpm/find-debuginfo.sh
+# strip kills the bytecode part of ELF binaries
+%if %{do_opt}
+%%ocaml_preserve_bytecode \
+       %%{nil}
+%%ocaml_native_compiler 1
+%else
+%%ocaml_preserve_bytecode \
+       %%undefine _build_create_debug \
+       %%define __arch_install_post export NO_BRP_STRIP_DEBUG=true \
+       %%{nil}
+%%ocaml_native_compiler 0
+%endif
+_EOF_
+cat $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.%{name}
+
 %post
 %install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
 
@@ -372,28 +348,14 @@
 %exclude %{_libdir}/ocaml/graphicsX11.mli
 %{_infodir}/*
 %exclude %{_bindir}/ocamlrun
-%if %{do_camlp4}
-%exclude %{_bindir}/camlp4*
-%exclude %{_bindir}/mkcamlp4
-%endif
-%if %{do_labltk}
-%exclude %{_bindir}/labltk
-%endif
 %exclude %{_bindir}/ocamltags
-%if %{do_labltk}
-%exclude %{_bindir}/ocamlbrowser
-%endif
 %exclude %{_bindir}/ocamldoc*
-%if %{do_camlp4}
-%exclude %{_libdir}/ocaml/camlp4
-%endif
-%if %{do_labltk}
-%exclude %{_libdir}/ocaml/labltk
-%endif
 %exclude %{_libdir}/ocaml/ocamldoc
-%if %{do_labltk}
-%exclude %{_libdir}/ocaml/stublibs/dlllabltk.so
-%endif
+
+%files rpm-macros
+%defattr(-,root,root,-)
+%dir %{_sysconfdir}/rpm
+%config %{_sysconfdir}/rpm/*
 
 %files runtime
 %defattr(-,root,root,-)
@@ -410,9 +372,6 @@
 %{_libdir}/ocaml/threads/*.cmi
 %{_libdir}/ocaml/threads/*.cma
 %exclude %{_libdir}/ocaml/graphicsX11.cmi
-%if %{do_labltk}
-%exclude %{_libdir}/ocaml/stublibs/dlllabltk.so
-%endif
 %doc README LICENSE Changes
 
 %files x11
@@ -424,73 +383,6 @@
 %defattr(-,root,root,-)
 %{_libdir}/ocaml/*.ml
 
-%if %{do_labltk}
-%files labltk
-%defattr(-,root,root,-)
-%{_bindir}/labltk
-%dir %{_libdir}/ocaml/labltk
-%{_libdir}/ocaml/labltk/*.cmi
-%{_libdir}/ocaml/labltk/*.cma
-%{_libdir}/ocaml/labltk/*.cmo
-%{_libdir}/ocaml/stublibs/dlllabltk.so
-
-%files labltk-devel
-%defattr(-,root,root,-)
-%{_bindir}/ocamlbrowser
-%{_libdir}/ocaml/labltk/labltktop
-%{_libdir}/ocaml/labltk/pp
-%{_libdir}/ocaml/labltk/tkcompiler
-%if %{do_opt}
-%{_libdir}/ocaml/labltk/*.a
-%{_libdir}/ocaml/labltk/*.cmxa
-%{_libdir}/ocaml/labltk/*.cmx
-%{_libdir}/ocaml/labltk/*.o
-%endif
-%{_libdir}/ocaml/labltk/*.mli
-%doc otherlibs/labltk/examples_labltk
-%doc otherlibs/labltk/examples_camltk
-%endif
-
-%if %{do_camlp4}
-%files camlp4
-%defattr(-,root,root,-)
-%dir %{_libdir}/ocaml/camlp4
-%{_libdir}/ocaml/camlp4/*.cmi
-%{_libdir}/ocaml/camlp4/*.cma
-%{_libdir}/ocaml/camlp4/*.cmo
-%dir %{_libdir}/ocaml/camlp4/Camlp4Filters
-%{_libdir}/ocaml/camlp4/Camlp4Filters/*.cmi
-%{_libdir}/ocaml/camlp4/Camlp4Filters/*.cmo
-%dir %{_libdir}/ocaml/camlp4/Camlp4Parsers
-%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.cmo
-%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.cmi
-%dir %{_libdir}/ocaml/camlp4/Camlp4Printers
-%{_libdir}/ocaml/camlp4/Camlp4Printers/*.cmi
-%{_libdir}/ocaml/camlp4/Camlp4Printers/*.cmo
-%dir %{_libdir}/ocaml/camlp4/Camlp4Top
-%{_libdir}/ocaml/camlp4/Camlp4Top/*.cmi
-%{_libdir}/ocaml/camlp4/Camlp4Top/*.cmo
-
-%files camlp4-devel
-%defattr(-,root,root,-)
-%{_bindir}/camlp4*
-%{_bindir}/mkcamlp4
-%if %{do_opt}
-%{_libdir}/ocaml/camlp4/*.a
-%{_libdir}/ocaml/camlp4/*.cmxa
-%{_libdir}/ocaml/camlp4/*.cmx
-%{_libdir}/ocaml/camlp4/*.o
-%{_libdir}/ocaml/camlp4/Camlp4Filters/*.cmx
-%{_libdir}/ocaml/camlp4/Camlp4Filters/*.o
-%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.cmx
-%{_libdir}/ocaml/camlp4/Camlp4Parsers/*.o
-%{_libdir}/ocaml/camlp4/Camlp4Printers/*.cmx
-%{_libdir}/ocaml/camlp4/Camlp4Printers/*.o
-%{_libdir}/ocaml/camlp4/Camlp4Top/*.cmx
-%{_libdir}/ocaml/camlp4/Camlp4Top/*.o
-%endif
-%endif
-
 %files ocamldoc
 %defattr(-,root,root,-)
 %{_bindir}/ocamldoc*
@@ -530,4 +422,15 @@
 %{_libdir}/ocaml/compiler-libs/*/*.ml
 %{_libdir}/ocaml/compiler-libs/*/*.mli
 
+%if %{with ocaml_make_testsuite}
+%check
+make -C testsuite clean
+if make -C testsuite all
+then
+       : passed
+else
+       : failed
+fi
+%endif
+
 %changelog

++++++ ocaml-4.02.0.tar.xz -> ocaml-4.02.1.tar.xz ++++++
++++ 4969 lines of diff (skipped)

++++++ ocaml-ppc64.patch ++++++
--- /var/tmp/diff_new_pack.LS65P2/_old  2014-10-29 21:09:11.000000000 +0100
+++ /var/tmp/diff_new_pack.LS65P2/_new  2014-10-29 21:09:11.000000000 +0100
@@ -19,17 +19,18 @@
 
 Includes updates for OCaml 4.01.0.
 ---
+ asmcomp/power64/CSE.ml        |   37 +
  asmcomp/power64/arch.ml       |   88 +++
- asmcomp/power64/emit.mlp      |  988 
++++++++++++++++++++++++++++++++++++++++++
- asmcomp/power64/proc.ml       |  240 ++++++++++
+ asmcomp/power64/emit.mlp      |  978 
++++++++++++++++++++++++++++++++++++++++++
+ asmcomp/power64/proc.ml       |  255 ++++++++++
  asmcomp/power64/reload.ml     |   18 
- asmcomp/power64/scheduling.ml |   65 ++
- asmcomp/power64/selection.ml  |  101 ++++
+ asmcomp/power64/scheduling.ml |   63 ++
+ asmcomp/power64/selection.ml  |   93 +++
  asmrun/Makefile               |    6 
  asmrun/power64-elf.S          |  486 ++++++++++++++++++++
  asmrun/stack.h                |    9 
  configure                     |    3 
- 10 files changed, 2004 insertions(+)
+ 11 files changed, 2036 insertions(+)
  create mode 100644 asmcomp/power64/arch.ml
  create mode 100644 asmcomp/power64/emit.mlp
  create mode 100644 asmcomp/power64/proc.ml
@@ -38,6 +39,48 @@
  create mode 100644 asmcomp/power64/selection.ml
  create mode 100644 asmrun/power64-elf.S
 
+Index: ocaml-4.02.0/asmcomp/power64/CSE.ml
+===================================================================
+--- /dev/null
++++ ocaml-4.02.0/asmcomp/power64/CSE.ml
+@@ -0,0 +1,37 @@
++(***********************************************************************)
++(*                                                                     *)
++(*                                OCaml                                *)
++(*                                                                     *)
++(*            Xavier Leroy, projet Gallium, INRIA Rocquencourt         *)
++(*                                                                     *)
++(*  Copyright 2014 Institut National de Recherche en Informatique et   *)
++(*  en Automatique.  All rights reserved.  This file is distributed    *)
++(*  under the terms of the Q Public License version 1.0.               *)
++(*                                                                     *)
++(***********************************************************************)
++
++(* CSE for the PowerPC *)
++
++open Arch
++open Mach
++open CSEgen
++
++class cse = object (self)
++
++inherit cse_generic as super
++
++method! class_of_operation op =
++  match op with
++  | Ispecific(Imultaddf | Imultsubf) -> Op_pure
++  | Ispecific(Ialloc_far _) -> Op_other
++  | _ -> super#class_of_operation op
++
++method! is_cheap_operation op =
++  match op with
++  | Iconst_int n | Iconst_blockheader n -> n <= 32767n && n >= -32768n
++  | _ -> false
++
++end
++
++let fundecl f =
++  (new cse)#fundecl f
 Index: ocaml-4.02.0/asmcomp/power64/arch.ml
 ===================================================================
 --- /dev/null
@@ -135,7 +178,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64/emit.mlp
-@@ -0,0 +1,988 @@
+@@ -0,0 +1,978 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -288,7 +331,7 @@
 +    TocSymOfs of (string * int)
 +  | TocLabel of int
 +  | TocInt of nativeint
-+  | TocFloat of string
++  | TocFloat of float
 +
 +(* List of all labels in tocref (reverse order) *)
 +let tocref_entries = ref []
@@ -304,7 +347,7 @@
 +  match entry with
 +      TocSymOfs(s,d) -> emit_symbol_offset(s,d)
 +    | TocInt i -> emit_nativeint i
-+    | TocFloat f -> emit_string f
++    | TocFloat f -> emit_float64_directive ".quad" (Int64.bits_of_float f)
 +    | TocLabel lbl -> emit_label lbl
 +
 + let rec tocref_label = function
@@ -430,6 +473,7 @@
 +let name_for_intop = function
 +    Iadd -> "add"
 +  | Imul -> "mulld"
++  | Imulh -> "mulhd"
 +  | Idiv -> "divd"
 +  | Iand -> "and"
 +  | Ior  -> "or"
@@ -492,7 +536,8 @@
 +let instr_size = function
 +    Lend -> 0
 +  | Lop(Imove | Ispill | Ireload) -> 1
-+  | Lop(Iconst_int n) -> if is_native_immediate n then 1 else 2
++  | Lop(Iconst_int n | Iconst_blockheader n) ->
++    if is_native_immediate n then 1 else 2
 +  | Lop(Iconst_float s) -> 2
 +  | Lop(Iconst_symbol s) -> 2
 +  | Lop(Icall_ind) -> 6
@@ -508,14 +553,12 @@
 +      if chunk = Byte_signed
 +      then load_store_size addr + 1
 +      else load_store_size addr
-+  | Lop(Istore(chunk, addr)) -> load_store_size addr
++  | Lop(Istore(chunk, addr, _)) -> load_store_size addr
 +  | Lop(Ialloc n) -> 4
 +  | Lop(Ispecific(Ialloc_far n)) -> 5
 +  | Lop(Iintop Imod) -> 3
 +  | Lop(Iintop(Icomp cmp)) -> 4
 +  | Lop(Iintop op) -> 1
-+  | Lop(Iintop_imm(Idiv, n)) -> 2
-+  | Lop(Iintop_imm(Imod, n)) -> 4
 +  | Lop(Iintop_imm(Icomp cmp, n)) -> 4
 +  | Lop(Iintop_imm(op, n)) -> 1
 +  | Lop(Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf) -> 1
@@ -535,7 +578,7 @@
 +  | Lsetuptrap lbl -> 1
 +  | Lpushtrap -> 7
 +  | Lpoptrap -> 1
-+  | Lraise -> 6
++  | Lraise _ -> 6
 +
 +let label_map code =
 +  let map = Hashtbl.create 37 in
@@ -630,7 +673,7 @@
 +            | (_, _) ->
 +                fatal_error "Emit: Imove"
 +        end
-+    | Lop(Iconst_int n) ->
++    | Lop(Iconst_int n | Iconst_blockheader n) ->
 +        if is_native_immediate n then
 +          `    li      {emit_reg i.res.(0)}, {emit_nativeint n}\n`
 +        else if n >= -0x8000_0000n && n <= 0x7FFF_FFFFn then begin
@@ -640,8 +683,8 @@
 +        end else begin
 +           `   ld      {emit_reg i.res.(0)}, {emit_tocref (TocInt n)}\n`
 +        end
-+    | Lop(Iconst_float s) ->
-+        `      lfd     {emit_reg i.res.(0)}, {emit_tocref (TocFloat s)}\n`
++    | Lop(Iconst_float f) ->
++        `      lfd     {emit_reg i.res.(0)}, {emit_tocref (TocFloat f)}\n`
 +    | Lop(Iconst_symbol s) ->
 +        `      ld      {emit_reg i.res.(0)}, {emit_tocref (TocSymOfs 
(s,0))}\n`
 +    | Lop(Icall_ind) ->
@@ -719,7 +762,7 @@
 +        emit_load_store loadinstr addr i.arg 0 i.res.(0);
 +        if chunk = Byte_signed then
 +          `    extsb   {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n`
-+    | Lop(Istore(chunk, addr)) ->
++    | Lop(Istore(chunk, addr, _)) ->
 +        let storeinstr =
 +          match chunk with
 +            Byte_unsigned | Byte_signed -> "stb"
@@ -748,9 +791,9 @@
 +    | Lop(Iintop Isub) ->               (* subfc has swapped arguments *)
 +        `      subfc   {emit_reg i.res.(0)}, {emit_reg i.arg.(1)}, {emit_reg 
i.arg.(0)}\n`
 +    | Lop(Iintop Imod) ->
-+        `      divd    {emit_gpr 0}, {emit_reg i.arg.(0)}, {emit_reg 
i.arg.(1)}\n`;
-+        `      mulld   {emit_gpr 0}, {emit_gpr 0}, {emit_reg i.arg.(1)}\n`;
-+        `      subfc   {emit_reg i.res.(0)}, {emit_gpr 0}, {emit_reg 
i.arg.(0)}\n`
++        `     divd    {emit_gpr 0}, {emit_reg i.arg.(0)}, {emit_reg 
i.arg.(1)}\n`;
++        `     mulld   {emit_gpr 0}, {emit_gpr 0}, {emit_reg i.arg.(1)}\n`;
++        `     subfc   {emit_reg i.res.(0)}, {emit_gpr 0}, {emit_reg 
i.arg.(0)}\n`
 +    | Lop(Iintop(Icomp cmp)) ->
 +        begin match cmp with
 +          Isigned c ->
@@ -767,16 +810,6 @@
 +        `      {emit_string instr}     {emit_reg i.res.(0)}, {emit_reg 
i.arg.(0)}, {emit_reg i.arg.(1)}\n`
 +    | Lop(Iintop_imm(Isub, n)) ->
 +        `      addi    {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, 
{emit_int(-n)}\n`
-+    | Lop(Iintop_imm(Idiv, n)) ->       (* n is guaranteed to be a power of 2 
*)
-+        let l = Misc.log2 n in
-+        `      sradi   {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int 
l}\n`;
-+        `      addze   {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n`
-+    | Lop(Iintop_imm(Imod, n)) ->       (* n is guaranteed to be a power of 2 
*)
-+        let l = Misc.log2 n in
-+        `      sradi   {emit_gpr 0}, {emit_reg i.arg.(0)}, {emit_int l}\n`;
-+        `      addze   {emit_gpr 0}, {emit_gpr 0}\n`;
-+        `      sldi    {emit_gpr 0}, {emit_gpr 0}, {emit_int l}\n`;
-+        `      subfc   {emit_reg i.res.(0)}, {emit_gpr 0}, {emit_reg 
i.arg.(0)}\n`
 +    | Lop(Iintop_imm(Icomp cmp, n)) ->
 +        begin match cmp with
 +          Isigned c ->
@@ -910,7 +943,7 @@
 +       `       mr      {emit_gpr 29}, {emit_gpr 11}\n`
 +    | Lpoptrap ->
 +        `      ld      {emit_gpr 29}, 0({emit_gpr 29})\n`
-+    | Lraise ->
++    | Lraise k ->
 +        `      ld      {emit_gpr 0}, 8({emit_gpr 29})\n`;
 +        `      ld      {emit_gpr 1}, 16({emit_gpr 29})\n`;
 +        `      ld      {emit_gpr 2}, 24({emit_gpr 29})\n`;
@@ -1041,9 +1074,9 @@
 +  | Cint n ->
 +      `        .quad   {emit_nativeint n}\n`
 +  | Csingle f ->
-+      `        .float  0d{emit_string f}\n`
++      `        {emit_float32_directive ".float" (Int32.bits_of_float f)}\n`
 +  | Cdouble f ->
-+      `        .double 0d{emit_string f}\n`
++      `        {emit_float64_directive ".quad" (Int64.bits_of_float f)}\n`
 +  | Csymbol_address s ->
 +      `        .quad   {emit_symbol s}\n`
 +  | Clabel_address lbl ->
@@ -1095,7 +1128,7 @@
 +        `{emit_label lbl}:\n`;
 +       match entry with
 +        TocFloat f ->
-+         `     .double {emit_tocentry entry}\n`
++         `    {emit_tocentry entry}\n`
 +       | _ ->
 +          `    .tc     {emit_label lbl}[TC],{emit_tocentry entry}\n`
 +      )
@@ -1128,7 +1161,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64/proc.ml
-@@ -0,0 +1,240 @@
+@@ -0,0 +1,255 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -1216,11 +1249,11 @@
 +(* Representation of hard registers by pseudo-registers *)
 +
 +let hard_int_reg =
-+  let v = Array.create 23 Reg.dummy in
++  let v = Array.make 23 Reg.dummy in
 +  for i = 0 to 22 do v.(i) <- Reg.at_location Int (Reg i) done; v
 +
 +let hard_float_reg =
-+  let v = Array.create 31 Reg.dummy in
++  let v = Array.make 31 Reg.dummy in
 +  for i = 0 to 30 do v.(i) <- Reg.at_location Float (Reg(100 + i)) done; v
 +
 +let all_phys_regs =
@@ -1236,7 +1269,7 @@
 +
 +let calling_conventions
 +    first_int last_int first_float last_float make_stack stack_ofs arg =
-+  let loc = Array.create (Array.length arg) Reg.dummy in
++  let loc = Array.make (Array.length arg) Reg.dummy in
 +  let int = ref first_int in
 +  let float = ref first_float in
 +  let ofs = ref stack_ofs in
@@ -1290,7 +1323,7 @@
 +
 +let poweropen_external_conventions first_int last_int
 +                                   first_float last_float arg =
-+  let loc = Array.create (Array.length arg) Reg.dummy in
++  let loc = Array.make (Array.length arg) Reg.dummy in
 +  let int = ref first_int in
 +  let float = ref first_float in
 +  let ofs = ref (14 * size_addr) in
@@ -1333,6 +1366,10 @@
 +
 +let loc_exn_bucket = phys_reg 0
 +
++(* Volatile registers: none *)
++
++let regs_are_volatile rs = false
++
 +(* Registers destroyed by operations *)
 +
 +let destroyed_at_c_call =
@@ -1357,6 +1394,17 @@
 +    Iextcall(_, _) -> [| 15; 18 |]
 +  | _ -> [| 23; 30 |]
 +
++(* Pure operations (without any side effect besides updating their result
++   registers). *)
++
++let op_is_pure = function
++  | Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
++  | Iextcall _ | Istackoffset _ | Istore _ | Ialloc _
++  | Iintop(Icheckbound) | Iintop_imm(Icheckbound, _) -> false
++  | Ispecific(Imultaddf | Imultsubf) -> true
++  | Ispecific _ -> false
++  | _ -> true
++
 +(* Layout of the stack *)
 +
 +let num_stack_slots = [| 0; 0 |]
@@ -1396,7 +1444,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64/scheduling.ml
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,63 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -1427,7 +1475,7 @@
 +  | Iload(_, _) -> 2
 +  | Iconst_float _ -> 2 (* turned into a load *)
 +  | Iconst_symbol _ -> 1
-+  | Iintop Imul -> 9
++  | Iintop(Imul | Imulh) -> 9
 +  | Iintop_imm(Imul, _) -> 5
 +  | Iintop(Idiv | Imod) -> 36
 +  | Iaddf | Isubf -> 4
@@ -1445,12 +1493,10 @@
 +method oper_issue_cycles = function
 +    Iconst_float _ | Iconst_symbol _ -> 2
 +  | Iload(_, Ibased(_, _)) -> 2
-+  | Istore(_, Ibased(_, _)) -> 2
++  | Istore(_, Ibased(_, _), _) -> 2
 +  | Ialloc _ -> 4
 +  | Iintop(Imod) -> 40 (* assuming full stall *)
 +  | Iintop(Icomp _) -> 4
-+  | Iintop_imm(Idiv, _) -> 2
-+  | Iintop_imm(Imod, _) -> 4
 +  | Iintop_imm(Icomp _, _) -> 4
 +  | Ifloatofint -> 9
 +  | Iintoffloat -> 4
@@ -1466,7 +1512,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64/selection.ml
-@@ -0,0 +1,101 @@
+@@ -0,0 +1,93 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -1532,16 +1578,8 @@
 +
 +method! select_operation op args =
 +  match (op, args) with
-+  (* Prevent the recognition of (x / cst) and (x % cst) when cst is not
-+     a power of 2, which do not correspond to an instruction. *)
-+    (Cdivi, [arg; Cconst_int n]) when n = 1 lsl (Misc.log2 n) ->
-+      (Iintop_imm(Idiv, n), [arg])
-+  | (Cdivi, _) ->
-+      (Iintop Idiv, args)
-+  | (Cmodi, [arg; Cconst_int n]) when n = 1 lsl (Misc.log2 n) ->
-+      (Iintop_imm(Imod, n), [arg])
-+  | (Cmodi, _) ->
-+      (Iintop Imod, args)
++  (* PowerPC does not support immediate operands for multiply high *)
++    (Cmulhi, _) -> (Iintop Imulh, args)
 +  (* The and, or and xor instructions have a different range of immediate
 +     operands than the other instructions *)
 +  | (Cand, _) -> self#select_logical Iand args

++++++ ocaml-ppc64le.patch ++++++
--- /var/tmp/diff_new_pack.LS65P2/_old  2014-10-29 21:09:11.000000000 +0100
+++ /var/tmp/diff_new_pack.LS65P2/_new  2014-10-29 21:09:11.000000000 +0100
@@ -5,19 +5,62 @@
 
 Signed-off-by: Michel Normand <norm...@linux.vnet.ibm.com>
 ---
+ asmcomp/power64le/CSE.ml        |   37 +
  asmcomp/power64le/arch.ml       |   88 +++
- asmcomp/power64le/emit.mlp      |  981 
++++++++++++++++++++++++++++++++++++++++
- asmcomp/power64le/proc.ml       |  240 +++++++++
+ asmcomp/power64le/emit.mlp      |  971 
++++++++++++++++++++++++++++++++++++++++
+ asmcomp/power64le/proc.ml       |  255 ++++++++++
  asmcomp/power64le/reload.ml     |   18 
- asmcomp/power64le/scheduling.ml |   65 ++
- asmcomp/power64le/selection.ml  |  101 ++++
+ asmcomp/power64le/scheduling.ml |   63 ++
+ asmcomp/power64le/selection.ml  |   93 +++
  asmrun/Makefile                 |    6 
  asmrun/power64-elf.S            |   93 +++
  asmrun/power64le-elf.S          |  579 +++++++++++++++++++++++
  asmrun/stack.h                  |    9 
  configure                       |    3 
- 11 files changed, 2183 insertions(+)
+ 12 files changed, 2215 insertions(+)
 
+Index: ocaml-4.02.0/asmcomp/power64le/CSE.ml
+===================================================================
+--- /dev/null
++++ ocaml-4.02.0/asmcomp/power64le/CSE.ml
+@@ -0,0 +1,37 @@
++(***********************************************************************)
++(*                                                                     *)
++(*                                OCaml                                *)
++(*                                                                     *)
++(*            Xavier Leroy, projet Gallium, INRIA Rocquencourt         *)
++(*                                                                     *)
++(*  Copyright 2014 Institut National de Recherche en Informatique et   *)
++(*  en Automatique.  All rights reserved.  This file is distributed    *)
++(*  under the terms of the Q Public License version 1.0.               *)
++(*                                                                     *)
++(***********************************************************************)
++
++(* CSE for the PowerPC *)
++
++open Arch
++open Mach
++open CSEgen
++
++class cse = object (self)
++
++inherit cse_generic as super
++
++method! class_of_operation op =
++  match op with
++  | Ispecific(Imultaddf | Imultsubf) -> Op_pure
++  | Ispecific(Ialloc_far _) -> Op_other
++  | _ -> super#class_of_operation op
++
++method! is_cheap_operation op =
++  match op with
++  | Iconst_int n | Iconst_blockheader n -> n <= 32767n && n >= -32768n
++  | _ -> false
++
++end
++
++let fundecl f =
++  (new cse)#fundecl f
 Index: ocaml-4.02.0/asmcomp/power64le/arch.ml
 ===================================================================
 --- /dev/null
@@ -115,7 +158,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64le/emit.mlp
-@@ -0,0 +1,981 @@
+@@ -0,0 +1,971 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -273,7 +316,7 @@
 +    TocSymOfs of (string * int)
 +  | TocLabel of int
 +  | TocInt of nativeint
-+  | TocFloat of string
++  | TocFloat of float
 +
 +(* List of all labels in tocref (reverse order) *)
 +let tocref_entries = ref []
@@ -289,7 +332,7 @@
 +  match entry with
 +      TocSymOfs(s,d) -> emit_symbol_offset(s,d)
 +    | TocInt i -> emit_nativeint i
-+    | TocFloat f -> emit_string f
++    | TocFloat f -> emit_float64_directive ".quad" (Int64.bits_of_float f)
 +    | TocLabel lbl -> emit_label lbl
 +
 + let rec tocref_label = function
@@ -415,6 +458,7 @@
 +let name_for_intop = function
 +    Iadd -> "add"
 +  | Imul -> "mulld"
++  | Imulh -> "mulhd"
 +  | Idiv -> "divd"
 +  | Iand -> "and"
 +  | Ior  -> "or"
@@ -477,7 +521,8 @@
 +let instr_size = function
 +    Lend -> 0
 +  | Lop(Imove | Ispill | Ireload) -> 1
-+  | Lop(Iconst_int n) -> if is_native_immediate n then 1 else 2
++  | Lop(Iconst_int n | Iconst_blockheader n) ->
++    if is_native_immediate n then 1 else 2
 +  | Lop(Iconst_float s) -> 2
 +  | Lop(Iconst_symbol s) -> 2
 +  | Lop(Icall_ind) -> 4
@@ -493,14 +538,12 @@
 +      if chunk = Byte_signed
 +      then load_store_size addr + 1
 +      else load_store_size addr
-+  | Lop(Istore(chunk, addr)) -> load_store_size addr
++  | Lop(Istore(chunk, addr, _)) -> load_store_size addr
 +  | Lop(Ialloc n) -> 4
 +  | Lop(Ispecific(Ialloc_far n)) -> 5
 +  | Lop(Iintop Imod) -> 3
 +  | Lop(Iintop(Icomp cmp)) -> 4
 +  | Lop(Iintop op) -> 1
-+  | Lop(Iintop_imm(Idiv, n)) -> 2
-+  | Lop(Iintop_imm(Imod, n)) -> 4
 +  | Lop(Iintop_imm(Icomp cmp, n)) -> 4
 +  | Lop(Iintop_imm(op, n)) -> 1
 +  | Lop(Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf) -> 1
@@ -520,7 +563,7 @@
 +  | Lsetuptrap lbl -> 1
 +  | Lpushtrap -> 7
 +  | Lpoptrap -> 1
-+  | Lraise -> 6
++  | Lraise _ -> 6
 +
 +let label_map code =
 +  let map = Hashtbl.create 37 in
@@ -615,7 +658,7 @@
 +            | (_, _) ->
 +                fatal_error "Emit: Imove"
 +        end
-+    | Lop(Iconst_int n) ->
++    | Lop(Iconst_int n | Iconst_blockheader n) ->
 +        if is_native_immediate n then
 +          `    li      {emit_reg i.res.(0)}, {emit_nativeint n}\n`
 +        else if n >= -0x8000_0000n && n <= 0x7FFF_FFFFn then begin
@@ -625,8 +668,8 @@
 +        end else begin
 +           `   ld      {emit_reg i.res.(0)}, {emit_tocref (TocInt n)}\n`
 +        end
-+    | Lop(Iconst_float s) ->
-+        `      lfd     {emit_reg i.res.(0)}, {emit_tocref (TocFloat s)}\n`
++    | Lop(Iconst_float f) ->
++        `      lfd     {emit_reg i.res.(0)}, {emit_tocref (TocFloat f)}\n`
 +    | Lop(Iconst_symbol s) ->
 +        `      ld      {emit_reg i.res.(0)}, {emit_tocref (TocSymOfs 
(s,0))}\n`
 +    | Lop(Icall_ind) ->
@@ -694,7 +737,7 @@
 +        emit_load_store loadinstr addr i.arg 0 i.res.(0);
 +        if chunk = Byte_signed then
 +          `    extsb   {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n`
-+    | Lop(Istore(chunk, addr)) ->
++    | Lop(Istore(chunk, addr, _)) ->
 +        let storeinstr =
 +          match chunk with
 +            Byte_unsigned | Byte_signed -> "stb"
@@ -742,16 +785,6 @@
 +        `      {emit_string instr}     {emit_reg i.res.(0)}, {emit_reg 
i.arg.(0)}, {emit_reg i.arg.(1)}\n`
 +    | Lop(Iintop_imm(Isub, n)) ->
 +        `      addi    {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, 
{emit_int(-n)}\n`
-+    | Lop(Iintop_imm(Idiv, n)) ->       (* n is guaranteed to be a power of 2 
*)
-+        let l = Misc.log2 n in
-+        `      sradi   {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int 
l}\n`;
-+        `      addze   {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n`
-+    | Lop(Iintop_imm(Imod, n)) ->       (* n is guaranteed to be a power of 2 
*)
-+        let l = Misc.log2 n in
-+        `      sradi   {emit_gpr 0}, {emit_reg i.arg.(0)}, {emit_int l}\n`;
-+        `      addze   {emit_gpr 0}, {emit_gpr 0}\n`;
-+        `      sldi    {emit_gpr 0}, {emit_gpr 0}, {emit_int l}\n`;
-+        `      subfc   {emit_reg i.res.(0)}, {emit_gpr 0}, {emit_reg 
i.arg.(0)}\n`
 +    | Lop(Iintop_imm(Icomp cmp, n)) ->
 +        begin match cmp with
 +          Isigned c ->
@@ -885,7 +918,7 @@
 +       `       mr      {emit_gpr 29}, {emit_gpr 11}\n`
 +    | Lpoptrap ->
 +        `      ld      {emit_gpr 29}, 0({emit_gpr 29})\n`
-+    | Lraise ->
++    | Lraise k ->
 +        `      ld      {emit_gpr 0}, 8({emit_gpr 29})\n`;
 +        `      ld      {emit_gpr 1}, 16({emit_gpr 29})\n`;
 +        `      ld      {emit_gpr 2}, 24({emit_gpr 29})\n`;
@@ -1013,9 +1046,9 @@
 +  | Cint n ->
 +      `        .quad   {emit_nativeint n}\n`
 +  | Csingle f ->
-+      `        .float  0d{emit_string f}\n`
++      `        {emit_float32_directive ".float" (Int32.bits_of_float f)}\n`
 +  | Cdouble f ->
-+      `        .double 0d{emit_string f}\n`
++      `        {emit_float64_directive ".quad" (Int64.bits_of_float f)}\n`
 +  | Csymbol_address s ->
 +      `        .quad   {emit_symbol s}\n`
 +  | Clabel_address lbl ->
@@ -1068,7 +1101,7 @@
 +        `{emit_label lbl}:\n`;
 +       match entry with
 +        TocFloat f ->
-+         `     .double {emit_tocentry entry}\n`
++         `    {emit_tocentry entry}\n`
 +       | _ ->
 +          `    .tc     {emit_label lbl}[TC],{emit_tocentry entry}\n`
 +      )
@@ -1101,7 +1134,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64le/proc.ml
-@@ -0,0 +1,240 @@
+@@ -0,0 +1,255 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -1189,11 +1222,11 @@
 +(* Representation of hard registers by pseudo-registers *)
 +
 +let hard_int_reg =
-+  let v = Array.create 23 Reg.dummy in
++  let v = Array.make 23 Reg.dummy in
 +  for i = 0 to 22 do v.(i) <- Reg.at_location Int (Reg i) done; v
 +
 +let hard_float_reg =
-+  let v = Array.create 31 Reg.dummy in
++  let v = Array.make 31 Reg.dummy in
 +  for i = 0 to 30 do v.(i) <- Reg.at_location Float (Reg(100 + i)) done; v
 +
 +let all_phys_regs =
@@ -1209,7 +1242,7 @@
 +
 +let calling_conventions
 +    first_int last_int first_float last_float make_stack stack_ofs arg =
-+  let loc = Array.create (Array.length arg) Reg.dummy in
++  let loc = Array.make (Array.length arg) Reg.dummy in
 +  let int = ref first_int in
 +  let float = ref first_float in
 +  let ofs = ref stack_ofs in
@@ -1263,7 +1296,7 @@
 +
 +let poweropen_external_conventions first_int last_int
 +                                   first_float last_float arg =
-+  let loc = Array.create (Array.length arg) Reg.dummy in
++  let loc = Array.make (Array.length arg) Reg.dummy in
 +  let int = ref first_int in
 +  let float = ref first_float in
 +  let ofs = ref (14 * size_addr) in
@@ -1306,6 +1339,10 @@
 +
 +let loc_exn_bucket = phys_reg 0
 +
++(* Volatile registers: none *)
++
++let regs_are_volatile rs = false
++
 +(* Registers destroyed by operations *)
 +
 +let destroyed_at_c_call =
@@ -1330,6 +1367,17 @@
 +    Iextcall(_, _) -> [| 15; 18 |]
 +  | _ -> [| 23; 30 |]
 +
++(* Pure operations (without any side effect besides updating their result
++   registers). *)
++
++let op_is_pure = function
++  | Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
++  | Iextcall _ | Istackoffset _ | Istore _ | Ialloc _
++  | Iintop(Icheckbound) | Iintop_imm(Icheckbound, _) -> false
++  | Ispecific(Imultaddf | Imultsubf) -> true
++  | Ispecific _ -> false
++  | _ -> true
++
 +(* Layout of the stack *)
 +
 +let num_stack_slots = [| 0; 0 |]
@@ -1369,7 +1417,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64le/scheduling.ml
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,63 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -1400,7 +1448,7 @@
 +  | Iload(_, _) -> 2
 +  | Iconst_float _ -> 2 (* turned into a load *)
 +  | Iconst_symbol _ -> 1
-+  | Iintop Imul -> 9
++  | Iintop(Imul | Imulh) -> 9
 +  | Iintop_imm(Imul, _) -> 5
 +  | Iintop(Idiv | Imod) -> 36
 +  | Iaddf | Isubf -> 4
@@ -1418,12 +1466,10 @@
 +method oper_issue_cycles = function
 +    Iconst_float _ | Iconst_symbol _ -> 2
 +  | Iload(_, Ibased(_, _)) -> 2
-+  | Istore(_, Ibased(_, _)) -> 2
++  | Istore(_, Ibased(_, _), _) -> 2
 +  | Ialloc _ -> 4
 +  | Iintop(Imod) -> 40 (* assuming full stall *)
 +  | Iintop(Icomp _) -> 4
-+  | Iintop_imm(Idiv, _) -> 2
-+  | Iintop_imm(Imod, _) -> 4
 +  | Iintop_imm(Icomp _, _) -> 4
 +  | Ifloatofint -> 9
 +  | Iintoffloat -> 4
@@ -1439,7 +1485,7 @@
 ===================================================================
 --- /dev/null
 +++ ocaml-4.02.0/asmcomp/power64le/selection.ml
-@@ -0,0 +1,101 @@
+@@ -0,0 +1,93 @@
 +(***********************************************************************)
 +(*                                                                     *)
 +(*                           Objective Caml                            *)
@@ -1505,16 +1551,8 @@
 +
 +method! select_operation op args =
 +  match (op, args) with
-+  (* Prevent the recognition of (x / cst) and (x % cst) when cst is not
-+     a power of 2, which do not correspond to an instruction. *)
-+    (Cdivi, [arg; Cconst_int n]) when n = 1 lsl (Misc.log2 n) ->
-+      (Iintop_imm(Idiv, n), [arg])
-+  | (Cdivi, _) ->
-+      (Iintop Idiv, args)
-+  | (Cmodi, [arg; Cconst_int n]) when n = 1 lsl (Misc.log2 n) ->
-+      (Iintop_imm(Imod, n), [arg])
-+  | (Cmodi, _) ->
-+      (Iintop Imod, args)
++  (* PowerPC does not support immediate operands for multiply high *)
++    (Cmulhi, _) -> (Iintop Imulh, args)
 +  (* The and, or and xor instructions have a different range of immediate
 +     operands than the other instructions *)
 +  | (Cand, _) -> self#select_logical Iand args

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to