A method for quickly solving reciprocal of positive numbers based on SIMD instruction implementation

By using SIMD instructions and a fast method for calculating the reciprocal of square roots, the problem of slow calculation speed for positive number reciprocals on platforms with limited hardware resources is solved, achieving efficient calculation and improving calculation speed and cache utilization.

CN117492969BActive Publication Date: 2026-06-05INGENIC SEMICON CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INGENIC SEMICON CO LTD
Filing Date
2022-07-25
Publication Date
2026-06-05

Smart Images

  • Figure CN117492969B_ABST
    Figure CN117492969B_ABST
Patent Text Reader

Abstract

This invention provides a method for quickly calculating the reciprocal of a positive number based on SIMD instructions, comprising: S1. Loading data, which is loaded in multiples of 32 bits, with a maximum of 512 bits of data per register; single-precision floating-point numbers are 32 bits, and a register can load 16 floating-point numbers, so one SIMD instruction can load or calculate 16 floating-point numbers simultaneously. Let Register1 = Ingenic_simd512_load((float)data); Ingenic_simd512_load is the SIMD instruction for loading data; (float)data is the 16 input 32-bit single-precision floating-point numbers; Register1 is register 1, and the input data is stored in Register1. S2. Use SIMD instructions to calculate the reciprocal of the square root from the data in Register1, and store the result in Register2; S3. Square the reciprocal of the square root from step S2 to obtain the reciprocal. Let Register3 = Ingenic_simd512_float_mul(Register2, Register2); Ingenic_simd512_float_mul is a SIMD instruction for floating-point multiplication. Multiply the data in Register2 with the data in Register2, that is, square the data in Register2, and store the result in Register3; S4. Save the calculation result from the register to memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of multimedia computing technology, and specifically relates to a method for quickly solving the reciprocal of a positive number based on SIMD instructions. Background Technology

[0002] With the popularization of the internet, multimedia applications such as images, audio, and video have rapidly emerged. To cope with the intensive computing demands of the multimedia field, the requirements for processor hardware computing power are increasing. However, the traditional methods of improving computing power by increasing the clock speed and adding hardware pipeline stages have gradually reached their limits. Hardware designers began to consider improving computing power through parallelism, resulting in multi-machine architectures, multi-core architectures, and SIMD architectures. Among them, SIMD, short for Single Instruction Multiple Data, is an extended instruction set that can efficiently implement parallel processing. It can process multiple operands at once and pack them into a set of instructions in a large register.

[0003] Furthermore, commonly used algorithms incorporate various mathematical logics and functional operations. In mathematics, a reciprocal refers to a relationship between two numbers. When a number x is multiplied by another number, the product is 1, denoted as 1 / x or x. This process is called the "inverse of multiplication." All numbers except 0 have reciprocals; two numbers whose product is 1 are reciprocals of each other. 0 has no reciprocal. In mathematics, to find the reciprocal of a positive number, simply divide it by 1 (provided the number is not 0, otherwise the calculation is meaningless). For example, the reciprocal of 10 is 1 / 10, which is 0.1.

[0004] With the development of integrated circuit technology, many chip manufacturers have developed their own chips. However, each chip design presents its own challenges in chip applications. On some resource-constrained platforms and chips, it's necessary to calculate the reciprocal of positive numbers. For example, the T40 chip from Beijing Junzheng Integrated Circuit Co., Ltd. (hereinafter referred to as Beijing Junzheng) requires C language division with 1 as the dividend to calculate the reciprocal of a positive number. In existing technology, the C language method for calculating the reciprocal of a positive number, i.e., division with 1 as the dividend, can only process one data point at a time, resulting in wasted buffer space and long data interaction time, leading to slow processing speed. For some platforms or chips with limited hardware resources, such as the Beijing Junzheng T40 chip, running this method to process large amounts of continuous data is slow and unsuitable for applications requiring high processing speed. Directly using C programs on such devices is slow, and the unreasonable use of limited instructions leads to very slow execution time.

[0005] In addition, the technical terms involved in the prior art include:

