The invention discloses a reciprocal calculation
instruction sequence generation method oriented to a heterogeneous processor, and belongs to the field of compilation optimization and
code generation. Aiming at the problems of instruction redundancy, weak precision control, poor hardware
adaptation and high manual dependence of an existing method in a heterogeneous environment, characteristics of a reciprocal instruction and an
operand are accurately identified by linearly scanning heterogeneous object codes (including vectorization, scalar and complex instruction sequences); in combination with hardware characteristics of RISC /
SIMD / VLIW / DSP and the like, a multi-round iteration precision improvement and temporary register optimization allocation strategy is adopted, differential generation logic is formulated, and a high-precision low-redundancy
instruction sequence is generated. The method comprises
linear code scanning classification, reciprocal instruction and
operand identification, cross-architecture generation logic rule formulation,
instruction sequence generation and legality
verification. Full-process
automation is achieved, manual intervention is reduced, the execution efficiency and precision of reciprocal calculation of the heterogeneous processor are improved, and the method is suitable for embedded systems, high-performance calculation and other scenes.