aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Machine.ml
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-03-10 10:12:34 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-03-10 10:12:34 +0000
commit191906d10aa084bc6077ef3f6503fd2dacac67a1 (patch)
treefd2feb5af279c9d2b8e0a31607d713a1d877c439 /cparser/Machine.ml
parenta9578873a5bdf14c47650cc3dd9d21e3bcef2370 (diff)
downloadcompcert-kvx-191906d10aa084bc6077ef3f6503fd2dacac67a1.tar.gz
compcert-kvx-191906d10aa084bc6077ef3f6503fd2dacac67a1.zip
Bitfields: MSB-to-LSB in addition to LSB-to-MSB
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1600 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Machine.ml')
-rw-r--r--cparser/Machine.ml24
1 files changed, 19 insertions, 5 deletions
diff --git a/cparser/Machine.ml b/cparser/Machine.ml
index 21b3daa4..ffff5fbd 100644
--- a/cparser/Machine.ml
+++ b/cparser/Machine.ml
@@ -39,7 +39,8 @@ type t = {
alignof_double: int;
alignof_longdouble: int;
alignof_void: int option;
- alignof_fun: int option
+ alignof_fun: int option;
+ bitfields_msb_first: bool
}
let ilp32ll64 = {
@@ -66,7 +67,8 @@ let ilp32ll64 = {
alignof_double = 8;
alignof_longdouble = 16;
alignof_void = None;
- alignof_fun = None
+ alignof_fun = None;
+ bitfields_msb_first = false
}
let i32lpll64 = {
@@ -93,7 +95,8 @@ let i32lpll64 = {
alignof_double = 8;
alignof_longdouble = 16;
alignof_void = None;
- alignof_fun = None
+ alignof_fun = None;
+ bitfields_msb_first = false
}
let il32pll64 = {
@@ -120,15 +123,26 @@ let il32pll64 = {
alignof_double = 8;
alignof_longdouble = 16;
alignof_void = None;
- alignof_fun = None
+ alignof_fun = None;
+ bitfields_msb_first = false
}
-let make_char_signed c = {c with char_signed = true}
+(* Canned configurations for some ABIs *)
+
+let x86_32 = { ilp32ll64 with char_signed = true }
+let x86_64 = { i32lpll64 with char_signed = true }
+let win64 = { il32pll64 with char_signed = true }
+let ppc_32_bigendian = { ilp32ll64 with bitfields_msb_first = true }
+let arm_littleendian = ilp32ll64
+
+(* Add GCC extensions re: sizeof and alignof *)
let gcc_extensions c =
{ c with sizeof_void = Some 1; sizeof_fun = Some 1;
alignof_void = Some 1; alignof_fun = Some 1 }
+(* Default configuration *)
+
let config =
ref (match Sys.word_size with
| 32 -> ilp32ll64