summaryrefslogtreecommitdiff
path: root/compiler/x86
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2005-10-03 12:31:31 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2005-10-03 12:31:31 +0000
commit185657007e3898b8232a6db5d06a16ace55a07bc (patch)
tree5a53545b367bbd92ad793cfb20a15c271cd21d4c /compiler/x86
parentee4e97ae557cf29b8e2a6bb79487867e873579f7 (diff)
downloadfpc-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.pas14
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;