Skip to main content

IAR Embedded Workbench for RH850 3.20.x

Call frame information directives for tracking resources and CFAs

In this section:
Syntax

CFI cfa { resource | resource + constant | resource - constant }

CFI cfacfiexpr

CFI resource { UNDEFINED | SAMEVALUE | CONCAT }

CFI resource { resource | FRAME(cfa, offset) }

CFI resourcecfiexpr

Parameters

cfa

The name of a CFA (canonical frame address).

cfiexpr

A CFI expression, which can be one of these:

  • A CFI operator with operands

  • A numeric constant

  • A CFA name

  • A resource name.

constant

A constant value or an assembler expression that can be evaluated to a constant value.

offset

The offset relative the CFA. An integer with an optional sign.

resource

The name of a resource.

Unary operators

Overall syntax: OPERATOR(operand)

CFI operator

Operand

Description

COMPLEMENT

cfiexpr

Performs a bitwise NOT on a CFI expression.

LITERAL

expr

Get the value of the assembler expression. This can insert the value of a regular assembler expression into a CFI expression.

NOT

cfiexpr

Negates a logical CFI expression.

UMINUS

cfiexpr

Performs arithmetic negation on a CFI expression.

Table 135. Unary operators in CFI expressions 


Binary operators

Overall syntax: OPERATOR(operand1,operand2)

CFI operator

Operands

Description

ADD

cfiexpr,cfiexpr

Addition

AND

cfiexpr,cfiexpr

Bitwise AND

DIV

cfiexpr,cfiexpr

Division

EQ

cfiexpr,cfiexpr

Equal to

GE

cfiexpr,cfiexpr

Greater than or equal to

GT

cfiexpr,cfiexpr

Greater than

LE

cfiexpr,cfiexpr

Less than or equal to

LSHIFT

cfiexpr,cfiexpr

Logical shift left of the left operand. The number of bits to shift is specified by the right operand. The sign bit will not be preserved when shifting.

LT

cfiexpr,cfiexpr

Less than

MOD

cfiexpr,cfiexpr

Modulo

MUL

cfiexpr,cfiexpr

Multiplication

NE

cfiexpr,cfiexpr

Not equal to

OR

cfiexpr,cfiexpr

Bitwise OR

RSHIFTA

cfiexpr,cfiexpr

Arithmetic shift right of the left operand. The number of bits to shift is specified by the right operand. In contrast with RSHIFTL, the sign bit is preserved when shifting.

RSHIFTL

cfiexpr,cfiexpr

Logical shift right of the left operand. The number of bits to shift is specified by the right operand. The sign bit will not be preserved when shifting.

SUB

cfiexpr,cfiexpr

Subtraction

XOR

cfiexpr,cfiexpr

Bitwise XOR

Table 136. Binary operators in CFI expressions 


Ternary operators

Overall syntax: OPERATOR(operand1,operand2,operand3)

Operator

Operands

Description

FRAME

cfa,size,offset

Gets the value from a stack frame. The operands are:

cfa, an identifier that denotes a previously declared CFA.

size, a constant expression that denotes a size in bytes.

offset, a constant expression that denotes a size in bytes.

Gets the value at address cfa+offset of size size.

IF

cond,true,false

Conditional operator. The operands are:

cond, a CFI expression that denotes a condition.

true, any CFI expression.

false, any CFI expression.

If the conditional expression is non-zero, the result is the value of the true expression; otherwise the result is the value of the false expression.

LOAD

size,type,addr

Gets the value from memory. The operands are:

size, a constant expression that denotes a size in bytes.

type, a memory type.

addr, a CFI expression that denotes a memory address.

Gets the value at address addr in the segment memory type type of size size.

Table 137. Ternary operators in CFI expressions 


Description

Use these directives to track resources and CFAs in common blocks and data blocks:

Directive

Description

CFI cfa

Declares the value of a CFA.

CFI resource

Declares the value of a resource.

Table 138. Call frame information directives for tracking resources and CFAs 


Example

Examples of using CFI directives

See also

Tracking call frame usage