sincos dest{ .x | .y | .xy }, src0{ .x | .y | .z | .w }, src1, src2
| Name | Registers |
|---|---|
| dest |
A temporary register. Must specify any one of { .x | .y | .xy } as the mask for dest. The cosine value is output to x and the sine value is output to y. The specified component must have a value between -π and π. |
| src0 |
A temporary register or input register. Must specify any one of { .x | .y | .z | .w } as the component. |
| src1 |
A temporary register. Cannot specify swizzling or the negative sign. |
| src2 |
A temporary register. Cannot specify swizzling or the negative sign. |
A different register must be specified for each operand.
The content of the z component in dest is not preserved because it is used during calculations.
The calculation process uses src1 and src2.
The floating-point constant registers c93, c94, and c95 are automatically defined because Taylor expansions require several coefficients.
You cannot use this instruction and define either c93, c94, or c95 using the def instruction.
Calculates the sine and cosine of the component value specified by src0 and stores the result in dest. The units used are radians.
This macro calculates an approximate value using a Taylor expansion.
tmp = src0{ .x | .y | .z | .w }
dest.x = cos ( tmp )
dest.y = sin ( tmp )
dest.z = undefined // This is used during calculations
def c93, 0xbe0000, 0xbc5555, 0x3f0000, 0x3f0000 // -0.5, -1/3!, 1.0, 1.0
def c94, 0xb56c16, 0xb2a01a, 0x3a5555, 0x381111 // -1/6!, -1/7!, 1/4!, 1/5!
def c95, 0xa927e4, 0xa5ae64, 0x2fa01a, 0x2c71de // -1/10!, -1/11!, 1/8!, 1/9!
mov src1 , c95
mov src2 , c94
mul dest.z, src0{ .x | .y | .z | .w }, src0{ .x | .y | .z | .w }
mad dest.xy, dest.z, src1.xy, src1.zw
mad dest.xy, dest.z, dest.xy, src2.xy
mad dest.xy, dest.z, dest.xy, src2.zw
mov src1 , c93
mad dest.xy, dest.z, dest.xy, src1.xy
mad dest.xy, dest.z, dest.xy, src1.zw
mul dest.y, dest.y, src0{ .x | .y | .z | .w }
sincos r0.xy, v1.x, r2, r3
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| mov | read | mov | write | |||||||||||||||||||||||||||
| mov | read | mov | write | |||||||||||||||||||||||||||
| mul | read | MUL | post | write | ||||||||||||||||||||||||||
| mad | STALL | read | MUL | ADD | post | write | ||||||||||||||||||||||||
| mad | STALL | read | MUL | ADD | post | write | ||||||||||||||||||||||||
| mad | STALL | read | MUL | ADD | post | write | ||||||||||||||||||||||||
| mov | read | mov | write | |||||||||||||||||||||||||||
| mad | STALL | read | MUL | ADD | post | write | ||||||||||||||||||||||||
| mad | STALL | read | MUL | ADD | post | write | ||||||||||||||||||||||||
| mul | STALL | read | MUL | post | write | |||||||||||||||||||||||||
CONFIDENTIAL