aboutsummaryrefslogtreecommitdiffstats
path: root/backend/LTL.v
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2016-10-01 17:25:18 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2016-10-01 17:25:18 +0200
commite637d041c5c2ee3a3ed395a7dab6c9101e8eb16c (patch)
tree518d558674d3e1c6ff41c46d84c784e727ed5d04 /backend/LTL.v
parentad2a2c862abef3aee701d1bca0524fcbf2d07b30 (diff)
downloadcompcert-kvx-e637d041c5c2ee3a3ed395a7dab6c9101e8eb16c.tar.gz
compcert-kvx-e637d041c5c2ee3a3ed395a7dab6c9101e8eb16c.zip
Support for 64-bit architectures: generic support
- Introduce Archi.ptr64 parameter. - Define module Ptrofs of integers as wide as a pointer (64 if Archi.ptr64, 32 otherwise). - Use Ptrofs.int as the offset type for Vptr values and anywhere pointer offsets are manipulated. - Modify Val operations that handle pointers (e.g. Val.add, Val.sub, Val.cmpu) so that in 64-bit pointer mode it is the "long" operation (e.g. Val.addl, Val.subl, Val.cmplu) that handles pointers. - Update the memory model accordingly. - Modify C operations that handle pointers (e.g. addition, subtraction, comparisons) accordingly. - Make it possible to turn off the splitting of 64-bit integers into pairs of 32-bit integers. - Update the compiler front-end and back-end accordingly.
Diffstat (limited to 'backend/LTL.v')
-rw-r--r--backend/LTL.v21
1 files changed, 6 insertions, 15 deletions
diff --git a/backend/LTL.v b/backend/LTL.v
index 5f7116ae..8567a891 100644
--- a/backend/LTL.v
+++ b/backend/LTL.v
@@ -15,18 +15,9 @@
LTL (``Location Transfer Language'') is the target language
for register allocation and the source language for linearization. *)
-Require Import Coqlib.
-Require Import Maps.
-Require Import AST.
-Require Import Integers.
-Require Import Values.
-Require Import Events.
-Require Import Memory.
-Require Import Globalenvs.
-Require Import Smallstep.
-Require Import Op.
-Require Import Locations.
-Require Import Conventions.
+Require Import Coqlib Maps.
+Require Import AST Integers Values Events Memory Globalenvs Smallstep.
+Require Import Op Locations Conventions.
(** * Abstract syntax *)
@@ -233,7 +224,7 @@ Inductive step: state -> trace -> state -> Prop :=
find_function ros rs' = Some fd ->
funsig fd = sig ->
Mem.free m sp 0 f.(fn_stacksize) = Some m' ->
- step (Block s f (Vptr sp Int.zero) (Ltailcall sig ros :: bb) rs m)
+ step (Block s f (Vptr sp Ptrofs.zero) (Ltailcall sig ros :: bb) rs m)
E0 (Callstate s fd rs' m')
| exec_Lbuiltin: forall s f sp ef args res bb rs m vargs t vres rs' m',
eval_builtin_args ge rs sp m args vargs ->
@@ -258,13 +249,13 @@ Inductive step: state -> trace -> state -> Prop :=
E0 (State s f sp pc rs' m)
| exec_Lreturn: forall s f sp bb rs m m',
Mem.free m sp 0 f.(fn_stacksize) = Some m' ->
- step (Block s f (Vptr sp Int.zero) (Lreturn :: bb) rs m)
+ step (Block s f (Vptr sp Ptrofs.zero) (Lreturn :: bb) rs m)
E0 (Returnstate s (return_regs (parent_locset s) rs) m')
| exec_function_internal: forall s f rs m m' sp rs',
Mem.alloc m 0 f.(fn_stacksize) = (m', sp) ->
rs' = undef_regs destroyed_at_function_entry (call_regs rs) ->
step (Callstate s (Internal f) rs m)
- E0 (State s f (Vptr sp Int.zero) f.(fn_entrypoint) rs' m')
+ E0 (State s f (Vptr sp Ptrofs.zero) f.(fn_entrypoint) rs' m')
| exec_function_external: forall s ef t args res rs m rs' m',
args = map (fun p => Locmap.getpair p rs) (loc_arguments (ef_sig ef)) ->
external_call ef ge args m t res m' ->