[0006] Newton's iterative method: also known as the Newton-Raphson method, is a method proposed by Newton in the 17th century for approximately solving equations in the real and complex number fields.

[0007] Let r be a root of f(x) = 0. Choose x0 as the initial approximation of r. Draw a tangent line L to the curve y = f(x) through the point (x0, f(x0)), where L: y = f(x0) + f'(x0)(x - x0). The x-coordinate of the intersection point of L and the x-axis is x1 = x0 - f(x0) / f'(x0), and x1 is called the first-order approximation of r. Draw another tangent line to the curve y = f(x) through the point (x1, f(x1)), and find the x-coordinate of the intersection point of this tangent line and the x-axis, x2 = x1 - f(x1) / f'(x1), and x2 is called the second-order approximation of r. Repeat the above process to obtain a sequence of approximations of r, where x(n+1) = xn - f(xn) / f'(xn), called the (n+1)th order approximation of r. This formula is called Newton's iteration formula. Summary of the Invention

[0008] To address the aforementioned issues, the purpose of this application is to achieve rapid calculation of the reciprocals of positive numbers using SIMD instructions and a method for quickly calculating the reciprocals of square roots.

[0009] Specifically, this invention provides a method for quickly solving the reciprocals of positive numbers based on SIMD instructions, the method comprising the following steps:

[0010] S1. Loading data is done in multiples of 32 bits, with a maximum of 512 bits per register. Single-precision floating-point numbers are 32 bits, and a register can load 16 floating-point numbers. Therefore, a single SIMD instruction can load or perform calculations on 16 floating-point numbers simultaneously.

[0011] Register1=Ingenic_simd512_load((float)data);

[0012] Ingenic_simd512_load is the SIMD instruction for loading data; (float)data is the input of 16 32-bit single-precision floating-point numbers; Register1 is register 1, where the input data is stored.

[0013] S2. Use SIMD instructions to calculate the reciprocal of the square root from the data in Register1. Let...

[0014] Register2=Ingenic_simd512_rsqrt(Register1)

[0015] Here, Ingenic_simd512_rsqrt is the name of a method for quickly finding the reciprocal of the square root. It means that it can cover all the steps of the method for finding the reciprocal of the square root. These steps are combined and named Ingenic_simd512_rsqrt, and the results are stored in Register2.

[0016] S3. Squaring the reciprocal of the square root in step S2 gives the reciprocal. Let...

[0017] Register3=Ingenic_simd512_float_mul(Register2, Register2);

[0018] Ingenic_simd512_float_mul is a SIMD instruction for floating-point multiplication. It multiplies the data in Register2 by the data in Register2, that is, it squares the data in Register2 and stores the result in Register3.

[0019] S4: Save the calculation result from the register to memory.

[0020] The method for quickly finding the reciprocal of the square root further includes:

[0021] S2.1. Perform a direct logical right shift of 1 bit on the data in Register1.

[0022] Using a single SIMD instruction that logically shifts right by 1 bit, set it as follows:

[0023] Register2 = Ingenic_simd512_logical_shift_right_1_bit(Register1) Register1 is the operand. The 16 32-bit single-precision floating-point numbers in Register1 are simultaneously logically shifted right by 1 bit, and the result is stored in register 2, which is represented as Register2. S2.2. Subtract the result of step S2.1 from the 32-bit hexadecimal magic number 0x5f3759df to obtain the first approximation of the reciprocal of the square root. Use a SIMD instruction to load an immediate value, set as: Register3 = Ingenic_simd512_load_immediate(0x5f3759df), to load 0x5f3759df into Register3. This instruction can copy a 32-bit data into 16 32-bit data and load them into a 512-bit register.

[0024] Using a single SIMD instruction for integer subtraction, it can be represented as:

[0025] Register2 = Ingenic_simd512_int_sub(Register3, Register2) subtracts the result of step S2.1 from the 16 32-bit data in Register3. This instruction can perform 16 subtraction operations at the same time. Since both operands of the subtraction in this step are integers, the integer subtraction instruction is used. The result after subtraction is still stored in Register2.

