isa: corrected condtions
authorMartin Perner <martin@perner.cc>
Tue, 26 Oct 2010 15:26:45 +0000 (17:26 +0200)
committerMartin Perner <martin@perner.cc>
Tue, 26 Oct 2010 15:26:45 +0000 (17:26 +0200)
but conditions for unsigned values are still unclear

2_isa/conds.tex

index 0d4e6af8f778267dacef9d88f0684d5ee4b02bc6..1415c35cbf76a074bf69c96befce4720dd780d63 100644 (file)
@@ -4,16 +4,16 @@
        \centering
        \begin{tabular}{|c|c|c|c|}\hline
                Bitcode & Condition               & Bits to test                & suffixes      \\ \hline
-               0000    & equal / zero            & ZF = 0                      & eq, zs        \\ \hline
-               0001    & not equal / not zero    & ZF = 1                      & neq, nz       \\ \hline
+               0000    & not equal / not zero    & ZF = 0                      & nq, nz        \\ \hline
+               0001    & equal / zero            & ZF = 1                      & eq, zs        \\ \hline
                0010    & not overflow            & OF = 0                      & no            \\ \hline
                0011    & overflow                & OF = 1                      & ov            \\ \hline
-               0100    & not carry / below       & CF = 0                      & nc, bl        \\ \hline
-               0101    & carry / above or equal  & CF = 1                      & cs, ae        \\ \hline
+               0100 X  & not carry / above e q   & CF = 0                      & nc, ae        \\ \hline
+               0101 X  & carry / below           & CF = 1                      & cs, bl        \\ \hline
                0110    & not signed / not neg.   & SF = 0                      & ns, nn        \\ \hline
                0111    & signed / neg.           & SF = 1                      & ss, ns        \\ \hline
-               1000    & above                   & (CF == 0 $\wedge$ ZF ==  0) & ab            \\ \hline
-               1001    & below or equal          & (CF == 1 $\vee$ ZF == 1)    & be            \\ \hline
+               1000 X  & above                   & (CF == 0 $\wedge$ ZF ==  0) & ab            \\ \hline
+               1001 X  & below or equal          & (CF == 1 $\vee$ ZF == 1)    & be            \\ \hline
                1010    & greater than or equal   & SF == OF                    & ge            \\ \hline
                1011    & less than               & SF != OF                    & lt            \\ \hline
                1100    & greater than            & (ZF == 0 $\wedge$ SF == OF) & gt            \\ \hline
        \caption{codierung von conditions WARNING! may contain BUGS!!}
 \end{table}
 
+
+above and below are for unsigned, greater and less for signed values
+
+note: it seams that the definition of conditions on unsigned values depend on the instruction set. below is CF = 1 by x86/amd64 and avr, CF = 0 by arm. when cmp is defined as cmp r1, r2 == r1-r2 == is r1 COND r2 then arm looks more saner. the conditons marked with a X in the bitcode are open for change because of this unclear situation \Large{RFC} \normalsize
+
 \begin{table}
        \centering
        \begin{tabular}{|l|c|c|c|c|} \hline