]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gccint/target-macros/defining-the-output-assembler-language/output-of-data.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gccint / target-macros / defining-the-output-assembler-language / output-of-data.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. _data-output:
7
8 Output of Data
9 ^^^^^^^^^^^^^^
10
11 .. include:: ../tm.rst.in
12 :start-after: [TARGET_ASM_BYTE_OP]
13 :end-before: [TARGET_ASM_BYTE_OP]
14
15
16 .. include:: ../tm.rst.in
17 :start-after: [TARGET_ASM_INTEGER]
18 :end-before: [TARGET_ASM_INTEGER]
19
20
21 .. include:: ../tm.rst.in
22 :start-after: [TARGET_ASM_DECL_END]
23 :end-before: [TARGET_ASM_DECL_END]
24
25
26 .. include:: ../tm.rst.in
27 :start-after: [TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA]
28 :end-before: [TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA]
29
30
31 .. c:macro:: ASM_OUTPUT_ASCII (stream, ptr, len)
32
33 A C statement to output to the stdio stream :samp:`{stream}` an assembler
34 instruction to assemble a string constant containing the :samp:`{len}`
35 bytes at :samp:`{ptr}`. :samp:`{ptr}` will be a C expression of type
36 ``char *`` and :samp:`{len}` a C expression of type ``int``.
37
38 If the assembler has a ``.ascii`` pseudo-op as found in the
39 Berkeley Unix assembler, do not define the macro
40 ``ASM_OUTPUT_ASCII``.
41
42 .. c:macro:: ASM_OUTPUT_FDESC (stream, decl, n)
43
44 A C statement to output word :samp:`{n}` of a function descriptor for
45 :samp:`{decl}`. This must be defined if ``TARGET_VTABLE_USES_DESCRIPTORS``
46 is defined, and is otherwise unused.
47
48 .. c:macro:: CONSTANT_POOL_BEFORE_FUNCTION
49
50 You may define this macro as a C expression. You should define the
51 expression to have a nonzero value if GCC should output the constant
52 pool for a function before the code for the function, or a zero value if
53 GCC should output the constant pool after the function. If you do
54 not define this macro, the usual case, GCC will output the constant
55 pool before the function.
56
57 .. c:macro:: ASM_OUTPUT_POOL_PROLOGUE (file, funname, fundecl, size)
58
59 A C statement to output assembler commands to define the start of the
60 constant pool for a function. :samp:`{funname}` is a string giving
61 the name of the function. Should the return type of the function
62 be required, it can be obtained via :samp:`{fundecl}`. :samp:`{size}`
63 is the size, in bytes, of the constant pool that will be written
64 immediately after this call.
65
66 If no constant-pool prefix is required, the usual case, this macro need
67 not be defined.
68
69 .. c:macro:: ASM_OUTPUT_SPECIAL_POOL_ENTRY (file, x, mode, align, labelno, jumpto)
70
71 A C statement (with or without semicolon) to output a constant in the
72 constant pool, if it needs special treatment. (This macro need not do
73 anything for RTL expressions that can be output normally.)
74
75 The argument :samp:`{file}` is the standard I/O stream to output the
76 assembler code on. :samp:`{x}` is the RTL expression for the constant to
77 output, and :samp:`{mode}` is the machine mode (in case :samp:`{x}` is a
78 :samp:`const_int`). :samp:`{align}` is the required alignment for the value
79 :samp:`{x}` ; you should output an assembler directive to force this much
80 alignment.
81
82 The argument :samp:`{labelno}` is a number to use in an internal label for
83 the address of this pool entry. The definition of this macro is
84 responsible for outputting the label definition at the proper place.
85 Here is how to do this:
86
87 .. code-block:: c++
88
89 (*targetm.asm_out.internal_label) (file, "LC", labelno);
90
91 When you output a pool entry specially, you should end with a
92 ``goto`` to the label :samp:`{jumpto}`. This will prevent the same pool
93 entry from being output a second time in the usual manner.
94
95 You need not define this macro if it would do nothing.
96
97 .. c:macro:: ASM_OUTPUT_POOL_EPILOGUE (file funname, fundecl size)
98
99 A C statement to output assembler commands to at the end of the constant
100 pool for a function. :samp:`{funname}` is a string giving the name of the
101 function. Should the return type of the function be required, you can
102 obtain it via :samp:`{fundecl}`. :samp:`{size}` is the size, in bytes, of the
103 constant pool that GCC wrote immediately before this call.
104
105 If no constant-pool epilogue is required, the usual case, you need not
106 define this macro.
107
108 .. c:macro:: IS_ASM_LOGICAL_LINE_SEPARATOR (C, STR)
109
110 Define this macro as a C expression which is nonzero if :samp:`{C}` is
111 used as a logical line separator by the assembler. :samp:`{STR}` points
112 to the position in the string where :samp:`{C}` was found; this can be used if
113 a line separator uses multiple characters.
114
115 If you do not define this macro, the default is that only
116 the character :samp:`;` is treated as a logical line separator.
117
118 .. c:var:: const char * TARGET_ASM_OPEN_PAREN
119
120 .. include:: ../tm.rst.in
121 :start-after: [TARGET_ASM_OPEN_PAREN]
122 :end-before: [TARGET_ASM_OPEN_PAREN]
123
124
125 These macros are provided by :samp:`real.h` for writing the definitions
126 of ``ASM_OUTPUT_DOUBLE`` and the like:
127
128 .. c:macro:: REAL_VALUE_TO_TARGET_SINGLE (x, l)
129 REAL_VALUE_TO_TARGET_DOUBLE (x, l)
130 REAL_VALUE_TO_TARGET_LONG_DOUBLE (x, l)
131 REAL_VALUE_TO_TARGET_DECIMAL32 (x, l)
132 REAL_VALUE_TO_TARGET_DECIMAL64 (x, l)
133 REAL_VALUE_TO_TARGET_DECIMAL128 (x, l)
134
135 These translate :samp:`{x}`, of type ``REAL_VALUE_TYPE``, to the
136 target's floating point representation, and store its bit pattern in
137 the variable :samp:`{l}`. For ``REAL_VALUE_TO_TARGET_SINGLE`` and
138 ``REAL_VALUE_TO_TARGET_DECIMAL32``, this variable should be a
139 simple ``long int``. For the others, it should be an array of
140 ``long int``. The number of elements in this array is determined
141 by the size of the desired target floating point data type: 32 bits of
142 it go in each ``long int`` array element. Each array element holds
143 32 bits of the result, even if ``long int`` is wider than 32 bits
144 on the host machine.
145
146 The array element values are designed so that you can print them out
147 using ``fprintf`` in the order they should appear in the target
148 machine's memory.