[0026] S2.3. Use a single SIMD instruction for floating-point multiplication, that is, multiply the 16 floating-point numbers in Register1 by the corresponding 16 floating-point numbers in Register3, as follows:

[0027] The function `Register4 = Ingenic_simd512_float_mul(Register1, Register3)` multiplies the data in `Register1` by the floating-point number 0.5. First, 0.5 needs to be loaded into `Register3`. Since 0.5 is a floating-point number, immediate loading instructions cannot be used; only ordinary loading instructions can be used, represented as:

[0028] Register3=Ingenic_simd512_load(0.5),

[0029] After loading 0.5, a repeat instruction is used. The repeat instruction is a data copy instruction, represented as:

[0030] Register3=Ingenic_simd512_repeat(Register3)

[0031] Copy the 32-bit floating-point number 0.5 into 16 32-bit floating-point numbers and store them in Register3;

[0032] At this point, both operands of the multiplication instruction are floating-point numbers, so the floating-point multiplication instruction is used, and the result is stored in Register4;

[0033] Then, load the 32-bit floating-point number 1.5 into Register5 using the same method, represented as: Register5 = Ingenic_simd512_load(1.5)

[0034] Register5=Ingenic_simd512_repeat(Register5);

[0035] The Register4 and Register5 results obtained in this step prepare for the Newton-Raphson iteration method in the following steps;

[0036] S2.4. Perform the first Newton iteration method:

[0037] The SIMD instruction for floating-point multiplication, Ingenic_simd512_float_mul, multiplies the data in Register2 from step S2.2 by the data in Register4, and the result is squared and stored in Register6. Then, it multiplies the data in Register4, and the result is still stored in Register6. Next, the floating-point subtraction instruction is used, that is, the 16 floating-point numbers in Register5 are subtracted from the corresponding 16 floating-point numbers in Register6. This is represented as: Ingenic_simd512_float_sub, which subtracts the data in Register6 from the data in Register5. Since both operands of this instruction are floating-point numbers, the floating-point subtraction instruction is used, and the result is stored in Register6. Finally, the data in Register6 is multiplied by the data in Register2, and the result is stored in Register2.

[0038] The registers here store 16 single-precision floating-point numbers, each 32-bit, and each instruction operates on 16 floating-point numbers simultaneously; represented as:

[0039] Register6=Ingenic_simd512_float_mul(Register2, Register2);

[0040] Register6=Ingenic_simd512_float_mul(Register4, Register6);

[0041] Register6=Ingenic_simd512_float_sub(Register5, Register6);

[0042] Register2=Ingenic_simd512_float_mul(Register2, Register6);

[0043] S2.5. In order to achieve the accuracy required for practical applications, it is necessary to perform n Newton iterations as needed, that is, to repeat step S2.4 (n-1) times.

[0044] In step S2.1, the direct logical right shift of the data in Register1 by 1 bit achieves the result of first converting the floating-point number to an integer and then performing a logical right shift by 1 bit, as is done in C language.

[0045] In step S2.2, the magic number 0x5f3759df is an integer and can be loaded with an immediate value instruction; the register 3 (Register3) can be reused.

[0046] In step S2.5, when n = 3, three Newton iterations can be performed. Step S2.4 is then repeated twice more, as follows:

[0047] Second Newton iteration:

[0048] Register6=Ingenic_simd512_float_mul(Register2, Register2);

[0049] Register6=Ingenic_simd512_float_mul(Register4, Register6);

[0050] Register6=Ingenic_simd512_float_sub(Register5, Register6);

[0051] Register2=Ingenic_simd512_float_mul(Register2, Register6);

[0052] The third Newton iteration:

[0053] Register6=Ingenic_simd512_float_mul(Register2, Register2);

[0054] Register6=Ingenic_simd512_float_mul(Register4, Register6);

[0055] Register6=Ingenic_simd512_float_sub(Register5, Register6);

[0056] Register2=Ingenic_simd512_float_mul(Register2, Register6).

[0057] In step S4, it is set to

[0058] Result=Ingenic_simd512_store(Register3)

