diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2005-10-03 12:31:31 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2005-10-03 12:31:31 +0000 |
commit | 185657007e3898b8232a6db5d06a16ace55a07bc (patch) | |
tree | 5a53545b367bbd92ad793cfb20a15c271cd21d4c /compiler/x86 | |
parent | ee4e97ae557cf29b8e2a6bb79487867e873579f7 (diff) | |
download | fpc-185657007e3898b8232a6db5d06a16ace55a07bc.tar.gz |
+ sqr uses sse on x86 if possible
* the result type of sqr is equal to the argument in case of usual floats
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@1265 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/x86')
-rw-r--r-- | compiler/x86/nx86inl.pas | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/x86/nx86inl.pas b/compiler/x86/nx86inl.pas index 9d065f3d06..d587e7f6bd 100644 --- a/compiler/x86/nx86inl.pas +++ b/compiler/x86/nx86inl.pas @@ -246,8 +246,18 @@ implementation procedure tx86inlinenode.second_sqr_real; begin - load_fpu_location; - emit_reg_reg(A_FMUL,S_NO,NR_ST0,NR_ST0); + if use_sse(resulttype.def) then + begin + secondpass(left); + location_force_mmregscalar(exprasmlist,left.location,false); + location:=left.location; + cg.a_opmm_loc_reg(exprasmlist,OP_MUL,left.location.size,left.location,left.location.register,mms_movescalar); + end + else + begin + load_fpu_location; + emit_reg_reg(A_FMUL,S_NO,NR_ST0,NR_ST0); + end; end; procedure tx86inlinenode.second_sqrt_real; |