CN115794053A - Adaptive floating point to integer optimization method and device for JavaScript engine - Google Patents

Adaptive floating point to integer optimization method and device for JavaScript engine Download PDF

Info

Publication number
CN115794053A
CN115794053A CN202211418042.8A CN202211418042A CN115794053A CN 115794053 A CN115794053 A CN 115794053A CN 202211418042 A CN202211418042 A CN 202211418042A CN 115794053 A CN115794053 A CN 115794053A
Authority
CN
China
Prior art keywords
floating point
conversion
integer
double
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211418042.8A
Other languages
Chinese (zh)
Inventor
张海军
李佳
刘增伟
盛开
沈重午
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Advanced Technology Research Institute
Original Assignee
Wuxi Advanced Technology Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Advanced Technology Research Institute filed Critical Wuxi Advanced Technology Research Institute
Priority to CN202211418042.8A priority Critical patent/CN115794053A/en
Publication of CN115794053A publication Critical patent/CN115794053A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a self-adaptive optimization method and a device for converting a floating point into an integer of a JavaScript engine, wherein the method comprises the steps of obtaining conversion information from the floating point into the integer; reading hardware information of a processor, and judging strong/weak support of the processor on a truncation mode by comparing the processor information, wherein the target value obtained when the processor strongly supports the truncation mode and indicates that an instruction of converting floating points into integers overflows is a truncation value of a target format, and the target value obtained when the processor weakly supports the truncation mode and indicates that the instruction of converting floating points into integers overflows is a maximum limited value of the target format; under the strong/weak support of the processor to the truncation mode, the conversion information from floating point to integer is judged and matched with the conversion module from Double to Int32 of in-place operation and the conventional conversion module from floating point to integer, and different instructions from floating point to integer are generated in a self-adaptive manner.

Description

