summaryrefslogtreecommitdiffstats
path: root/spec/rtems/basedefs/req/predict-false-0.yml
blob: aa88bc51b2405d0befd13f2373a09d780fc90e01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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: interface-function
  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