Browse Source

+ support the cmpsd sse instruction in the at&t inline assembly reader

git-svn-id: trunk@36124 -
nickysn 8 years ago
parent
commit
c28d533bb0
3 changed files with 23 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 3 0
      compiler/x86/rax86att.pas
  3. 19 0
      tests/tbs/tb0628.pp

+ 1 - 0
.gitattributes

@@ -11152,6 +11152,7 @@ tests/tbs/tb0626.pp svneol=native#text/pascal
 tests/tbs/tb0627.pp svneol=native#text/pascal
 tests/tbs/tb0627a.pp svneol=native#text/pascal
 tests/tbs/tb0627b.pp svneol=native#text/pascal
+tests/tbs/tb0628.pp svneol=native#text/pascal
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/tb610.pp svneol=native#text/pascal
 tests/tbs/tb613.pp svneol=native#text/plain

+ 3 - 0
compiler/x86/rax86att.pas

@@ -907,6 +907,9 @@ Implementation
                     this cannot be expressed by the instruction table format so we have to hack around this here }
                   if (actopcode = A_NONE) and (upper(s) = 'MOVSD') then
                     actopcode := A_MOVSD;
+                  { cmpsd also needs special handling for pretty much the same reasons as movsd }
+                  if (actopcode = A_NONE) and (upper(s) = 'CMPSD') then
+                    actopcode := A_CMPSD;
 
                   { two-letter suffix is allowed by just a few instructions (movsx,movzx),
                     and it is always required whenever allowed }

+ 19 - 0
tests/tbs/tb0628.pp

@@ -0,0 +1,19 @@
+{ %CPU=i386,x86_64 }
+{ %NORUN }
+
+program tb0628;
+
+{$asmmode att}
+
+begin
+  asm
+    cmpsd $0,%xmm1,%xmm0
+    cmpsd $1,%xmm1,%xmm0
+    cmpsd $2,%xmm1,%xmm0
+    cmpsd $3,%xmm1,%xmm0
+    cmpsd $4,%xmm1,%xmm0
+    cmpsd $5,%xmm1,%xmm0
+    cmpsd $6,%xmm1,%xmm0
+    cmpsd $7,%xmm1,%xmm0
+  end;
+end.