Adaptive floating point to integer optimization method and device for JavaScript engine
Technical Field
The invention relates to a self-adaptive JavaScript engine floating point to integer optimization method and a device thereof, belonging to the technical field of JavaScript just-in-time compilation.
Background
All numeric types are stored in 64-bit Double precision floating point Double in JavaScript, but when JavaScript is used for bit operation, the operand and the return value must be 32-bit signed integer Int32, and JavaScript also supports conventional floating point to integer operation. So JavaScript code executes with two floating point to integer conversions: double to Int32 for bitwise operations and conventional floating point to integer. The JavaScript engine has different processing modes for the two conversions: firstly, a JIT compiler is matched with a floating point to integer module during running, then the conversion is judged to be of which type, when the conversion is matched with a conventional floating point to integer, the conversion is distributed to a corresponding conventional floating point to integer operation module, and the modules are directly converted; when the matching is the bit operation Double Int32, the conversion is distributed to a bit operation Double Int32 conversion module, the conventional conversion is firstly carried out in the conversion, whether the conversion is abnormal or not is judged, and if the conversion is abnormal, the Double value is converted into an Int32 cutoff value in a mathematical splicing mode.
When the floating point number is not in the integer range, the JavaScript engine has different requirements for the two conversion result values: in the Double Int32 conversion module aiming at bit operation, when overflow occurs, the required target value is a cutoff value of a target format; in conventional floating point to integer modules, the required result value is the largest finite value of the target format.
In most current processor platforms, the target value obtained when the floating point to integer instruction overflows is the maximum limited value of the target format. At this time, in the Double to Int32 module for bit operation, floating point values (nonunion, maximum and minimum values INF, different index values) exceeding the Int32 range need to be subjected to multiple processing, multiple branch jumps exist, the operation is complex, the generated code amount is large, and the efficiency is low. However, there are other processor platforms where the result is a truncated value in the target format when an overflow of a floating point to integer instruction occurs. At this time, in the conventional floating point to integer operation, the overflow needs to be processed separately, otherwise, the hidden trouble of correctness exists.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a self-adaptive method and a device for optimizing the conversion from floating point to integer of a JavaScript engine.
In order to achieve the purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the present invention provides a method for optimizing a floating point to integer conversion of a self-adaptive JavaScript engine, which is used for the JavaScript engine and includes:
acquiring floating point to integer conversion information;
reading hardware information of a processor, and judging strong/weak support of the processor on a truncation mode by comparing the processor information, wherein the strong support of the processor on the truncation mode indicates that a target value obtained when an instruction of converting floating points into integers overflows is a truncation value in a target format, and the weak support of the processor on the truncation mode indicates that the target value obtained when the instruction of converting floating points into integers overflows is a maximum limited value in the target format;
under the strong/weak support of the processor to the truncation mode, the floating point to integer conversion information is judged and matched with the Double to Int32 conversion module of the in-place operation and the conventional floating point to integer conversion module, and different instructions of the floating point to integer conversion are generated in a self-adaptive mode.
Further, when the processor strongly supports the truncation mode, the floating point-to-integer conversion information is matched to all floating point-to-integer templates;
judging whether a Double-to-Int 32 conversion template is matched in place;
and respectively selecting the conversion from Double to Int32 and the conventional conversion from floating point to integer according to the judgment result, assigning the result value and finishing the process.
Further, the performing bit operation Double to Int32 conversion and conventional floating point to integer conversion on the floating point to integer conversion information according to the determination result includes:
if the conversion template from the Double to the Int32 of the in-place operation is matched, carrying out the conversion from the Double to the Int32 of the floating point to the integer conversion information, assigning a result value and ending the process;
if the conversion template from Double to Int32 of the in-place operation is not matched, performing conventional floating point to integer conversion on the floating point to integer conversion information, judging whether overflow occurs in the conversion process, and assigning the result value as the maximum limited value of the target format when the overflow occurs in the conversion process; if not, directly assigning a value to the result value, and ending the process.
Further, when the processor weakly supports the truncation mode, the floating point to integer conversion information is matched to all floating point to integer templates;
judging whether a conversion template from Double to Int32 is matched in-place operation;
and respectively selecting the conversion from Double to Int32 and the conventional conversion from floating point to integer according to the judgment result, assigning the result value and finishing the process.
Further, the performing bit operation Double to Int32 conversion and conventional floating point to integer conversion on the floating point to integer conversion information according to the determination result includes:
if the conversion template of the Double to the Int32 in the bit operation is matched, performing the Double to Int32 conversion of the floating point to the integer conversion information, then judging the range of the Double value, performing corresponding conventional Double to Int32 instruction sequence conversion on all the Double to Int32 conversion in the range when the Double value is in the Int32 range, and obtaining a correct result value in a mathematical splicing mode when the Double value is out of the Int32 range;
and if the match of the in-place operation Double-to-Int 32 conversion template is not judged, performing conventional floating point-to-integer conversion on the floating point-to-integer conversion information, performing conventional Double-to-Int 32 instruction sequence conversion on the conventional floating point-to-integer conversion, assigning a result value, and ending the process.
Further, the determining the range of the Double value, when the Double value is within the Int32 range, performing corresponding conventional Double to Int32 instruction sequence conversion on all bit operations in the range from Double to Int32, and when the Double value is out of the Int32 range, obtaining a correct result value by a mathematical concatenation method, including:
in the conversion process, judging whether the conversion is abnormal or not by reading the information value in the floating point state control register, if the conversion is not abnormal, indicating that the Double value is in the Int32 range, and obtaining a value obtained by the conversion from the conventional Double to the Int32 instruction sequence, namely a correct result value, assigning a value to the result value, and ending the process;
if the conversion is abnormal, judging whether the floating point number is a nonnumber and infinity, wherein the nonnumber and the infinity exponent values are special numerical values, judging by comparing the exponent values of the floating point number, and if the floating point number is the nonnumber and the infinity, assigning 0 to the result value and ending the flow;
if the floating point number is not a non-number and infinity, judging whether the exponent of the floating point number is larger than a set value or not, if the exponent of the floating point number is larger than the set value, indicating that the last 32 bits of the floating point number are 0, assigning 0 to the result value, and ending the flow;
if the exponent of the floating point number is not larger than the set value, the sign bit, the exponent bit and the mantissa bit are respectively taken out from the floating point number in the residual range, the floating point number is converted into an integer value through a mathematical splicing mode, the result value is assigned with a truncation value form of an integer Int32, and the process is finished.
In a second aspect, the present invention provides an adaptive JavaScript engine floating point to integer optimization apparatus, which is used for a JavaScript engine, and includes:
the conversion information acquisition module is used for acquiring conversion information from floating points to integers;
the judging module is used for reading hardware information of the processor and judging strong/weak support of the processor to a truncation mode by comparing the processor information, wherein the strong support of the processor to the truncation mode represents that a target value obtained when an instruction of converting floating points into integers overflows is a truncation value in a target format, and the weak support of the processor to the truncation mode represents that the target value obtained when the instruction of converting floating points into integers overflows is a maximum limited value in the target format;
and the conversion module is used for respectively judging the floating point to integer conversion information and matching the information with the Double to Int32 conversion module and the conventional floating point to integer conversion module in-place operation under the strong/weak support of the processor on the truncation mode, so as to generate different floating point to integer instructions in a self-adaptive manner.
In a third aspect, the present invention provides an electronic device comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any one of the preceding claims.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the preceding claims.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a self-adaptive optimization method and a device for converting floating point into integer of a JavaScript engine, which comprises the following steps of 1) when a platform supports a truncation strong support instruction, directly converting Double into Int32 of bit operation, omitting branch operation under various conditions, improving the operation efficiency, adding overflow treatment to the conventional floating point into integer operation, and improving the stability of the engine; 2) When the platform supports the truncation weak support instruction, the conventional floating point to integer conversion operation is directly converted, the overflow value processing is omitted, and the Double to Int32 of the para-position operation is added with the processing of various conditions to obtain the correct result.
By adopting the optimization method, all floating point-to-integer conditions in the JavaScript engine can be processed uniformly, the most efficient instruction code can be generated according to different characteristics of hardware instructions, the performance of the JavaScript engine is improved, overflow values under various conditions can be processed correctly, and the stability and the performance of the JavaScript engine are improved.
Drawings
FIG. 1 is a flow chart of the floating point to integer conversion for a JavaScript engine in an embodiment of the present invention.
FIG. 2 is a flow chart of the conversion from Double to Int32 for bit operations when the platform supports weak support of the floating point to integer truncation mode in the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
Example 1
The embodiment introduces an adaptive JavaScript engine floating point to integer optimization method, which is used for a JavaScript engine and includes:
acquiring floating point to integer conversion information;
reading hardware information of a processor, and judging strong/weak support of the processor to a truncation mode by comparing the processor information, wherein the strong support of the processor to the truncation mode represents that a target value obtained when an instruction of converting floating points into integers overflows is a truncation value of a target format, and the weak support of the processor to the truncation mode represents that the target value obtained when the instruction of converting floating points into integers overflows is a maximum limited value of the target format;
under the strong/weak support of the processor to the truncation mode, the floating point to integer conversion information is judged and matched with the Double to Int32 conversion module of the in-place operation and the conventional floating point to integer conversion module, and different instructions of the floating point to integer conversion are generated in a self-adaptive mode.
As shown in fig. 1, an application process of the adaptive JavaScript engine floating point to integer optimization method provided in this embodiment specifically involves the following steps:
and S1, a strong/weak support judgment module of the JavaScript engine to the processor truncation mode.
And reading processor information by the JavaScript engine in the process of compiling the JavaScript source code, and judging the strong/weak support of the processor on truncation by comparing the specific attributes of hardware. When the processor strongly supports truncation, jumping to an S2 truncation strong support module for execution; and if the processor weakly supports the truncation mode, jumping to the S3 module for execution.
S2: and the truncation strong support floating point to integer module.
S21: and the JavaScript engine converts the floating point into the integer template matching module.
And under the strong support of the truncation mode, matching to all floating point-to-integer templates. The method comprises the steps of converting single-precision floating points into words, converting single-precision floating points into long words, converting double-precision floating points into long words and converting double-precision floating points into words through bit operation.
S22, a template judgment module for converting Double to Int32 through bit operation.
And when the template is matched with the conversion template from Double to Int32 in the in-place operation, jumping to the S221 module for execution, otherwise, jumping to the S222 module for execution.
S221, a bit operation Double to Int32 conversion module.
And performing conventional Double-to-Int 32 instruction sequence conversion, assigning a result value, and ending the flow.
S222, a conventional floating point to integer conversion module.
Performing conventional floating point to word instruction sequence conversion, judging whether overflow occurs in the conversion process, and assigning a result value as a maximum limited value of a target format when the overflow occurs in the floating point to integer conversion process; if not, the result value is directly assigned. And ending the flow.
And S3, truncating the weak support floating point to integer module.
S31: and the JavaScript engine converts the floating point into the integer template matching module.
And matching to all floating point to integer templates with the S21 module under weak support of a truncation mode. The method comprises the steps of converting single-precision floating points into words, converting single-precision floating points into long words, converting double-precision floating points into long words and converting double-precision floating points into words by bit operation.
And S32, a module for judging a conversion template from Double to Int32 by bit operation.
And when the match of the Double to Int32 conversion template of the in-place operation is judged, jumping to the S321 module for execution, otherwise, jumping to the S322 module for execution.
S321, a bit operation Double to Int32 conversion module.
Under weak support of a truncation mode, conversion from Double to Int32 needs to be determined according to the range of Double values: when the Double value is within the range of Int32, the conventional Double-to-Int 32 conversion instruction sequence is used; when the range of Int32 is exceeded, a correct result value needs to be obtained by means of mathematical splicing. The specific conversion process is shown in fig. 2:
step 100: the conventional Double Int32 instruction converts and determines an exception. In the conversion process, whether the conversion is abnormal or not can be judged by reading the information value in the floating point state control register. If no exception occurs, it indicates that the Double value is within the range of Int32, and the value obtained by converting the conventional Double into Int32 instruction is the correct result value, at this time, the result value is assigned, and the process is ended. Otherwise, go to step 200.
Step 200: the floating point number of the conversion exception is processed. Firstly, judging whether the floating point number is a nonnumber and infinity, wherein the exponential values of the nonnumber and the infinity are special numerical values, judging by comparing the floating point number exponential values, if the floating point number is the nonnumber and the infinity, assigning 0 to the result value, and ending the flow. Otherwise, go to step 300.
Step 300: floating point numbers with exponent greater than 84 are processed. If the exponent is greater than 84, indicating that the last 32 bits of the floating point number are 0, the result value (DEST) is assigned 0, ending the flow. Otherwise, go to step 400.
Step 400: floating point numbers in the remaining range are processed. And respectively taking out the sign digit, the exponent digit and the mantissa digit, converting the floating point number into an integer value in a mathematical splicing mode, assigning a cutoff value form of an integer Int32 to the result value, and ending the process.
S322, a conventional floating point to integer conversion module.
And (5) performing conventional floating point word-to-word instruction sequence conversion, assigning a result value, and ending the process.
The invention aims to solve the technical problem that the existing algorithm cannot be efficiently realized due to two overflow requirements existing in the conversion from floating points to integers in a JavaScript engine. According to the adaptive JavaScript engine floating point to integer optimization method, corresponding processing instructions are generated through different mode selections, and the conversion efficiency and stability are improved. The key points involved are:
1. truncation stitching processing for alignment operation
When the platform is weakly supported by a truncation mode, all the Double value ranges are covered in Double-to-Int 32 conversion of alignment operation, and each condition of Double can be correctly processed.
2. Boundary value processing for conventional transformations
When the platform is strongly supported by a truncation mode, the overflow value processing is added to the conventional floating point-to-integer operation, so that the stability of an engine is improved.
3. Full coverage adaptive techniques
The conversion method of the invention covers all processing conditions of the conversion information from floating point to integer, the code can be generated in a self-adaptive way, and the conversion efficiency and stability can be improved.
Example 2
The embodiment provides an adaptive JavaScript engine floating point to integer optimization apparatus, which is used for a JavaScript engine, and includes:
the conversion information acquisition module is used for acquiring floating point-to-integer conversion information;
the judging module is used for reading hardware information of the processor and judging strong/weak support of the processor to a truncation mode by comparing the processor information, wherein the strong support of the processor to the truncation mode represents that a target value obtained when an instruction of converting floating points into integers overflows is a truncation value in a target format, and the weak support of the processor to the truncation mode represents that the target value obtained when the instruction of converting floating points into integers overflows is a maximum limited value in the target format;
and the conversion module is used for respectively judging the floating point to integer conversion information under the strong/weak support of the processor on the truncation mode, matching the conversion information with the in-place operation Double to Int32 conversion module and the conventional floating point to integer conversion module, and adaptively generating different instructions of converting floating points to integers.
Example 3
The embodiment provides an electronic device, comprising a processor and a storage medium;
the storage medium is to store instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any of embodiment 1.
Example 4
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of the method of any of the embodiment 1.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (9)

