Browse Source

AArch64 asm reader: add support for fpcmp(e) conditions

Resolves #39643
Jonas Maebe 3 years ago
parent
commit
9813eb9048
2 changed files with 33 additions and 0 deletions
  1. 1 0
      compiler/aarch64/racpugas.pas
  2. 32 0
      tests/webtbs/tw39643.pp

+ 1 - 0
compiler/aarch64/racpugas.pas

@@ -564,6 +564,7 @@ Unit racpugas;
         case actopcode of
           A_CSEL,A_CSINC,A_CSINV,A_CSNEG,A_CSET,A_CSETM,
           A_CINC,A_CINV,A_CNEG,A_CCMN,A_CCMP,
+          A_FCCMP,A_FCCMPE,
           A_B:
             begin
               { search for condition, conditions are always 2 chars }

+ 32 - 0
tests/webtbs/tw39643.pp

@@ -0,0 +1,32 @@
+{ %cpu=aarch64 }
+{ %norun }
+
+{$mode delphi}
+program AsmQBug;
+
+type
+  PVector = ^TVector;
+  TVector = record
+    A, B, C, D: Single;
+  end;
+
+function AsmFunc(V: PVector): Single;
+{ Delphi code:
+begin
+  Result := V.A;
+end; }
+asm
+  // This gives error "unknown identifier: NE"
+  fccmp  d0, d0, #0x0, ne
+  fccmpe  d0, d0, #0x0, ne
+end;
+
+var
+  V: TVector;
+begin
+  V.A := 1;
+  V.B := 2;
+  V.C := 3;
+  V.D := 4;
+  WriteLn('Expected=1 Actual=', AsmFunc(@V));
+end.