Browse Source

Merged revisions 7095-7097 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r7095 | pierre | 2007-04-13 09:10:05 +0200 (Fri, 13 Apr 2007) | 1 line

* check if SSE2 is supported before running
........
r7096 | pierre | 2007-04-13 09:12:45 +0200 (Fri, 13 Apr 2007) | 1 line

* library not supported for go32v2 target
........
r7097 | pierre | 2007-04-13 09:13:10 +0200 (Fri, 13 Apr 2007) | 1 line

* library not supported for go32v2 target
........

git-svn-id: branches/fixes_2_2@7116 -

pierre 18 years ago
parent
commit
64757ae706
3 changed files with 31 additions and 4 deletions
  1. 1 1
      tests/webtbs/tw3082.pp
  2. 1 0
      tests/webtbs/tw3402.pp
  3. 29 3
      tests/webtbs/tw7719.pp

+ 1 - 1
tests/webtbs/tw3082.pp

@@ -1,6 +1,6 @@
 { %norun }
 { %cpu=x86_64,i386,powerpc,sparc}
-{ %skiptarget = macos }
+{ %skiptarget = go32v2,macos }
 { execute this test only on reasonable fast cpus }
 library lib;
 const

+ 1 - 0
tests/webtbs/tw3402.pp

@@ -1,4 +1,5 @@
 { %norun }
+{ %skiptarget=go32v2 }
 { %opt=-Cg }
 
 { Source provided for Free Pascal Bug Report 3402 }

+ 29 - 3
tests/webtbs/tw7719.pp

@@ -2,12 +2,38 @@
 {$asmmode intel}
 program test;
 
+{$ifdef CPU386}
+  {$define USE_MMX_UNIT}
+  { I do not know if SSE2 is always true for x86_64
+    but mmx unit is i386 specific PM }
+{$endif CPU386}
+
+{$ifdef USE_MMX_UNIT}
+uses
+  mmx;
+{$endif USE_MMX_UNIT}
+
 {$APPTYPE CONSOLE}
 
+procedure call_psrldq;
 begin
-
-asm
-psrldq xmm2,4
+  asm
+    psrldq xmm2,4
+  end;
 end;
 
+begin
+{$ifdef USE_MMX_UNIT}
+  if not is_sse2_cpu then
+    begin
+      Writeln('SSE2 extension not supported by CPU');
+      Writeln('SSE2 specific code not run');
+    end
+  else
+{$endif USE_MMX_UNIT}
+    begin
+      Writeln('SSE2 extension supported by CPU');
+      call_psrldq;
+      Writeln('SSE2 extension code run');
+    end;
 end.