[0059] Ingenic_simd512_store is a data storage instruction that saves 16 data entries from Register3 to Result memory, which can store 16 data entries.

[0060] The method described can only calculate the reciprocals of positive numbers.

[0061] Therefore, the advantages of this application are: this method can improve cache utilization, load multiple data at once, make the most of cache space, reduce the number of data interactions between hard disk or memory and cache, thereby greatly improving the computing speed, occupying a small amount of resources, and can run efficiently even with limited hardware resources. Attached Figure Description

[0062] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.

[0063] Figure 1 This is a flowchart illustrating the method of the present invention. Detailed Implementation

[0064] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.

[0065] This method uses SIMD instructions to quickly calculate the reciprocal of a square root. Since the input data for quickly calculating the reciprocal of a square root can only be positive numbers, this method can only calculate the reciprocals of positive numbers.

[0066] like Figure 1 As shown, the method for quickly finding the reciprocal of a positive number using SIMD instructions includes the following steps:

[0067] S1. Loading data is done in multiples of 32 bits, with a maximum of 512 bits per register. Single-precision floating-point numbers are 32 bits, and a register can hold 16 floating-point numbers, so a single SIMD instruction can perform calculations on 16 floating-point numbers simultaneously. `Ingenic_simd512_load` is the SIMD instruction for loading data; `(float)data` represents the 16 input 32-bit single-precision floating-point numbers, and `Register1` is register 1, where the input data is stored.

[0068] Register1=Ingenic_simd512_load((float)data)

[0069] S2. Use the fast square root reciprocal method to calculate the reciprocal of the square root from the data in Register1. Ingenic_simd512_rsqrt is the name of the fast square root reciprocal method. The result is stored in Register2.

[0070] Register2=Ingenic_simd512_rsqrt(Register1)

[0071] S3. Squaring the reciprocal of the square root in step S2 gives the reciprocal. Ingenic_simd512_float_mul is a SIMD instruction for floating-point multiplication. Multiplying the data in Register2 by the data in Register2, that is, squaring the data in Register2, and storing the result in Register3.

[0072] Register3 = Ingenic_simd512_float_mul(Register2, Register2). S4: Save the calculation result from the register to memory.

[0073] Result=Ingenic_simd512_store(Register3)

[0074] Ingenic_simd512_store is a data storage instruction that saves 16 data entries from Register3 to Result memory, which can store 16 data entries.

[0075] In step S2, the method for quickly finding the reciprocal of the square root further includes: S2.1. Directly logically right-shifting the data in Register1 by 1 bit.

[0076] Using a single SIMD instruction that logically shifts right by 1 bit, set it as follows:

[0077] Register2 = Ingenic_simd512_logical_shift_right_1_bit(Register1) Register1 is the operand. The 16 32-bit single-precision floating-point numbers in Register1 are simultaneously logically shifted right by 1 bit, and the result is stored in register 2, represented as Register2. In step S2.1, the direct logical right shift of the data in Register1 achieves the result of first converting the floating-point number to an integer and then performing the logical right shift by 1 bit, as is done in C language.

[0078] S2.2. Subtract the result of step S2.1 from the 32-bit hexadecimal magic number 0x5f3759df to obtain the first approximation of the reciprocal of the square root. Use a SIMD instruction to load an immediate value, set as: Register3 = Ingenic_simd512_load_immediate(0x5f3759df), to load 0x5f3759df into Register3. This instruction can copy a 32-bit data into 16 32-bit data and load them into a 512-bit register.

[0079] The magic number 0x5f3759df is an integer and can be loaded with an immediate value instruction; Register 3 can be reused.

[0080] Using a single SIMD instruction for integer subtraction, it can be represented as:

[0081] Register2 = Ingenic_simd512_int_sub(Register3, Register2) subtracts the result of step S2.1 from the 16 32-bit data in Register3. This instruction can perform 16 subtraction operations at the same time. Since both operands of the subtraction in this step are integers, the integer subtraction instruction is used. The result after subtraction is still stored in Register2.

