1b4063e
From f1be77d69e28ad3bd128c6c757d966e90bbf73d3 Mon Sep 17 00:00:00 2001
2730b0f
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
2730b0f
Date: Thu, 10 Nov 2016 14:12:53 +0100
7a76b44
Subject: [PATCH 08/11] Try fix for andi/ori/xori immediates (#1)
2730b0f
2730b0f
---
2730b0f
 asmcomp/riscv/selection.ml | 13 -------------
2730b0f
 1 file changed, 13 deletions(-)
2730b0f
2730b0f
diff --git a/asmcomp/riscv/selection.ml b/asmcomp/riscv/selection.ml
7a76b44
index 60ec5cb4e..ad2b26e9b 100644
2730b0f
--- a/asmcomp/riscv/selection.ml
2730b0f
+++ b/asmcomp/riscv/selection.ml
2730b0f
@@ -36,11 +36,6 @@ method! select_operation op args =
2730b0f
   match (op, args) with
2730b0f
   (* RISC-V does not support immediate operands for multiply high *)
2730b0f
   | (Cmulhi, _) -> (Iintop Imulh, args)
2730b0f
-  (* The and, or and xor instructions have a different range of immediate
2730b0f
-     operands than the other instructions *)
2730b0f
-  | (Cand, _) -> self#select_logical Iand args
2730b0f
-  | (Cor, _) -> self#select_logical Ior args
2730b0f
-  | (Cxor, _) -> self#select_logical Ixor args
2730b0f
   (* Recognize (neg-)mult-add and (neg-)mult-sub instructions *)
2730b0f
   | (Caddf, [Cop(Cmulf, [arg1; arg2]); arg3])
2730b0f
   | (Caddf, [arg3; Cop(Cmulf, [arg1; arg2])]) ->
2730b0f
@@ -58,14 +53,6 @@ method! select_operation op args =
2730b0f
   | _ ->
2730b0f
       super#select_operation op args
2730b0f
 
2730b0f
-method select_logical op = function
2730b0f
-  | [arg; Cconst_int n] when n >= 0 && n <= 0xFFF ->
2730b0f
-      (Iintop_imm(op, n), [arg])
2730b0f
-  | [Cconst_int n; arg] when n >= 0 && n <= 0xFFF ->
2730b0f
-      (Iintop_imm(op, n), [arg])
2730b0f
-  | args ->
2730b0f
-      (Iintop op, args)
2730b0f
-
2730b0f
 (* Instruction selection for conditionals *)
2730b0f
 
2730b0f
 method! select_condition = function
2730b0f
-- 
7a76b44
2.13.1
2730b0f