Unfortunately, merely the use of these %xmmN registers in a compiled binary is not sufficient to show that a program is actually performing vector arithmetic. The x86-64 calling convention uses the %xmm0-3 registers when passing floating point numbers and gcc will use them for simple floating point arithmetic. For example, the following code:
Unfortunately, merely the use of these
%xmmN
registers in a compiled binary is not sufficient to show that a program is actually performing vector arithmetic. The x86-64 calling convention uses the%xmm0-3
registers when passing floating point numbers andgcc
will use them for simple floating point arithmetic. For example, the following code:produces the following assembly:
Note how even though the
%xmmN
registers are used, the math instructions generated only operate on one element of the registers. (Seeaddsd
above.)This comment was marked helpful 1 times.