ASM vertex rendering instructions

abs dest, src Calculate the absolute value of the src vector and store it in dest
add dest, src0, src1 store the src0 vector + src1 vector and store it in dest
call label Call the subroutine
callnz label, booleanRegister identified by label, that is if (booleanRegister) { Call the subroutine identified by label}
crs dest, src0, src1 Cross product vector src0 and vector src1 and store them in dest, dest.x = src0,y src1.z-src0.z src1.y; dest.y = src0,z src1.x-src0.x src1.z; dest.z = src0,x src1.y-src0.y src1.x;
def dest, value Define register constants to be stored in dest, which must be located at the beginning of the rendering instruction At the beginning
defb dest, booleanValue define a bool constant and store it in dest
defi dest, integerValue define an int constant and store it in dest
dp3 dest, src0, src1 Three-dimensional vector dot multiplication, the vector src0 and vector src1 are dot multiplied and stored in the vector dest In, dest.x = dest.y = dest.z = dest.w = (src0.x src1.x) + (src0.y src1.y) + (src0.z src1.z);
dp4 dest, src0, src1 Four-dimensional vector dot product, the vector src0 and vector src1 are dot-multiplied and stored in the vector dest, dest.w = (src0.x
src1.x) + (src0.y src1.y) + (src0 .z src1.z) + (src0.w src1.w); dest.x = dest.y = dest.z = unused;
dst dest, src0, src1 i.e. dest.x = 1; dest.y = src0.y * src1.y; dest.z = src0.x; dest.w = src1.w;
if...else...endif No need to explain. .
loop aL, integerRegister program flow loop control instructions, appear in pairs with endloop. aL is the program loop controller, and integerRegister is the register that stores the input loop condition. The maximum value of the loop counter is integerRegister.x, the initial value of the loop counter is integerRegister.y, and the increment of the loop counter is integerRegister.z
endloop See loop
rep integerRegister loop control instructions, paired with endrep, integerRegister is the register that stores the input loop conditions , IntegerRegister.x indicates the loop at this time.
endrep See rep
exp dest, src to calculate the exponent, dest.x = dest.y = dest.z = dest.w = (float)pow(2, src0,w);
expp dest. src float w = src.w; float v = (float)floor(src.w); dest.x = (float)pow(2, v); dest.y = wv; float tmp = (float) pow(2, v); DWORD tmpd =
(DOWORD )&tmp & 0xffffff00; dest.z = (float )&tmpd; dest.w = 1;
frc dest. src calculates the fractional part, dest.x = src.x-(float )floor(src.x); dest.y = src.y-(float)floor(src.y); dest.z = src.z-(float)floor(src.z); dest.w = src. w-(float)floor(src.w);
label l(n) subroutine identifier (for the next command), l(n) is the designated identifier, n is an integer from 0 to 15
lit dest, src Calculating the lighting instruction is more complicated. You can refer to the related literature
log dest, src to calculate the logarithm, dest.x = dest.y = dest.z = dest.w = log2(x);
logp dest, src dest.x = dest. y = dest.z = dest.w = log2(x); Local precision
lrp dest, src0, src1, src2 Use vector src0 to perform linear interpolation on vector src1 and vector src2, and store the result in dest, dest.x = src0.x
(src1.x-src2.x)+src2.x; dest.y = src0.y*(src1.y-src2.y)+src2.y; dest.z = src0.z*(src1.z-src2 .z)+src2.z; dest.w = src0.w*(src1.w-src2.w)+src2.w;
m3 2 dest, src0, src1 The vector is multiplied by the matrix, dest = src0 src1; src1 is 2 3 matrix
m3
3 dest, src0, src1 vector and matrix multiplication, dest = src0 src1; src1 is 3 3 matrix
m3 4 dest, src0, src1 vector and matrix multiplication, dest = src0 src1; src1 is 4 3 matrix
m4
3 dest, src0, src1 vector and matrix multiplied, dest = src0 src1; src1 is 3 4 matrix
m4 4 dest, src0, src1 vector is multiplied by matrix, dest = src0 src1; src1 is 4 4 matrix
mad dest, src0, src1, src2 vector multiplication and addition, dest.x = src0.x
src1.x+src2.x; dest.y = src0.y src1.y+src2.y; dest.z = src0.zsrc1.z+src2.z; dest.w = src0.w*src1.w+src2.w;
max dest, src0, src1 Find the maximum value, dext.x = (src0.x>=src1.x)? src0 .x: src1.x; dext.y = (src0.y>=src1.y)? src0.y: src1.y; dext.z = (src0.z>=src1.z)? src0.z: src1 .z; dext.w = (src0.w>=src1.w)? src0.w: src1.w;
min dest, src0, src1 to find the minimum value, see max
mov dest, src register assignment instruction: if dest is one Integer register, src.w is rounded and assigned to dest, otherwise dest = src
mova a0, src rounds the value of the floating-point register src and assigns it to the address register a0
mul dest, src0, src1 compare the vector src0 with the vector src1 Multiply and store in dest
Nop
Nrm dest, src unitize vector src and store in dest
pow dest, src0[.x/.y/.z/.w], src1[.x/.y/.z /.w] Find exponent dest = abs((src0)src1 power), src0 and src1 must specify an element x or y or z or w
rcp dest, src[.x/.y/.z/.w] Find Countdown, dest = 1/src.x or dest = 1/src.y or dest = 1/src.z or dest = 1/src.w
rsq dest, src Find the reciprocal of the square root, dest = 1/sqrt(src.x) or dest = 1/sqrt(src.y) or dest = 1/sqrt(src.z) or dest = 1/sqrt(src. w)
sge dest, src0, src1 Compare whether src0 is greater than src1, dest.x = (src0.x>=src1.x)? 1.0f: 0.0f; dest.y = (src0.y>=src1.y)? 1.0f: 0.0f; dest.z = (src0.z>=src1.z)? 1.0f: 0.0f; dest.w = (src0.w>=src1.w)? 1.0f: 0.0f;
slt dest , src0, src1 Compare whether src0 is less than src1, see sge
sgn dest, src0, src1 Calculate the symbol of src0:
for each component in src0
{ if( src0.component <0) dest.component = -1; else if( src0.component == 0) dest.component = 0; else dest.component = 1; } Note: src0 and src1 here are temporary registers









sincos dest[.x/.y/.xy], src0[.x/.y/.z/.w], src1, src2 To find the value of sin and cos, dest must be a temporary register, src1 and src2 must be constants Register
sub dest, src0, src1 subtract vector src1 from vector src0 and store it in dest

Guess you like

Origin blog.csdn.net/qq_31042143/article/details/113772309
ASM