IP Library Granted Patent US 10,353,672
Granted Patent B2
US 10,353,672 · App. 14/883,889 · Granted Jul 16, 2019

Methods and apparatuses for computing trigonometric functions with high precision

Inventors: Wei Wang (Shanghai, CN); Xinan Jiang (Shanghai, CN); Chengxin Yin (Shanghai, CN); Huaisheng Zhang (Shanghai, CN); Tian Shen (Shanghai, CN); Bing Yu (Shanghai, CN)
Assignee: VIA ALLIANCE SEMICONDUCTOR CO., LTD.
G06F7/548
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,353,672
App. No.
14/883,889
Granted
Jul 16, 2019
Kind
B2
Abstract

A method for computing trigonometric functions, performed by an ALU (Arithmetic Logic Unit) in coordination with an SFU (Special Function Unit), is introduced to contain at least the following steps. The ALU computes a remainder r and a reduction value x* corresponding to an input parameter x. The SFU computes an intermediate function f(x*) corresponding to the reduction value x*. The ALU computes a multiplication of the reduction value x* by the intermediate function f(x*) as the computation result of a trigonometric function.

Claims (38)

1. A method implemented by a GPU (Graphics Processing Unit) for computing trigonometric functions in three-dimensional graphics Application Programming Interfaces (APIs), comprising:

computing, by a range reduction unit of an ALU (Arithmetic Logic Unit), a remainder r and a reduction value x* corresponding to an input parameter x;

communicating the remainder r to an SFU (Special Function Unit);

computing, by the SFU, an intermediate function f(x*) corresponding to the reduction value x*;

communicating the intermediate function f(x*) to the ALU; and

computing, by a post-computation unit of the ALU, a multiplication of the reduction value x* by the intermediate function f(x*) as a computation result of a trigonometric function,

wherein the reduction value x* is computed by an Equation:

x* =π/2* frc ( x* 2/π).

2. The method of claim 1 , wherein the step for computing, by a range reduction unit of an ALU (Arithmetic Logic Unit), a remainder r and a reduction value x* corresponding to an input parameter x, further comprises:

computing the remainder r corresponding to the input parameter x using an Equation:

r=frc ( x *2/π);

determining whether a host requests that cos(x) be computed;

when the host requests that cos(x) be computed, adjusting the remainder r using an Equation:

r= 1.0 −r ; and

computing the reduction value x* using an Equation:

x*=π /2 *r.

3. The method of claim 1 , wherein the step for computing, by an SFU (Special Function Unit), an intermediate function f(x*) corresponding to the reduction value x*, further comprises:

obtaining coefficients C 0 , C 1 and C 2 of a second-degree polynomial from a LUT (Look-Up Table) according to a first magnitude X 1 of the remainder r as an index;

obtaining a second magnitude X 2 of the remainder r; and

computing the intermediate function f(x*) using an Equation:

f ( x* )= C 0 +C 1 *X 2 +C 2 *X 2 2 .

4. The method of claim 3 , wherein the intermediate function f(x*) is a result of Sin(x*)/x* or Cos(x*)/x*.

5. The method of claim 3 , wherein the first magnitude X 1 is 7 bits and the second magnitude X 2 is 24 bits.

6. The method of claim 5 , wherein the LUT comprises 128 records and each record stores the coefficients C 0 , C 1 and C 2 of the second-degree polynomial associated with one of binary values from “0b0000000” to “0b1111111”.

7. An apparatus in a GPU (Graphics Processing Unit) for computing trigonometric functions in three-dimensional graphics Application Programming Interfaces (APIs), comprising:

an ALU (Arithmetic Logic Unit); and

an SFU (Special Function Unit), coupled to the ALU,

wherein the ALU includes range reduction circuitry configured to compute a remainder r and a reduction value x* corresponding to an input parameter x; the SFU includes second-degree-polynomial computation circuitry configured to compute an intermediate function f(x*) corresponding to the reduction value x*; and the ALU includes post-computation circuitry configured to compute a multiplication of the reduction value x* by the intermediate function f(x*) as a computation result of a trigonometric function,

wherein the reduction value x* is computed by an Equation:

x* =π/2* frc ( x* 2/π).

8. The apparatus of claim 7 , wherein the ALU is configured to compute the remainder r corresponding to the input parameter x using an Equation: r=frc(x*2/π); determines whether a host requests that cos(x) be computed; when the host requests that cos(x) be computed, adjusts the remainder r using an Equation: r=1.0−r; and computes the reduction value x* using an Equation: x*=π/2*r.

9. The apparatus of claim 8 , wherein the SFU further comprises:

a volatile memory device, coupled to the ALU, storing the remainder r;

a non-volatile memory device, storing a LUT (Look-Up Table); and

wherein the SFU obtains coefficients C 0 , C 1 and C 2 of a second-degree polynomial from the LUT according to a first magnitude X 1 of the remainder r as an index; obtains the coefficients C 0 , C 1 and C 2 of the second-degree polynomial; obtains a second magnitude X 2 of the remainder r from the volatile memory device; obtains a square of the second magnitude X 2 from the square computation unit; and computes the intermediate function f(x*) using an Equation: f(x*)=C 0 +C 1 *X 2 +C 2 *X 2 2 .

10. The apparatus of claim 9 , wherein the intermediate function f(x*) is a result of Sin(x*)/x* or Cos(x*)/x*.

11. The apparatus of claim 9 , wherein the first magnitude X 1 is 7 bits and the second magnitude X 2 is 24 bits.

12. The apparatus of claim 11 , wherein the LUT comprises 128 records and each record stores the coefficients C 0 , C 1 and C 2 of the second-degree polynomial associated with one of binary values from “0b0000000” to “0b1111111”.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 18, 2021
From: SHANGHAI ZHAOXIN SEMICONDUCTOR CO., LTD.
To: GLENFLY TECH CO., LTD.
Reel/Frame 058965/0042 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 15, 2015
From: YIN, CHENGXIN; JIANG, XINAN; WANG, WEI; SHEN, TIAN; ZHANG, HUAISHENG; YU, BING
To: VIA ALLIANCE SEMICONDUCTOR CO., LTD.
Reel/Frame 036799/0322 →
Priority Claims (1)
CN 2015 1 0621326 · Sep 25, 2015 · national
Continuity (1)
Related Publication 20170090871A1 · Mar 30, 2017