員建新
員建新

Reputation: 93

Can CPUs (like Intel/AMD/ARM) do higher math computation except for addition/subtraction/multiplication/division?

I learn something about logical circuit and computer architecture, including assembly instruction set (such as x86 instruction set, ARM instruction set) and microarchitecture (x86/ARM), I found no matter Intel processor or ARM processor can only do addition/subtraction/multiplication/division these four basic math computation hardwarely,because Intel/ARM processor only have adder/subtracter/multiplier/divider these four basic computers.

But these processors support more advanced math computation like trigonometric function,exponential function,power function and these functions' derivative/ definite integral?Even matrix computation? I know these advanced math computations can be done softwarely (like Python's NumPy/SciPy),but Intel/ARM processor can support these advanced math computations hardwarely just like addition/subtraction/multiplication/division?

Upvotes: 0

Views: 1089

Answers (2)

nishad kamdar
nishad kamdar

Reputation: 107

Intel processors do support trigonometric and many advanced computations

According to "Professional Assembly Language" by Richard Blum

Since 80486 the Intel IA-32 platform has directly supported floating point operations.

The FPU Floating Point Unit supports many advanced functions other than simple add, sum, multiple, div. They are

Absolute value FABS Change sign FCHS Cosine FCOS Partial Tangent FPTAN etc.

Upvotes: 2

R. Singh
R. Singh

Reputation: 131

Generally speaking, you can build hardware structures to help accelerate the calculation of things such as trigonometric functions. However, in practice, it's pointless, because it's not a good use of hardware resources.

There is a paper from 1983 on how trigonometric functions were implemented on the 8087 floating-point co-processor (Implementation of transcendental functions on a numerics processor). Even there, they rely on a CORDIC implementation, which is a method of calculating trig functions using relatively basic hardware (add/sub/shift/table look-up). You can read more about CORDIC implementations in the following paper: Evaluating Elementary Functions in a Numerical Coprocessor Based on Rational Approximations

On a modern x86 processor, complex instructions like FCOS are implemented using microcode. Intel doesn't like to talk about their microcoded instructions, but you can find a paper from AMD right now that describes this particular use of microcode: The K5 Transcendental Functions

Upvotes: 3

Related Questions