Browse Source

+ being able to define change information for xmm0
* corrected change information for SHA256RNDS2

florian 3 years ago
parent
commit
07413be8b5

+ 1 - 1
compiler/i386/i386prop.inc

@@ -1440,7 +1440,7 @@
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
-(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1, Ch_RXMM0]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1])
 (Ch: [Ch_Mop2, Ch_Rop1])
 );
 );

+ 1 - 1
compiler/i8086/i8086prop.inc

@@ -1454,7 +1454,7 @@
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
-(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1, Ch_RXMM0]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1])
 (Ch: [Ch_Mop2, Ch_Rop1])
 );
 );

+ 7 - 1
compiler/x86/aasmcpu.pas

@@ -346,7 +346,13 @@ interface
         Ch_RRAX, Ch_RRCX, Ch_RRDX, Ch_RRBX, Ch_RRSP, Ch_RRBP, Ch_RRSI, Ch_RRDI,
         Ch_RRAX, Ch_RRCX, Ch_RRDX, Ch_RRBX, Ch_RRSP, Ch_RRBP, Ch_RRSI, Ch_RRDI,
         Ch_WRAX, Ch_WRCX, Ch_WRDX, Ch_WRBX, Ch_WRSP, Ch_WRBP, Ch_WRSI, Ch_WRDI,
         Ch_WRAX, Ch_WRCX, Ch_WRDX, Ch_WRBX, Ch_WRSP, Ch_WRBP, Ch_WRSI, Ch_WRDI,
         Ch_RWRAX, Ch_RWRCX, Ch_RWRDX, Ch_RWRBX, Ch_RWRSP, Ch_RWRBP, Ch_RWRSI, Ch_RWRDI,
         Ch_RWRAX, Ch_RWRCX, Ch_RWRDX, Ch_RWRBX, Ch_RWRSP, Ch_RWRBP, Ch_RWRSI, Ch_RWRDI,
-        Ch_MRAX, Ch_MRCX, Ch_MRDX, Ch_MRBX, Ch_MRSP, Ch_MRBP, Ch_MRSI, Ch_MRDI
+        Ch_MRAX, Ch_MRCX, Ch_MRDX, Ch_MRBX, Ch_MRSP, Ch_MRBP, Ch_MRSI, Ch_MRDI,
+
+        { xmm register }
+        Ch_RXMM0,
+        Ch_WXMM0,
+        Ch_RWXMM0,
+        Ch_MXMM0
       );
       );
 
 
       TInsProp = packed record
       TInsProp = packed record

+ 78 - 52
compiler/x86/aoptx86.pas

@@ -541,59 +541,74 @@ unit aoptx86;
               end;
               end;
             with insprop[p.opcode] do
             with insprop[p.opcode] do
               begin
               begin
-                if getregtype(reg)=R_INTREGISTER then
-                  begin
-                    case getsupreg(reg) of
-                      RS_EAX:
-                        if [Ch_REAX,Ch_RWEAX,Ch_MEAX]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
-                      RS_ECX:
-                        if [Ch_RECX,Ch_RWECX,Ch_MECX]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
-                      RS_EDX:
-                        if [Ch_REDX,Ch_RWEDX,Ch_MEDX]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
-                      RS_EBX:
-                        if [Ch_REBX,Ch_RWEBX,Ch_MEBX]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
-                      RS_ESP:
-                        if [Ch_RESP,Ch_RWESP,Ch_MESP]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
-                      RS_EBP:
-                        if [Ch_REBP,Ch_RWEBP,Ch_MEBP]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
-                      RS_ESI:
-                        if [Ch_RESI,Ch_RWESI,Ch_MESI]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
-                      RS_EDI:
-                        if [Ch_REDI,Ch_RWEDI,Ch_MEDI]*Ch<>[] then
-                          begin
-                            RegReadByInstruction := true;
-                            exit
-                          end;
+                case getregtype(reg) of
+                  R_INTREGISTER:
+                    begin
+                      case getsupreg(reg) of
+                        RS_EAX:
+                          if [Ch_REAX,Ch_RWEAX,Ch_MEAX]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        RS_ECX:
+                          if [Ch_RECX,Ch_RWECX,Ch_MECX]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        RS_EDX:
+                          if [Ch_REDX,Ch_RWEDX,Ch_MEDX]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        RS_EBX:
+                          if [Ch_REBX,Ch_RWEBX,Ch_MEBX]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        RS_ESP:
+                          if [Ch_RESP,Ch_RWESP,Ch_MESP]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        RS_EBP:
+                          if [Ch_REBP,Ch_RWEBP,Ch_MEBP]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        RS_ESI:
+                          if [Ch_RESI,Ch_RWESI,Ch_MESI]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        RS_EDI:
+                          if [Ch_REDI,Ch_RWEDI,Ch_MEDI]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        end;
                     end;
                     end;
