4c52516
From df5201a35d02a13ad7ffd6fb38252851910cae43 Mon Sep 17 00:00:00 2001
a7ead0b
From: "Richard W.M. Jones" <rjones@redhat.com>
a7ead0b
Date: Fri, 24 Oct 2014 10:10:54 +0100
5b56684
Subject: [PATCH 15/18] ppc64/ppc64le: proc: Interim definitions for op_is_pure
a7ead0b
 and regs_are_volatile.
a7ead0b
a7ead0b
See: https://bugzilla.redhat.com/show_bug.cgi?id=1156300
a7ead0b
a7ead0b
These are based somewhat on guesswork and need to be checked by
a7ead0b
someone more familiar with the compiler and POWER architecture.
a7ead0b
---
a7ead0b
 asmcomp/power64/proc.ml   | 15 +++++++++++++++
a7ead0b
 asmcomp/power64le/proc.ml | 15 +++++++++++++++
a7ead0b
 2 files changed, 30 insertions(+)
a7ead0b
a7ead0b
diff --git a/asmcomp/power64/proc.ml b/asmcomp/power64/proc.ml
c4dd5fe
index a5a35f3..c377f69 100644
a7ead0b
--- a/asmcomp/power64/proc.ml
a7ead0b
+++ b/asmcomp/power64/proc.ml
a7ead0b
@@ -202,6 +202,10 @@ let loc_external_results res =
a7ead0b
 
a7ead0b
 let loc_exn_bucket = phys_reg 0
a7ead0b
 
a7ead0b
+(* Volatile registers: none *)
a7ead0b
+
a7ead0b
+let regs_are_volatile rs = false
a7ead0b
+
a7ead0b
 (* Registers destroyed by operations *)
a7ead0b
 
a7ead0b
 let destroyed_at_c_call =
a7ead0b
@@ -226,6 +230,17 @@ let max_register_pressure = function
a7ead0b
     Iextcall(_, _) -> [| 15; 18 |]
a7ead0b
   | _ -> [| 23; 30 |]
a7ead0b
 
a7ead0b
+(* Pure operations (without any side effect besides updating their result
a7ead0b
+   registers). *)
a7ead0b
+
a7ead0b
+let op_is_pure = function
a7ead0b
+  | Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
a7ead0b
+  | Iextcall _ | Istackoffset _ | Istore _ | Ialloc _
a7ead0b
+  | Iintop(Icheckbound) | Iintop_imm(Icheckbound, _) -> false
a7ead0b
+  | Ispecific(Imultaddf | Imultsubf) -> true
a7ead0b
+  | Ispecific _ -> false
a7ead0b
+  | _ -> true
a7ead0b
+
a7ead0b
 (* Layout of the stack *)
a7ead0b
 
a7ead0b
 let num_stack_slots = [| 0; 0 |]
a7ead0b
diff --git a/asmcomp/power64le/proc.ml b/asmcomp/power64le/proc.ml
c4dd5fe
index 476c984..56473ac 100644
a7ead0b
--- a/asmcomp/power64le/proc.ml
a7ead0b
+++ b/asmcomp/power64le/proc.ml
a7ead0b
@@ -202,6 +202,10 @@ let loc_external_results res =
a7ead0b
 
a7ead0b
 let loc_exn_bucket = phys_reg 0
a7ead0b
 
a7ead0b
+(* Volatile registers: none *)
a7ead0b
+
a7ead0b
+let regs_are_volatile rs = false
a7ead0b
+
a7ead0b
 (* Registers destroyed by operations *)
a7ead0b
 
a7ead0b
 let destroyed_at_c_call =
a7ead0b
@@ -226,6 +230,17 @@ let max_register_pressure = function
a7ead0b
     Iextcall(_, _) -> [| 15; 18 |]
a7ead0b
   | _ -> [| 23; 30 |]
a7ead0b
 
a7ead0b
+(* Pure operations (without any side effect besides updating their result
a7ead0b
+   registers). *)
a7ead0b
+
a7ead0b
+let op_is_pure = function
a7ead0b
+  | Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
a7ead0b
+  | Iextcall _ | Istackoffset _ | Istore _ | Ialloc _
a7ead0b
+  | Iintop(Icheckbound) | Iintop_imm(Icheckbound, _) -> false
a7ead0b
+  | Ispecific(Imultaddf | Imultsubf) -> true
a7ead0b
+  | Ispecific _ -> false
a7ead0b
+  | _ -> true
a7ead0b
+
a7ead0b
 (* Layout of the stack *)
a7ead0b
 
a7ead0b
 let num_stack_slots = [| 0; 0 |]
a7ead0b
-- 
23620d4
2.3.1
a7ead0b