Compilation optimization method for loongson-based 3A vector memory access
A vector and memory access technology, applied in the field of compilation optimization and back-end code generation based on Loongson 3A vector memory access, can solve problems such as inability to compile and optimize, and achieve the effect of saving workload
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0013] This embodiment is based on the compilation optimization method of Loongson 3A vector memory access. The preliminary compilation optimization scheme is: first use the open source compiler package (GCC) to automatically vectorize the front end to generate a tree structure in vector form, and then use the tree structure in vector form Expand to the intermediate representation in the form of vectors; then perform diversity processing on the intermediate representations in the form of vectors; finally convert the intermediate representations in the form of vectors into vector memory access instructions.
[0014] The specific operation steps are as follows:
[0015] The first step, vector expansion
[0016] The instruction format of Loongson vector 128-bit memory access is: gsLQC1 fq, ft, offset(base); gsSDC1 fq, ft, offset(base). Automatic vectorization generates a tree structure in vector form, but at this time, memory access and calculation in the tree structure have 128...
example 1
[0029] Example 1 for(i=0; i
[0030] {
[0031] A[i]=B[i]+C[i];
[0032] E[i]=D[i]+C[i];
[0033]}
example 2
[0034] Example 2 for(i=0; i
[0035] {
[0036] A[i]=B[i]+C[i];
[0037] E[i]=D[i]+C[i];
[0038]}
[0039] (3) The lvalue of a statement with public operation variables may be the rvalue of another statement, forming an assignment chain. Such as A[i] in the for loop structure of Example 2.
[0040] In specific procedures, diversity is mainly reflected in the following three types of cyclical procedures:
[0041] Diversity 1:
[0042]
[0043] Diversity 2:
[0044]
[0045] Diversity 3:
[0046]
[0047]
[0048] The characteristics represented by these three types of programs are:
[0049] (1) The public operation variable is the rvalue of the assignment statement, such as the x variable in diversity 1.
[0050] (2) The public operation variable is the rvalue of the multiplication statement, such as b[i] or x in diversity 2.
[0051] (3) The public operation variable is the rvalue of the addition statement, such as c[i] in diversity 3.
[0052] A...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 