[0082] S2.3. Use a single SIMD instruction for floating-point multiplication, that is, multiply the 16 floating-point numbers in Register1 by the corresponding 16 floating-point numbers in Register3, as follows:

[0083] The function `Register4 = Ingenic_simd512_float_mul(Register1, Register3)` multiplies the data in `Register1` by the floating-point number 0.5. First, 0.5 needs to be loaded into `Register3`. Since 0.5 is a floating-point number, immediate loading instructions cannot be used; only ordinary loading instructions can be used, represented as:

[0084] Register3=Ingenic_simd512_load(0.5),

[0085] After loading 0.5, a repeat instruction is used. The repeat instruction is a data copy instruction, represented as:

[0086] Register3=Ingenic_simd512_repeat(Register3)

[0087] Copy the 32-bit floating-point number 0.5 into 16 32-bit floating-point numbers and store them in Register3;

[0088] At this point, both operands of the multiplication instruction are floating-point numbers, so the floating-point multiplication instruction is used, and the result is stored in Register4;

[0089] Then, load the 32-bit floating-point number 1.5 into Register5 using the same method, represented as: Register5 = Ingenic_simd512_load(1.5)

[0090] Register5=Ingenic_simd512_repeat(Register5);

[0091] The Register4 and Register5 results obtained in this step prepare for the Newton-Raphson iteration method in the following steps;

[0092] S2.4. Perform the first iteration of Newton's method:

[0093] The SIMD instruction for floating-point multiplication, Ingenic_simd512_float_mul, multiplies the data in Register2 from step S2.2 by the data in Register4, and the result is squared and stored in Register6. Then, it multiplies the data in Register4, and the result is still stored in Register6. Next, the floating-point subtraction instruction is used, that is, the 16 floating-point numbers in Register5 are subtracted from the corresponding 16 floating-point numbers in Register6. This is represented as: Ingenic_simd512_float_sub, which subtracts the data in Register6 from the data in Register5. Since both operands of this instruction are floating-point numbers, the floating-point subtraction instruction is used, and the result is stored in Register6. Finally, the data in Register6 is multiplied by the data in Register2, and the result is stored in Register2.

[0094] The registers here store 16 single-precision floating-point numbers, each 32-bit, and each instruction operates on 16 floating-point numbers simultaneously; represented as:

[0095] Register6=Ingenic_simd512_float_mul(Register2, Register2);

[0096] Register6=Ingenic_simd512_float_mul(Register4, Register6);

[0097] Register6=Ingenic_simd512_float_sub(Register5, Register6);

[0098] Register2=Ingenic_simd512_float_mul(Register2, Register6);

[0099] S2.5. In order to achieve the accuracy requirements of practical applications, it is necessary to perform n Newton iterations as needed, that is, to repeat step S2.4 (n-1) times.

[0100] If n=3, three Newton iterations are possible, and step S2.4 is repeated twice more, as follows:

[0101] Second Newton iteration:

[0102] Register6=Ingenic_simd512_float_mul(Register2, Register2);

[0103] Register6=Ingenic_simd512_float_mul(Register4, Register6);

[0104] Register6=Ingenic_simd512_float_sub(Register5, Register6);

[0105] Register2=Ingenic_simd512_float_mul(Register2, Register6);

[0106] The third Newton iteration:

[0107] Register6=Ingenic_simd512_float_mul(Register2, Register2);

[0108] Register6=Ingenic_simd512_float_mul(Register4, Register6);

[0109] Register6=Ingenic_simd512_float_sub(Register5, Register6);

[0110] Register2=Ingenic_simd512_float_mul(Register2, Register6).

[0111] Explanation of the accuracy and speed of this method:

[0112] Using the C language method for calculating the reciprocal of a positive number as a reference, under the same input data, the accuracy loss between the calculation result of this method and the calculation result of the C language method is obtained by formula (1). The accuracy loss is only 0.00001%, which meets the accuracy requirements of practical applications. The calculation speed of this method is 28 times that of the C language.

[0113] Precision_loss=(C_result-SIMD_result) / C_result formula (1)