1. A self-adaptive JavaScript engine floating point to integer optimization method is used for a JavaScript engine and comprises the following steps:
acquiring floating point-to-integer conversion information;
reading hardware information of a processor, and judging strong/weak support of the processor to a truncation mode by comparing the processor information;
under the strong/weak support of a processor on a truncation mode, respectively judging the floating point to integer conversion information, matching the floating point to integer conversion information with a Double to Int32 conversion module and a conventional floating point to integer conversion module for in-place operation, and generating different floating point to integer conversion instructions in a self-adaptive manner;
the strong support of the processor to the truncation mode indicates that the target value obtained when the instruction of the floating point to integer conversion overflows is the truncated value of the target format, and the weak support of the processor to the truncation mode indicates that the target value obtained when the instruction of the floating point to integer conversion overflows is the maximum limited value of the target format.
2. The adaptive floating point to integer optimization method for JavaScript engine of claim 1, wherein:
when the processor strongly supports the truncation mode, matching the floating point-to-integer conversion information to all floating point-to-integer templates;
judging whether a Double-to-Int 32 conversion template is matched in place;
and respectively selecting the conversion from Double to Int32 and the conversion from conventional floating point to integer from the floating point to integer conversion information according to the judgment result, assigning the result value and ending the process.
3. The adaptive floating point to integer optimization method of claim 2, wherein the respectively selecting the bit operation Double to Int32 conversion and the conventional floating point to integer conversion for the floating point to integer conversion information according to the determination result comprises:
if the conversion template from the Double to the Int32 in the floating point operation is matched, carrying out the conversion from the Double to the Int32 in the floating point to integer conversion information, assigning a result value, and ending the process;
if the Double-to-Int 32 conversion template of the in-place operation is not matched, performing conventional floating point-to-integer conversion on the floating point-to-integer conversion information, judging whether overflow occurs in the conversion process, and assigning the result value as the maximum limited value in the target format when the overflow occurs in the floating point-to-integer conversion process; if not, directly assigning a value to the result value, and ending the process.
4. The adaptive floating point to integer optimization method for JavaScript engine of claim 1, wherein:
when the processor weakly supports the truncation mode, the floating point-to-integer conversion information is matched to all floating point-to-integer templates;
judging whether a Double-to-Int 32 conversion template is matched in place;
and respectively selecting the conversion from Double to Int32 and the conversion from conventional floating point to integer from the floating point to integer conversion information according to the judgment result, assigning the result value and ending the process.
5. The adaptive floating point to integer optimization method of claim 1, wherein the respectively selecting the bit operation Double to Int32 conversion and the conventional floating point to integer conversion for the floating point to integer conversion information according to the determination result comprises:
if the conversion template from the Double to the Int32 of the bit operation is matched, performing bit operation Double to Int32 conversion on the floating point to integer conversion information, firstly, judging the range of a Double value, when the Double value is in the range of the Int32, performing corresponding conventional Double to Int32 instruction sequence conversion on all the bit operation Double to Int32 conversion in the range, and when the Double value is out of the range of the Int32, obtaining a correct result value in a mathematical splicing mode;
and if the match of the in-place operation Double-to-Int 32 conversion template is not judged, performing conventional floating point-to-integer conversion on the floating point-to-integer conversion information, performing conventional Double-to-Int 32 instruction sequence conversion on the conventional floating point-to-integer conversion, assigning a result value, and ending the process.
6. The adaptive floating-point to integer optimization method for JavaScript engines of claim 5, wherein the determining the range of Double values, when the Double value is within the Int32 range, performing corresponding conventional Double to Int32 instruction sequence conversion on all bit operations in the range from Double to Int32, and when the Double value is outside the Int32 range, obtaining a correct result value by means of mathematical concatenation, comprises:
in the conversion process, judging whether the conversion is abnormal or not by reading the information value in the floating point state control register, if the conversion is not abnormal, indicating that the Double value is in the Int32 range, and obtaining a value obtained by the conversion from the conventional Double to the Int32 instruction sequence, namely a correct result value, assigning a value to the result value, and ending the process;
if the conversion is abnormal, judging whether the floating point number is a nonnumber and infinity, wherein the nonnumber and infinity index values are special numerical values, judging by comparing the floating point number index values, if the floating point number is the nonnumber and the infinity, assigning 0 to the result value, and ending the flow;
if the floating point number is not a non-number and infinity, judging whether the exponent of the floating point number is larger than a set value or not, if the exponent of the floating point number is larger than the set value, indicating that the last 32 bits of the floating point number are 0, assigning 0 to the result value, and ending the flow;
if the exponent of the floating point number is not larger than the set value, the sign bit, the exponent bit and the mantissa bit are respectively taken out from the floating point number in the residual range, the floating point number is converted into an integer value through a mathematical splicing mode, the result value is assigned with a truncation value form of an integer Int32, and the process is finished.
7. An adaptive floating point to integer optimization device for a JavaScript engine, comprising:
the conversion information acquisition module is used for acquiring conversion information from floating points to integers;
the judging module is used for reading hardware information of the processor and judging strong/weak support of the processor to a truncation mode by comparing the processor information, wherein the strong support of the processor to the truncation mode represents that a target value obtained when an instruction of converting floating points into integers overflows is a truncation value in a target format, and the weak support of the processor to the truncation mode represents that the target value obtained when the instruction of converting floating points into integers overflows is a maximum limited value in the target format;
and the conversion module is used for respectively judging the floating point to integer conversion information under the strong/weak support of the processor on the truncation mode, matching the conversion information with the in-place operation Double to Int32 conversion module and the conventional floating point to integer conversion module, and adaptively generating different instructions of converting floating points to integers.
8. An electronic device, characterized in that: comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that: the program when executed by a processor implements the steps of the method of any one of claims 1 to 6.
CN202211418042.8A 2022-11-14 2022-11-14 Adaptive floating point to integer optimization method and device for JavaScript engine Pending CN115794053A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211418042.8A CN115794053A (en) 2022-11-14 2022-11-14 Adaptive floating point to integer optimization method and device for JavaScript engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211418042.8A CN115794053A (en) 2022-11-14 2022-11-14 Adaptive floating point to integer optimization method and device for JavaScript engine

