Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

CBuiltins.ml 2.04 KB
Newer Older
1
2
3
4
5
6
7
8
(* *********************************************************************)
(*                                                                     *)
(*              The Compcert verified compiler                         *)
(*                                                                     *)
(*          Xavier Leroy, INRIA Paris-Rocquencourt                     *)
(*                                                                     *)
(*  Copyright Institut National de Recherche en Informatique et en     *)
(*  Automatique.  All rights reserved.  This file is distributed       *)
9
10
11
12
13
(*  under the terms of the GNU Lesser General Public License as        *)
(*  published by the Free Software Foundation, either version 2.1 of   *)
(*  the License, or  (at your option) any later version.               *)
(*  This file is also distributed under the terms of the               *)
(*  INRIA Non-Commercial License Agreement.                            *)
14
15
16
17
18
19
20
21
(*                                                                     *)
(* *********************************************************************)

(* Processor-dependent builtin C functions *)

open C

let builtins = {
22
  builtin_typedefs = [
23
24
    "__builtin_va_list", TPtr(TVoid [], [])
  ];
25
  builtin_functions = [
26
27
28
29
30
31
32
33
34
    (* Memory accesses *)
    "__builtin_read16_reversed",
      (TInt(IUShort, []), [TPtr(TInt(IUShort, [AConst]), [])], false);
    "__builtin_read32_reversed",
      (TInt(IUInt, []), [TPtr(TInt(IUInt, [AConst]), [])], false);
    "__builtin_write16_reversed",
      (TVoid [], [TPtr(TInt(IUShort, []), []); TInt(IUShort, [])], false);
    "__builtin_write32_reversed",
      (TVoid [], [TPtr(TInt(IUInt, []), []); TInt(IUInt, [])], false);
xleroy's avatar
xleroy committed
35
    (* Synchronization *)
36
37
    "__builtin_dmb",
      (TVoid [], [], false);
xleroy's avatar
xleroy committed
38
39
40
    "__builtin_dsb",
      (TVoid [], [], false);
    "__builtin_isb",
41
      (TVoid [], [], false)
42
  ]
43
44
}

45
let size_va_list = 4
46
let va_list_scalar = true
47
48
49
50

(* Expand memory references inside extended asm statements.  Used in C2C. *)

let asm_mem_argument arg = Printf.sprintf "[%s, #0]" arg