xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/fortran/target-memory.h (revision 4c3eb207d36f67d31994830c0a694161fc1ca39b)
1627f7eb2Smrg /* Simulate storage of variables into target memory, header.
2*4c3eb207Smrg    Copyright (C) 2007-2020 Free Software Foundation, Inc.
3627f7eb2Smrg    Contributed by Paul Thomas and Brooks Moses
4627f7eb2Smrg 
5627f7eb2Smrg This file is part of GCC.
6627f7eb2Smrg 
7627f7eb2Smrg GCC is free software; you can redistribute it and/or modify it under
8627f7eb2Smrg the terms of the GNU General Public License as published by the Free
9627f7eb2Smrg Software Foundation; either version 3, or (at your option) any later
10627f7eb2Smrg version.
11627f7eb2Smrg 
12627f7eb2Smrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13627f7eb2Smrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
14627f7eb2Smrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15627f7eb2Smrg for more details.
16627f7eb2Smrg 
17627f7eb2Smrg You should have received a copy of the GNU General Public License
18627f7eb2Smrg along with GCC; see the file COPYING3.  If not see
19627f7eb2Smrg <http://www.gnu.org/licenses/>.  */
20627f7eb2Smrg 
21627f7eb2Smrg #ifndef GFC_TARGET_MEMORY_H
22627f7eb2Smrg #define GFC_TARGET_MEMORY_H
23627f7eb2Smrg 
24627f7eb2Smrg /* Convert a BOZ to REAL or COMPLEX.  */
25627f7eb2Smrg bool gfc_convert_boz (gfc_expr *, gfc_typespec *);
26627f7eb2Smrg 
27627f7eb2Smrg bool gfc_element_size (gfc_expr *, size_t *);
28627f7eb2Smrg bool gfc_target_expr_size (gfc_expr *, size_t *);
29627f7eb2Smrg 
30627f7eb2Smrg /* Write a constant expression in binary form to a target buffer.  */
31627f7eb2Smrg size_t gfc_encode_character (int, size_t, const gfc_char_t *, unsigned char *,
32627f7eb2Smrg 			  size_t);
33627f7eb2Smrg unsigned HOST_WIDE_INT gfc_target_encode_expr (gfc_expr *, unsigned char *,
34627f7eb2Smrg 					       size_t);
35627f7eb2Smrg 
36627f7eb2Smrg /* Read a target buffer into a constant expression.  */
37627f7eb2Smrg 
38627f7eb2Smrg int gfc_interpret_integer (int, unsigned char *, size_t, mpz_t);
39627f7eb2Smrg int gfc_interpret_float (int, unsigned char *, size_t, mpfr_t);
40627f7eb2Smrg int gfc_interpret_complex (int, unsigned char *, size_t, mpc_t);
41627f7eb2Smrg int gfc_interpret_logical (int, unsigned char *, size_t, int *);
42627f7eb2Smrg size_t gfc_interpret_character (unsigned char *, size_t, gfc_expr *);
43627f7eb2Smrg int gfc_interpret_derived (unsigned char *, size_t, gfc_expr *);
44627f7eb2Smrg size_t gfc_target_interpret_expr (unsigned char *, size_t, gfc_expr *, bool);
45627f7eb2Smrg 
46627f7eb2Smrg /* Merge overlapping equivalence initializers for trans-common.c. */
47627f7eb2Smrg size_t gfc_merge_initializers (gfc_typespec, gfc_expr *, locus *,
48627f7eb2Smrg 			       unsigned char *, unsigned char *,
49627f7eb2Smrg 			       size_t);
50627f7eb2Smrg 
51627f7eb2Smrg #endif /* GFC_TARGET_MEMORY_H  */
52