Publications (1)

Publication Number Publication Date
CN115794053A true CN115794053A (en) 2023-03-14

Family

ID=85437213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211418042.8A Pending CN115794053A (en) 2022-11-14 2022-11-14 Adaptive floating point to integer optimization method and device for JavaScript engine

Country Status (1)

Country Link
CN (1) CN115794053A (en)

Similar Documents

Publication Publication Date Title
US8108657B2 (en) Handling floating point operations
RU2420790C2 (en) Rounding-off in accordance with instructions
CN111078290B (en) Compiler and compiling method for extensible instruction set
US20120124115A1 (en) Methods and apparatuses for converting floating point representations
US7949696B2 (en) Floating-point number arithmetic circuit for handling immediate values
US7966609B2 (en) Optimal floating-point expression translation method based on pattern matching
US7689640B2 (en) Method and apparatus for formatting numbers in microprocessors
EP0373361B1 (en) Generating efficient code for a computer with dissimilar register spaces
US9104515B2 (en) Floating-point error detection and correction
CN110569629A (en) Binary code file tracing method
CN109710211A (en) Floating type conversion method, device, storage medium and computer equipment
US8732679B2 (en) Loop transformation for computer compiler optimization
EP0947922B1 (en) Compiler
US7003651B2 (en) Program counter (PC) relative addressing mode with fast displacement
JP4141112B2 (en) Processor and processor system
Markstein The new IEEE-754 standard for floating point arithmetic
CN115794053A (en) Adaptive floating point to integer optimization method and device for JavaScript engine
CN115167868A (en) Code compiling method, device, equipment and computer storage medium
US7735061B2 (en) Efficient encoding and access of mathematically precise variable precision numeric types
CN114676026B (en) Processor performance test method, device, equipment and medium
US7277908B2 (en) Numeric processor, a numeric processing method, and a data processing apparatus or computer program incorporating a numeric processing mechanism
CN118227138A (en) Computing compiling optimization realization method and system based on error-free transformation
CN114237612A (en) Program code compiling method, program code compiling device, electronic equipment and storage medium
CN118259966A (en) Repositioning-based rapid addressing method, device and medium for Shenwei architecture
JPH086797A (en) Constant reference optimizing processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination