aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@imgtec.com>2023-06-06 14:53:36 +0800
committerYunQiang Su <yunqiang.su@cipunited.com>2023-06-16 17:23:29 +0800
commit6586422105eeda80f9129f97024ae46fd9da4bc5 (patch)
treeabba1e8860926a74af436f141b96322b62007d39 /gcc/doc
parent827e208fa64771f15fc8e53970a2297e637277b5 (diff)
downloadgcc-6586422105eeda80f9129f97024ae46fd9da4bc5.zip
gcc-6586422105eeda80f9129f97024ae46fd9da4bc5.tar.gz
gcc-6586422105eeda80f9129f97024ae46fd9da4bc5.tar.bz2
MIPS16: Implement `code_readable` function attribute.
Support for __attribute__ ((code_readable)). Takes up to one argument of "yes", "no", "pcrel". This will change the code readability setting for just that function. If no argument is supplied, then the setting is 'yes'. gcc/ChangeLog: * config/mips/mips.cc (enum mips_code_readable_setting):New enmu. (mips_handle_code_readable_attr):New static function. (mips_get_code_readable_attr):New static enum function. (mips_set_current_function):Set the code_readable mode. (mips_option_override):Same as above. * doc/extend.texi:Document code_readable. gcc/testsuite/ChangeLog: * gcc.target/mips/code-readable-attr-1.c: New test. * gcc.target/mips/code-readable-attr-2.c: New test. * gcc.target/mips/code-readable-attr-3.c: New test. * gcc.target/mips/code-readable-attr-4.c: New test. * gcc.target/mips/code-readable-attr-5.c: New test.
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index cdbd4b3..e01e244 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -5670,6 +5670,23 @@ command line (@pxref{MIPS Options}).
This function attribute instructs the compiler to generate a hazard barrier
return that clears all execution and instruction hazards while returning,
instead of generating a normal return instruction.
+
+@item code_readable
+@cindex @code{code_readable} function attribute, MIPS
+For MIPS targets that support PC-relative addressing modes, this attribute
+can be used to control how an object is addressed. The attribute takes
+a single optional argument:
+
+@table @samp
+@item no
+The function should not read the instruction stream as data.
+@item yes
+The function can read the instruction stream as data.
+@item pcrel
+The function can read the instruction stream in a pc-relative mode.
+@end table
+
+If there is no argument supplied, the default of @code{"yes"} applies.
@end table
@node MSP430 Function Attributes