[0114] In formula (1), Precision_loss represents the result of precision loss calculation, C_result is the result of calculation using the positive reciprocal method in C language, and SIMD_result is the result of calculation using this method.

[0115] In summary, the method of this application is as follows:

[0116] 1. The SIMD instruction set of Ingenic_simd512 supported by the Beijing Junzheng T40 chip is used to calculate the reciprocal of positive numbers, which improves cache utilization, consumes less resources, and has a calculation speed 28 times faster than the C language method for calculating the reciprocal of positive numbers. It can run efficiently on platforms with limited hardware resources.

[0117] 2. Since the SIMD instruction set of Ingenic_simd512 supported by the Beijing Junzheng T40 chip does not have a division instruction, it is not possible to use division to solve for the reciprocal of a positive number. This method uses SIMD instructions to quickly solve for the reciprocal of the square root. First, calculate the reciprocal of the square root of the input positive number, and then square the result to obtain the reciprocal of the positive number.

[0118] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for fast calculation of the reciprocals of positive numbers based on SIMD instructions, characterized in that, The method includes the following steps: S1. Loading data is done in multiples of 32 bits, with a maximum of 512 bits per register. Single-precision floating-point numbers are 32 bits, and a register can load 16 floating-point numbers. Therefore, a single SIMD instruction can load or perform calculations on 16 floating-point numbers simultaneously. Register1=Ingenic_simd512_load((float)data); In this context, Ingenic_simd512_load is the SIMD instruction for loading data; (float)data is the input of 16 32-bit single-precision floating-point numbers; and Register1 is register 1, which stores the input data. S2. Use SIMD instructions to calculate the reciprocal of the square root from the data in Register1. Let... Register2=Ingenic_simd512_rsqrt(Register1) Here, Ingenic_simd512_rsqrt is the name of a method for quickly finding the reciprocal of the square root. It means that it can cover all the steps of the method for finding the reciprocal of the square root. These steps are combined and named Ingenic_simd512_rsqrt, and the results are stored in Register2. S3. Squaring the reciprocal of the square root in step S2 gives the reciprocal. Let... Register3=Ingenic_simd512_float_mul(Register2, Register2); In this context, Ingenic_simd512_float_mul is a SIMD instruction for floating-point multiplication, which multiplies the data in Register2 by the data in Register2, that is, squares the data in Register2, and stores the result in Register3. S4. Save the calculation result from the register to memory.

2. The method for fast calculation of the reciprocal of a positive number based on SIMD instructions according to claim 1, characterized in that, The method for quickly finding the reciprocal of the square root in step S2 further includes: S2.

1. Perform a direct logical right shift of 1 bit on the data in Register1 using a single SIMD instruction for logical right shift of 1 bit, defined as follows: Register2=Ingenic_simd512_logical_shift_right_1_bit(Register1) In this context, Register1 is the operand. The 16 32-bit single-precision floating-point numbers in Register1 are simultaneously logically shifted right by 1 bit, and the result is stored in register 2, which is represented as Register2. S2.

2. Subtract the result of step S2.1 from the 32-bit hexadecimal magic number 0x5f3759df to obtain the first approximation of the reciprocal of the square root. Use a SIMD instruction that loads an immediate value, set as follows: Register3=Ingenic_simd512_load_immediate(0x5f3759df), Load 0x5f3759df into Register3. This instruction can copy a 32-bit data into 16 32-bit data and load them into a 512-bit register. Using a single SIMD instruction for integer subtraction, it can be represented as: Register2=Ingenic_simd512_int_sub(Register3, Register2), Subtract the 16 32-bit data in Register3 from the result of step S2.

1. This instruction can perform 16 subtraction operations at the same time. Since both operands of the subtraction are integers, the integer subtraction instruction is used. The result of the subtraction is still stored in Register2. S2.

