Browse Source

* corrected problem in PPU tables
+ supported MMX operations
* corrected MMX example program (was wrong)

carl 24 years ago
parent
commit
933cfa51c1
1 changed files with 20 additions and 3 deletions
  1. 20 3
      docs/prog.tex

+ 20 - 3
docs/prog.tex

@@ -2120,9 +2120,11 @@ Program SaturationDemo;
   example for saturation, scales data (for example audio)
   example for saturation, scales data (for example audio)
   with 1.5 with rounding to negative infinity
   with 1.5 with rounding to negative infinity
 }
 }
+uses mmx;
 
 
 var
 var
    audio1 : tmmxword;
    audio1 : tmmxword;
+   i: smallint;
 
 
 const
 const
    helpdata1 : tmmxword = ($c000,$c000,$c000,$c000);
    helpdata1 : tmmxword = ($c000,$c000,$c000,$c000);
@@ -2132,13 +2134,15 @@ begin
    { audio1 contains four 16 bit audio samples }
    { audio1 contains four 16 bit audio samples }
 {$mmx+}
 {$mmx+}
    { convert it to $8000 is defined as zero, multiply data with 0.75 }
    { convert it to $8000 is defined as zero, multiply data with 0.75 }
-   audio1:=tmmxfixed16(audio1+helpdata2)*tmmxfixed(helpdata1);
+   audio1:=(audio1+helpdata2)*(helpdata1);
 {$saturation+}
 {$saturation+}
    { avoid overflows (all values>$7fff becomes $ffff) }
    { avoid overflows (all values>$7fff becomes $ffff) }
    audio1:=(audio1+helpdata2)-helpdata2;
    audio1:=(audio1+helpdata2)-helpdata2;
 {$saturation-}
 {$saturation-}
    { now mupltily with 2 and change to integer }
    { now mupltily with 2 and change to integer }
-   audio1:=(audio1 shl 1)-helpdata2;
+   for i:=0 to 3 do
+     audio1[i] := audio1[i] shl 1;
+   audio1:=audio1-helpdata2;
 {$mmx-}
 {$mmx-}
 end.
 end.
 \end{verbatim}
 \end{verbatim}
@@ -2179,7 +2183,18 @@ check this, so you are responsible for this!
 \section{Supported MMX operations}
 \section{Supported MMX operations}
 \label{se:SupportedMMX}
 \label{se:SupportedMMX}
 
 
-{\em Still to be written \dots}
+The following operations are supported in the compiler when MMX
+extensions are enabled:
+
+\begin{itemize}
+\item addition (\var{+})
+\item subtraction (\var{-})
+\item multiplication(\var{*})
+\item logical exclusive or (\var{xor})
+\item logical and (\var{and})
+\item logical or (\var{or})
+\item sign change (\var{-})
+\end{itemize}
 
 
 \section{Optimizing MMX support}
 \section{Optimizing MMX support}
 \label{se:OptimizingMMX}
 \label{se:OptimizingMMX}
@@ -5237,6 +5252,7 @@ Not all the flags are described, for more information, read the source code of
 \begin{FPCltable}{|ll|}{PPU Header Flag values}{PPUHeaderFlags}
 \begin{FPCltable}{|ll|}{PPU Header Flag values}{PPUHeaderFlags}
 \hline
 \hline
 Symbolic bit flag name & Description\\
 Symbolic bit flag name & Description\\
+\hline
 uf\_init & Module has an initialization (either Delphi or TP style) section. \\
 uf\_init & Module has an initialization (either Delphi or TP style) section. \\
 uf\_finalize & Module has a finalization section. \\
 uf\_finalize & Module has a finalization section. \\
 uf\_big\_endian & All the data stored in the chunks is in big-endian format.\\
 uf\_big\_endian & All the data stored in the chunks is in big-endian format.\\
@@ -5298,6 +5314,7 @@ description of the most common ones are shown in \seet{PPUEntryTypes}.
 \begin{FPCltable}{|lll|}{Possible PPU Entry types}{PPUEntryTypes}
 \begin{FPCltable}{|lll|}{Possible PPU Entry types}{PPUEntryTypes}
 \hline
 \hline
 Symbolic name & Location & Description\\
 Symbolic name & Location & Description\\
+\hline
 ibmodulename  & General & Name of this unit.\\
 ibmodulename  & General & Name of this unit.\\
 ibsourcefiles & General & Name of source files.\\
 ibsourcefiles & General & Name of source files.\\
 ibusedmacros & General & Name and state of macros used.\\
 ibusedmacros & General & Name and state of macros used.\\