Browse Source

* fixed x86 vector mmloads and use scalar loads in ncgcnv

git-svn-id: trunk@5967 -
Jonas Maebe 18 years ago
parent
commit
abef29c1d5
2 changed files with 18 additions and 4 deletions
  1. 2 2
      compiler/ncgcnv.pas
  2. 16 2
      compiler/x86/cgx86.pas

+ 2 - 2
compiler/ncgcnv.pas

@@ -304,7 +304,7 @@ interface
                     begin
                       location_force_mmregscalar(current_asmdata.CurrAsmList,left.location,false);
                       location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
-                      cg.a_loadmm_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register,nil);
+                      cg.a_loadmm_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register,mms_movescalar);
                     end
                   else
                     internalerror(2003012262);
@@ -340,7 +340,7 @@ interface
                   LOC_MMREGISTER:
                     begin
                       location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
-                      cg.a_loadmm_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register,nil);
+                      cg.a_loadmm_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register,mms_movescalar);
                     end;
                   else
                     internalerror(2003012261);

+ 16 - 2
compiler/x86/cgx86.pas

@@ -915,8 +915,22 @@ unit cgx86;
       var
         instr : taicpu;
       begin
-        if (shuffle=nil) or
-           shufflescalar(shuffle) then
+        if shuffle=nil then
+          begin
+            if fromsize=tosize then
+              { needs correct size in case of spilling }
+              case fromsize of
+                OS_F32:
+                  instr:=taicpu.op_reg_reg(A_MOVAPS,S_NO,reg1,reg2);
+                OS_F64:
+                  instr:=taicpu.op_reg_reg(A_MOVAPD,S_NO,reg1,reg2);
+                else
+                  internalerror(2006091201);
+              end
+            else
+              internalerror(200312202);
+          end
+        else if shufflescalar(shuffle) then
           instr:=taicpu.op_reg_reg(get_scalar_mm_op(fromsize,tosize),S_NO,reg1,reg2)
         else
           internalerror(200312201);