Patent ID: 8392489
Filing Date: 2013-03-05
Classification: H03M

Abstract:
1. An algorithmic method to perform branchless constant-time conversion of an ASCII string real number of any byte size equal to or less than the byte size of the registers provided for by a vector processing architecture, said real number comprising a sign byte, an integer part, a fractional part, a decimal point separating the integer part from the fractional part, and a string terminator, to a binary floating point real number representation of the ASCII string real number on a vector processor having the vector processing architecture, said binary floating point real number representation of the ASCII string real number comprising a positive or negative binary vector value, corresponding to a positive or negative sign byte, respectively of the ASCII string real number and having a magnitude with an integer portion and a fractional portion with a decimal point separating the integer portion from the fractional portion, said method comprising, implementation of code comprising a fixed sequence of a constant number of instructions to execute one or more steps of the conversion, said conversion further comprising, detection of the sign byte, assigning a plus or minus 1 value, dependent on the sign being positive or negative respectively, storing this value in a register of the vector processor, and removing the sign byte from the ASCII string real number; detection of the string terminator, aligning the string to an edge of a vector processor register having byte width equal to or greater than the number of characters in the ASCII string real number and, if the register has a greater byte width than the number of characters in the ASCII string real number, masking all unused characters in from the opposite edge to the aligned edge with zeros resulting in one or more leading or trailing zeros; detecting and storing in a register of the vector processor the decimal point position that separates the integer part of the ASCII string real number from the fractional part of the ASCII string real number and removal of the decimal point from the ASCII string real number; parallel conversion of all one or more characters of the unsigned string, with no decimal point, into corresponding binary coded decimal bytes to form a binary real number having one or more bytes, wherein the number of the one or more bytes corresponds to the number of characters of the unsigned string with no decimal point; parallel multiplication of each of the binary coded decimal values with a power of ten corresponding to the placement of each of the binary coded decimal values inside the binary real number to obtain individual binary results; aggregation of the individual binary results of the parallel multiplication into a first intermediate binary result; multiplication of the first intermediate binary result with a floating point power of ten corresponding to a placement of the decimal point to obtain a second intermediate binary result; and multiplication of the second intermediate binary result with the binary value assigned to the sign to get a final signed floating point binary result.