A Compilation Implementation Method Oriented to Variable Parameter Functions

An implementation method and variable parameter technology, applied in the direction of electrical digital data processing, program control design, instruments, etc., can solve problems such as unfavorable applications and reduced convenience, and achieve high utilization of hardware resources, simple and convenient compilation and processing, and execution high efficiency effect

Active Publication Date: 2017-10-17
NAT UNIV OF DEFENSE TECH
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This kind of processing method will take into account many redundant and cumbersome situations, and may need to be adjusted to a certain extent, which greatly reduces convenience and is not conducive to practical application

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A Compilation Implementation Method Oriented to Variable Parameter Functions
  • A Compilation Implementation Method Oriented to Variable Parameter Functions
  • A Compilation Implementation Method Oriented to Variable Parameter Functions

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] The present invention will be further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.

[0040] Such as figure 2 As shown, this embodiment is a method for compiling and implementing variable parameter functions, and the steps are:

[0041] (1) Determine the position of the first variable parameter: Get the number of fixed parameters in the function prototype, and determine the storage position of the first variable parameter according to the number of fixed parameters, when the number of fixed parameters does not exceed the parameter When the number of registers is specified, the storage location of the first variable parameter is the starting location of the specified stack transfer parameter, otherwise it is the last storage location of the last fixed parameter storage location;

[0042] (2) Passing and storage of parameters: read the parameters...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a compiling implementation method for a variable-parameter function. The compiling implementation method comprises the steps that (1) the number of fixed parameters in a function prototype is obtained, and the storage position of the first variable parameter is determined according to the number of the fixed parameters; (2) the parameters in the function are read, whether the current parameters are variable or not is judged, if the current parameters are not variable, a parameter register is used preferentially for transmission, and when no parameter register is available, a stack is used for transmission, and if the current parameters are variable, the stack is used for transmission; (3) traversal is conducted on the parameters from the first variable parameter, each parameter is obtained through the storage position of the parameter, the storage position of a next parameter is obtained according to the storage positions of the parameters and the values of the parameters, and traversal is ended until all the variable parameters are obtained. The compiling implementation method for the variable-parameter function has the advantages that the method is simple, operation is convenient, the utilization rate of hardware resources is high, the execution efficiency is high, and the flexibility is high.

Description

technical field [0001] The invention relates to the field of high-level language compilers, in particular to a compiling and implementing method for variable parameter functions. Background technique [0002] A variable parameter function is a special type of function. In addition to at least one fixed parameter, the function declaration also contains other parameters that have not yet been determined. In the function, the iteration of parameters is realized through keywords such as va_list, va_start, and va_arg. and lookup. Variable parameters are widely used in formatting input and output. When compiling such functions, the compiler does not know the specific number of parameters, so the processing method of variable parameters is very different from that of ordinary functions. The compiler needs to take into account various situations that may arise, such as the position of the parameter, the way of passing the parameter, etc. [0003] To correctly implement the compila...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/45
Inventor 王霁孙海燕阳柳张雪萌陈书明郭阳刘衡竹陈跃跃龚国辉李灿陈伟业
Owner NAT UNIV OF DEFENSE TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products