riscv64: Fix intermediate operands.

(https://github.com/nojb/riscv-ocaml/issues/1)
This commit is contained in:
Richard W.M. Jones 2016-11-11 12:13:42 +00:00
parent 746dc88032
commit 2730b0fa32
8 changed files with 57 additions and 7 deletions

View File

@ -1,7 +1,7 @@
From fc5ac0d955afce294fe58a20cab8e9dda572de78 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 24 Jun 2014 10:00:15 +0100
Subject: [PATCH 1/6] Don't add rpaths to libraries.
Subject: [PATCH 1/7] Don't add rpaths to libraries.
---
tools/Makefile.shared | 6 +++---

View File

@ -1,7 +1,7 @@
From 61bdb02cedd1be6ecdc37bc4a80ffe3f19aa5521 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:40:36 +0100
Subject: [PATCH 2/6] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Subject: [PATCH 2/7] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Debian, sent upstream.
See:

View File

@ -1,7 +1,7 @@
From 2f93494aea56c9216bb561800a6861b653f409ce Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:44:18 +0100
Subject: [PATCH 3/6] configure: Allow user defined C compiler flags.
Subject: [PATCH 3/7] configure: Allow user defined C compiler flags.
---
configure | 4 ++++

View File

@ -1,7 +1,7 @@
From cdd42ba82210bfaa97cfa010eaac3d805b80cb49 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 3 Nov 2016 19:50:20 +0000
Subject: [PATCH 4/6] Don't rewrite -Werror.
Subject: [PATCH 4/7] Don't rewrite -Werror.
In Fedora our CFLAGS contains -Wall -Werror=format-security.

View File

@ -1,7 +1,7 @@
From 4d586c823b021c3091aab7bb3f88f1678c194558 Mon Sep 17 00:00:00 2001
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
Date: Fri, 4 Nov 2016 20:39:09 +0100
Subject: [PATCH 5/6] RISC-V support 2016-11-08
Subject: [PATCH 5/7] RISC-V support 2016-11-08
This commit contains the squashed commits from:

View File

@ -1,7 +1,7 @@
From d82ea2b77261e030be5a75d0277ce5b62b52b751 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 9 Nov 2016 11:01:15 -0500
Subject: [PATCH 6/6] PR#7405: s390x: Fix address of caml_raise_exn in native
Subject: [PATCH 6/7] PR#7405: s390x: Fix address of caml_raise_exn in native
dynlink modules.
This commit started as Fedora patch e732c39340e86939530a087744caa8d8f1247878.

View File

@ -0,0 +1,44 @@
From fcb3b532e59bef94af09047b0199a1c32caeaa27 Mon Sep 17 00:00:00 2001
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
Date: Thu, 10 Nov 2016 14:12:53 +0100
Subject: [PATCH 7/7] Try fix for andi/ori/xori immediates (#1)
(cherry picked from commit 4e01c71358c8f7571914c09369a402e6e290f6c9)
---
asmcomp/riscv/selection.ml | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/asmcomp/riscv/selection.ml b/asmcomp/riscv/selection.ml
index da69f09..a1cbb82 100644
--- a/asmcomp/riscv/selection.ml
+++ b/asmcomp/riscv/selection.ml
@@ -36,11 +36,6 @@ method! select_operation op args =
match (op, args) with
(* RISC-V 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
- | (Cor, _) -> self#select_logical Ior args
- | (Cxor, _) -> self#select_logical Ixor args
(* Recognize (neg-)mult-add and (neg-)mult-sub instructions *)
| (Caddf, [Cop(Cmulf, [arg1; arg2]); arg3])
| (Caddf, [arg3; Cop(Cmulf, [arg1; arg2])]) ->
@@ -58,14 +53,6 @@ method! select_operation op args =
| _ ->
super#select_operation op args
-method select_logical op = function
- | [arg; Cconst_int n] when n >= 0 && n <= 0xFFF ->
- (Iintop_imm(op, n), [arg])
- | [Cconst_int n; arg] when n >= 0 && n <= 0xFFF ->
- (Iintop_imm(op, n), [arg])
- | args ->
- (Iintop op, args)
-
(* Instruction selection for conditionals *)
method! select_condition = function
--
2.9.3

View File

@ -27,7 +27,7 @@
Name: ocaml
Version: 4.04.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: OCaml compiler and programming environment
@ -64,6 +64,8 @@ Patch0004: 0004-Don-t-rewrite-Werror.patch
# https://github.com/nojb/riscv-ocaml
Patch0005: 0005-RISC-V-support-2016-11-08.patch
Patch0006: 0006-PR-7405-s390x-Fix-address-of-caml_raise_exn-in-nativ.patch
# https://github.com/nojb/riscv-ocaml/issues/1
Patch0007: 0007-Try-fix-for-andi-ori-xori-immediates-1.patch
BuildRequires: binutils-devel
BuildRequires: ncurses-devel
@ -440,6 +442,10 @@ fi
%changelog
* Fri Nov 11 2016 Richard W.M. Jones <rjones@redhat.com> - 4.04.0-4
- riscv64: Fix intermediate operands.
(https://github.com/nojb/riscv-ocaml/issues/1)
* Wed Nov 09 2016 Richard W.M. Jones <rjones@redhat.com> - 4.04.0-3
- s390x: Fix address of caml_raise_exn in native dynlink modules.
(https://caml.inria.fr/mantis/view.php?id=7405)