Pārlūkot izejas kodu

* x86: New debug_hexstr instruction to help produce concise debug comments

J. Gareth "Curious Kit" Moreton 2 gadi atpakaļ
vecāks
revīzija
ae47cc2c88
1 mainītis faili ar 22 papildinājumiem un 0 dzēšanām
  1. 22 0
      compiler/x86/aoptx86.pas

+ 22 - 0
compiler/x86/aoptx86.pas

@@ -1224,6 +1224,23 @@ unit aoptx86;
         Result := tostr(i);
       end;
 
+    function debug_hexstr(i: tcgint): string;
+      begin
+        Result := '0x';
+        case i of
+          0..$FF:
+            Result := Result + hexstr(i, 2);
+          $100..$FFFF:
+            Result := Result + hexstr(i, 4);
+          $10000..$FFFFFF:
+            Result := Result + hexstr(i, 6);
+          $1000000..$FFFFFFFF:
+            Result := Result + hexstr(i, 8);
+          else
+            Result := Result + hexstr(i, 16);
+        end;
+      end;
+
     function debug_regname(r: TRegister): string; inline;
       begin
         Result := '%' + std_regname(r);
@@ -1284,6 +1301,11 @@ unit aoptx86;
         Result := '';
       end;
 
+    function debug_hexstr(i: tcgint): string; inline;
+      begin
+        Result := '';
+      end;
+
     function debug_regname(r: TRegister): string; inline;
       begin
         Result := '';