Follow these guidelines when using the stack unwind directives:
Place stack unwind directives between the unwind entry point of the function declared in .proc and .endp.
The first directive in each region in a procedure must be one of the following region header directives, .prologue or .body.
The first directive in the procedure must point to the same address as the first unwind entry point of the function.
No two consecutive prologue regions are allowed.
When none of the stack unwind directives listed in the Stack Unwind Directives table are specified, optionally use the .unwentry directive to create an unwind entry for the function. Do not use this directive if the unwind records are filled by the compiler.
Use tags only within the current region. A tag operand cannot be specified out of the scope region. If a tag is omitted, the directive refers to the next instruction, which resides in the same region.
Use only one .personality directive at any point within each procedure.
Always precede the .handlerdata directive with the .personality directive.
Follow these guidelines for prologue regions:
— Use one of the following frame directives if the procedure creates a new stack frame: .fframe, .vframe, or .vframesp.
— Use each of the .save directives only once. For example: .save rp, ar.pfs, ar.unat, ar.lc, and pr.
— Multiple usage of the directives, .save.g, .save.f, .save.b, and .save.gf is allowed. The number of bits set in the bit-mask operand specifies the number of the consecutive save instructions that immediately follow the directive.
— A single unwind record is built for one or more occurrences of the following directives: .save.g, .save.f, .save.b, and .save.gf. The bit-mask field of the record is a bitwise OR of all the masks that appear in the directives.
— Use only one .save.b with the gr-location operand.
— Use only one .spill directive.
— The .prologue <imm_mask> directive with the psp bit set and the .vframe directive both define the psp location. Use only one of them.
Use only one .restore directive for body regions.