3. Use a single SIMD instruction for floating-point multiplication, that is, multiply the 16 floating-point numbers in Register1 by the corresponding 16 floating-point numbers in Register3, as follows: Register4=Ingenic_simd512_float_mul(Register1, Register3) To multiply the data in Register1 by the floating-point number 0.5, 0.5 needs to be loaded into Register3 first. Since 0.5 is a floating-point number, the immediate load instruction cannot be used; only a normal load instruction can be used, represented as: Register3=Ingenic_simd512_load(0.5), After loading 0.5, a repeat instruction is used. The repeat instruction is a data copy instruction, represented as: Register3=Ingenic_simd512_repeat(Register3) Copy the 32-bit floating-point number 0.5 into 16 32-bit floating-point numbers and store them in Register3; At this point, both operands of the multiplication instruction are floating-point numbers, so the floating-point multiplication instruction is used, and the result is stored in Register4; Then, load the 32-bit floating-point number 1.5 into Register5 using the same method, as follows: Register5=Ingenic_simd512_load(1.5) Register5=Ingenic_simd512_repeat(Register5); The Register4 and Register5 results obtained in this step prepare for the Newton-Raphson iteration method in the following steps; S2.

4. Perform the first iteration of Newton's method: The SIMD instruction for floating-point multiplication, Ingenic_simd512_float_mul, multiplies the data in Register2 from step S2.2 by the data in Register4, and the result is squared and stored in Register6. Then, it multiplies the data in Register4, and the result is still stored in Register6. Next, the floating-point subtraction instruction is used, that is, the 16 floating-point numbers in Register5 are subtracted from the corresponding 16 floating-point numbers in Register6. This is represented as: Ingenic_simd512_float_sub, which subtracts the data in Register6 from the data in Register5. Since both operands of this instruction are floating-point numbers, the floating-point subtraction instruction is used, and the result is stored in Register6. Finally, the data in Register6 is multiplied by the data in Register2, and the result is stored in Register2. The registers here store 16 single-precision floating-point numbers, each 32-bit, and each instruction operates on 16 floating-point numbers simultaneously; represented as: Register6=Ingenic_simd512_float_mul(Register2, Register2); Register6=Ingenic_simd512_float_mul(Register4, Register6); Register6=Ingenic_simd512_float_sub(Register5, Register6); Register2=Ingenic_simd512_float_mul(Register2, Register6); S2.

5. In order to achieve the accuracy required for practical applications, it is necessary to perform n Newton iterations as needed, that is, to repeat step S2.4 (n-1) times.

3. The method for quickly solving the reciprocals of positive numbers based on SIMD instructions according to claim 2, characterized in that, In step S2.1, the direct logical right shift of the data in Register1 by 1 bit achieves the result of first converting the floating-point number to an integer and then performing a logical right shift by 1 bit, as is done in C language.

4. The method for quickly solving the reciprocals of positive numbers based on SIMD instructions according to claim 3, characterized in that, In step S2.2, the magic number 0x5f3759df is an integer and can be loaded with an immediate value instruction; the register 3 (Register3) can be reused.

5. The method for fast calculation of the reciprocals of positive numbers based on SIMD instructions according to claim 4, characterized in that, In step S2.5, when n = 3, three Newton iterations can be performed. Step S2.4 is then repeated twice more, as follows: Second Newton iteration: Register6=Ingenic_simd512_float_mul(Register2, Register2); Register6=Ingenic_simd512_float_mul(Register4, Register6); Register6=Ingenic_simd512_float_sub(Register5, Register6); Register2=Ingenic_simd512_float_mul(Register2, Register6); The third Newton iteration: Register6=Ingenic_simd512_float_mul(Register2, Register2); Register6=Ingenic_simd512_float_mul(Register4, Register6); Register6=Ingenic_simd512_float_sub(Register5, Register6); Register2=Ingenic_simd512_float_mul(Register2, Register6).

6. The method for fast calculation of the reciprocals of positive numbers based on SIMD instructions according to claim 1, characterized in that, In step S4, it is set to Result=Ingenic_simd512_store(Register3) Ingenic_simd512_store is a data storage instruction that saves 16 data entries from Register3 to Result memory, which can store 16 data entries.

7. The method for fast calculation of the reciprocals of positive numbers based on SIMD instructions according to claim 1, characterized in that, The method described can only calculate the reciprocals of positive numbers.