Hexagon's software stack

Source: Internet
Author: User
Overview

The hexagon processor includes a dedicated register and instructions to implement the call stack for the subroutine execution.

The structure of the stack follows the traditional C standard.

structure of the stack

The following figure shows the stack structure in the hexagon processor


The address of the stack is defined as extending from a high address to a low address. The pointer sp of the stack points to the top data element in the current stack.

Note: The hexagon processor supports three stacks of instructions: Allocframe,deallocframe and Dealloc_return

The address of the SP register must be 8-bit aligned, primarily for stack instructions to run properly

stack frames provided by the hexagon

The stack is used to hold the stack frame, which is a data structure that holds the state information of the active subroutine in the program (the active subroutine refers to those programs that are called but not returned). Each stack frame corresponds to a subroutine in the program.

The stack frame contains the following elements

Local variables and the address (pressed into the frame pointer register FP) for the previous stack frame on the stack of data subroutine calls used by the quilt program (pushed in from the connection register LR)

The frame pointer register FP always has a stack frame on the stack. This design allows the debugger to check the memory stack to realize the error-checking function of the program, and easily define the calling instruction, function parameters and so on.

Stack Register

The following figure is a stack register graph in the hexagon processor


Note: The stack register is an alias for three general-purpose registers. These general purpose registers are designed for use with stack registers.


Stack Instructions

The following figure is the specific meaning and operation of the three instructions given by Qualcomm:


Note: Allocframe and Deallocframe will import and save the LR and FR registers to be saved in a single aligned 64-bit register.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.