diff options
author | Frank Kühndel <frank.kuehndel@embedded-brains.de> | 2020-12-02 11:17:34 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-12-09 08:13:51 +0100 |
commit | 6856765a1d447ef914887a8279b3e12ac8775dee (patch) | |
tree | 703b5fc092314eeed7fd4f262c2b7e7cccff95cb /spec/rtems/basedefs/req/predict-false-0.yml | |
parent | config.yml: Add extra file (diff) | |
download | rtems-central-6856765a1d447ef914887a8279b3e12ac8775dee.tar.bz2 |
spec: Requirements and validation for basedefs.h
Diffstat (limited to 'spec/rtems/basedefs/req/predict-false-0.yml')
-rw-r--r-- | spec/rtems/basedefs/req/predict-false-0.yml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/rtems/basedefs/req/predict-false-0.yml b/spec/rtems/basedefs/req/predict-false-0.yml new file mode 100644 index 00000000..4d05c771 --- /dev/null +++ b/spec/rtems/basedefs/req/predict-false-0.yml @@ -0,0 +1,24 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/predict-false +non-functional-type: interface +rationale: | + Example: ``if ( ${../if/predict-false:/name}( -1 == i ) ) { ... }``. + The GNU C compiler uses this information for branch optimization. + ``builtin-expect-probability`` defaults to 90%. +references: [] +requirement-type: non-functional +text: | + When the code is compiled with the GNU C compiler, + and the ${../if/predict-false:/name} macro is used as a conditional + in ``if``-expressions and loop expressions, + and ${../if/predict-false:/params[0]/name} after undergoing all possible C + pre-processor substitutions is an integral expression, + the macro shall cause the compiler to assume that by the percentage of + cases defined by ``builtin-expect-probability`` the expression evaluates + to 0. +type: requirement |