Instruções aritméticas
Instruções de operação aritmética do SSE.
ADDP(S|D) | Add Packed (Single|Double)-precision floating-point values
ADDPS xmm(n), xmm(n)
ADDPS xmm(n), float(4)
ADDPD xmm(n), xmm(n)
ADDPD xmm(n), double(2)#include <stdio.h>
void assembly(float *array);
int main(void)
{
float array[4] = {5.0f, 5.0f, 5.0f, 5.0f};
assembly(array);
printf("Resultado: %f, %f, %f, %f\n", array[0], array[1], array[2], array[3]);
return 0;
}bits 64
default rel
section .rodata align=16
sum_array: dd 1.5
dd 2.5
dd 3.5
dd 4.5
section .text
global assembly
assembly:
movaps xmm0, [rdi]
addps xmm0, [sum_array]
movaps [rdi], xmm0
retSUBP(S|D) | Subtract Packed (Single|Double)-precision floating-point values
ADDS(S|D) | Add Scalar (Single|Double)-precision floating-point value
SUBS(S|D) | Subtract Scalar (Single|Double)-precision floating-point value
MULP(S|D) | Multiply Packed (Single|Double)-precision floating-point values
MULS(S|D) | Multiply Scalar (Single|Double)-precision floating-point value
DIVP(S|D) | Divide Packed (Single|Double)-precision floating-point values
DIVS(S|D) | Divide Scalar (Single|Double)-precision floating-point value
RCPPS | Compute Reciprocals of Packed Single-precision floating-point values
RCPSS | Compute Reciprocal of Scalar Single-precision floating-point value
SQRTP(S|D) | Compute square roots of Packed (Single|Double)-precision floating-point values
SQRTS(S|D) | Compute square root of Scalar (Single|Double)-precision floating-point value
RSQRTPS | Compute Reciprocals of square roots of Packed Single-precision floating-point values
RSQRTSS | Compute Reciprocal of square root of Scalar Single-precision floating-point value
MAXP(S|D) | return maximum of Packed (Single|Double)-precision floating-point values
MAXS(S|D) | return maximum of Scalar (Single|Double)-precision floating-point value
MINP(S|D) | return minimum of Packed (Single|Double)-precision floating-point values
MINS(S|D) | return minimum of Scalar (Single|Double)-precision floating-point value
Last updated
Was this helpful?