-                  end;
+                  R_MMREGISTER:
+                    begin
+                      case getsupreg(reg) of
+                        RS_XMM0:
+                          if [Ch_RXMM0,Ch_RWXMM0,Ch_MXMM0]*Ch<>[] then
+                            begin
+                              RegReadByInstruction := true;
+                              exit
+                            end;
+                        end;
+                    end;
+                  else
+                    ;
+                end;
                 if SuperRegistersEqual(reg,NR_DEFAULTFLAGS) then
                 if SuperRegistersEqual(reg,NR_DEFAULTFLAGS) then
                   begin
                   begin
                     if (Ch_RFLAGScc in Ch) and not(getsubreg(reg) in [R_SUBW,R_SUBD,R_SUBQ]) then
                     if (Ch_RFLAGScc in Ch) and not(getsubreg(reg) in [R_SUBW,R_SUBD,R_SUBQ]) then
@@ -723,6 +738,17 @@ unit aoptx86;
           if result then
           if result then
             exit;
             exit;
         end
         end
+      else if getregtype(reg)=R_MMREGISTER then
+        begin
+          case getsupreg(reg) of
+            RS_XMM0:
+              result:=([Ch_RXMM0,Ch_WXMM0,Ch_RWXMM0,Ch_MXMM0]*insprop[taicpu(p1).opcode].Ch)<>[];
+            else
+              ;
+          end;
+          if result then
+            exit;
+        end
       else if SuperRegistersEqual(reg,NR_DEFAULTFLAGS) then
       else if SuperRegistersEqual(reg,NR_DEFAULTFLAGS) then
         begin
         begin
           if ([Ch_RFlags,Ch_WFlags,Ch_RWFlags,Ch_RFLAGScc]*insprop[taicpu(p1).opcode].Ch)<>[] then
           if ([Ch_RFlags,Ch_WFlags,Ch_RWFlags,Ch_RFLAGScc]*insprop[taicpu(p1).opcode].Ch)<>[] then

+ 1 - 1
compiler/x86/x86ins.dat

@@ -9158,7 +9158,7 @@ xmmreg,xmmrm                              \3\x0F\x38\xC\110
 
 
 [SHA256RNDS2]
 [SHA256RNDS2]
 ; reads also xmm0 !
 ; reads also xmm0 !
-(Ch_Mop2, Ch_Rop1)
+(Ch_Mop2, Ch_Rop1, Ch_RXMM0)
 xmmreg,xmmrm                              \3\x0F\x38\xCB\110                        SHA
 xmmreg,xmmrm                              \3\x0F\x38\xCB\110                        SHA
 
 
 [SHA256MSG1]
 [SHA256MSG1]

+ 1 - 1
compiler/x86_64/x8664pro.inc

@@ -1436,7 +1436,7 @@
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
-(Ch: [Ch_Mop2, Ch_Rop1]),
+(Ch: [Ch_Mop2, Ch_Rop1, Ch_RXMM0]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1]),
 (Ch: [Ch_Mop2, Ch_Rop1])
 (Ch: [Ch_Mop2, Ch_Rop1])
 );
 );