Hi,
All !
- What instruction replaced the FPU-instruction FCHS? I use
xorps xmm0, xmm0
subss xmm0, xmm1; in the register xmm1 the value for which you want to change the sign
movss xmm1, xmm0
or so
xorps xmm0, const80000000h
But is that right?
- The FPU was many trigonometric instructions (FSIN, FCOS, FSINCOS, FPTAN, FPATAN) What it replace in SSE?
Thank you
I have seen formulas around the internet for replacing trig functions with sse2. The attached PDF is what I have found so far.
The answer must be in the CRT using /Fa to get an asm translate.
Perhaps also is there some options to switch on in VS project.
Floating point has 1 sign bit.
So we can flip the sign bit using boolean algebra ( Exclusive OR )
pxor / xorps / xorpd
.const
flip_bit dd 080000000H,080000000H,080000000H,080000000H
.code
xorps xmm0,dword ptr [flip_bit]
4 at once:
xorps xmm0,oword ptr [flip_bit]
square root functions in SSE:
SQRTSD Compute Square Root of Scalar Double-Precision Floating-Point Value
SQRTSS Compute Square Root of Scalar Single-Precision Value
SQRTPD Square Root of Packed Double-Precision Floating-Point Values
SQRTPS Square Root of Packed Single-Precision Floating-Point Values
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
Other trigonometric functions you have to create yourself.
for example: http://masm32.com/board/index.php?topic=4118.msg49276#msg49276
Hi, hutch--, TouEnMasm, Siekmanski
Thank you very much (https://wasm.in/styles/smiles_s/thank_you2.gif)
well sometimes you can eliminate change sign if you have mulps later in calculation
constants or variables for example taylor series use 1/3!,-1/5!,1/7!,-1/9!
use mulps -100.0, instead change sign and mulps 100.0
Hi, daydreamer!
I will use your advice. Thank!