/src/ghostpdl/base/gsroptab.c
Line | Count | Source |
1 | | /* Copyright (C) 2001-2023 Artifex Software, Inc. |
2 | | All Rights Reserved. |
3 | | |
4 | | This software is provided AS-IS with no warranty, either express or |
5 | | implied. |
6 | | |
7 | | This software is distributed under license and may not be copied, |
8 | | modified or distributed except as expressly authorized under the terms |
9 | | of the license contained in the file LICENSE in this distribution. |
10 | | |
11 | | Refer to licensing information at http://www.artifex.com or contact |
12 | | Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco, |
13 | | CA 94129, USA, for further information. |
14 | | */ |
15 | | |
16 | | |
17 | | /* Table of RasterOp procedures */ |
18 | | #include "stdpre.h" |
19 | | #include "gsropt.h" |
20 | | |
21 | | /* |
22 | | * The H-P documentation (probably copied from Microsoft documentation) |
23 | | * specifies RasterOp algorithms using reverse Polish notation, with |
24 | | * a = AND, o = OR, n = NOT, x = XOR |
25 | | */ |
26 | | |
27 | | #define ROP_PROC(pname, expr)\ |
28 | 988M | static rop_operand pname(rop_operand D, rop_operand S, rop_operand T)\ |
29 | 988M | { return expr; } Unexecuted instantiation: gsroptab.c:rop0 Unexecuted instantiation: gsroptab.c:rop1 Unexecuted instantiation: gsroptab.c:rop2 Unexecuted instantiation: gsroptab.c:rop3 Unexecuted instantiation: gsroptab.c:rop4 Unexecuted instantiation: gsroptab.c:rop5 Unexecuted instantiation: gsroptab.c:rop6 Unexecuted instantiation: gsroptab.c:rop7 Unexecuted instantiation: gsroptab.c:rop8 Unexecuted instantiation: gsroptab.c:rop9 Unexecuted instantiation: gsroptab.c:rop10 Unexecuted instantiation: gsroptab.c:rop11 Unexecuted instantiation: gsroptab.c:rop12 Unexecuted instantiation: gsroptab.c:rop13 Unexecuted instantiation: gsroptab.c:rop14 Line | Count | Source | 28 | 969M | static rop_operand pname(rop_operand D, rop_operand S, rop_operand T)\ | 29 | 969M | { return expr; } |
Unexecuted instantiation: gsroptab.c:rop16 Unexecuted instantiation: gsroptab.c:rop17 Unexecuted instantiation: gsroptab.c:rop18 Unexecuted instantiation: gsroptab.c:rop19 Unexecuted instantiation: gsroptab.c:rop20 Unexecuted instantiation: gsroptab.c:rop21 Unexecuted instantiation: gsroptab.c:rop22 Unexecuted instantiation: gsroptab.c:rop23 Unexecuted instantiation: gsroptab.c:rop24 Unexecuted instantiation: gsroptab.c:rop25 Unexecuted instantiation: gsroptab.c:rop26 Unexecuted instantiation: gsroptab.c:rop27 Unexecuted instantiation: gsroptab.c:rop28 Unexecuted instantiation: gsroptab.c:rop29 Unexecuted instantiation: gsroptab.c:rop30 Unexecuted instantiation: gsroptab.c:rop31 Unexecuted instantiation: gsroptab.c:rop32 Unexecuted instantiation: gsroptab.c:rop33 Line | Count | Source | 28 | 8.98M | static rop_operand pname(rop_operand D, rop_operand S, rop_operand T)\ | 29 | 8.98M | { return expr; } |
Unexecuted instantiation: gsroptab.c:rop35 Unexecuted instantiation: gsroptab.c:rop36 Unexecuted instantiation: gsroptab.c:rop37 Unexecuted instantiation: gsroptab.c:rop38 Unexecuted instantiation: gsroptab.c:rop39 Unexecuted instantiation: gsroptab.c:rop40 Unexecuted instantiation: gsroptab.c:rop41 Unexecuted instantiation: gsroptab.c:rop42 Unexecuted instantiation: gsroptab.c:rop43 Unexecuted instantiation: gsroptab.c:rop44 Unexecuted instantiation: gsroptab.c:rop45 Unexecuted instantiation: gsroptab.c:rop46 Unexecuted instantiation: gsroptab.c:rop47 Unexecuted instantiation: gsroptab.c:rop48 Unexecuted instantiation: gsroptab.c:rop49 Unexecuted instantiation: gsroptab.c:rop50 Unexecuted instantiation: gsroptab.c:rop51 Unexecuted instantiation: gsroptab.c:rop52 Unexecuted instantiation: gsroptab.c:rop53 Unexecuted instantiation: gsroptab.c:rop54 Unexecuted instantiation: gsroptab.c:rop55 Unexecuted instantiation: gsroptab.c:rop56 Unexecuted instantiation: gsroptab.c:rop57 Unexecuted instantiation: gsroptab.c:rop58 Unexecuted instantiation: gsroptab.c:rop59 Unexecuted instantiation: gsroptab.c:rop60 Unexecuted instantiation: gsroptab.c:rop61 Unexecuted instantiation: gsroptab.c:rop62 Unexecuted instantiation: gsroptab.c:rop63 Unexecuted instantiation: gsroptab.c:rop64 Unexecuted instantiation: gsroptab.c:rop65 Unexecuted instantiation: gsroptab.c:rop66 Unexecuted instantiation: gsroptab.c:rop67 Unexecuted instantiation: gsroptab.c:rop68 Unexecuted instantiation: gsroptab.c:rop69 Unexecuted instantiation: gsroptab.c:rop70 Unexecuted instantiation: gsroptab.c:rop71 Unexecuted instantiation: gsroptab.c:rop72 Unexecuted instantiation: gsroptab.c:rop73 Unexecuted instantiation: gsroptab.c:rop74 Unexecuted instantiation: gsroptab.c:rop75 Unexecuted instantiation: gsroptab.c:rop76 Unexecuted instantiation: gsroptab.c:rop77 Unexecuted instantiation: gsroptab.c:rop78 Unexecuted instantiation: gsroptab.c:rop79 Unexecuted instantiation: gsroptab.c:rop80 Unexecuted instantiation: gsroptab.c:rop81 Unexecuted instantiation: gsroptab.c:rop82 Unexecuted instantiation: gsroptab.c:rop83 Unexecuted instantiation: gsroptab.c:rop84 Unexecuted instantiation: gsroptab.c:rop85 Unexecuted instantiation: gsroptab.c:rop86 Unexecuted instantiation: gsroptab.c:rop87 Unexecuted instantiation: gsroptab.c:rop88 Unexecuted instantiation: gsroptab.c:rop89 Unexecuted instantiation: gsroptab.c:rop90 Unexecuted instantiation: gsroptab.c:rop91 Unexecuted instantiation: gsroptab.c:rop92 Unexecuted instantiation: gsroptab.c:rop93 Unexecuted instantiation: gsroptab.c:rop94 Unexecuted instantiation: gsroptab.c:rop95 Unexecuted instantiation: gsroptab.c:rop96 Unexecuted instantiation: gsroptab.c:rop97 Unexecuted instantiation: gsroptab.c:rop98 Unexecuted instantiation: gsroptab.c:rop99 Unexecuted instantiation: gsroptab.c:rop100 Unexecuted instantiation: gsroptab.c:rop101 Unexecuted instantiation: gsroptab.c:rop102 Unexecuted instantiation: gsroptab.c:rop103 Unexecuted instantiation: gsroptab.c:rop104 Unexecuted instantiation: gsroptab.c:rop105 Unexecuted instantiation: gsroptab.c:rop106 Unexecuted instantiation: gsroptab.c:rop107 Unexecuted instantiation: gsroptab.c:rop108 Unexecuted instantiation: gsroptab.c:rop109 Unexecuted instantiation: gsroptab.c:rop110 Unexecuted instantiation: gsroptab.c:rop111 Unexecuted instantiation: gsroptab.c:rop112 Unexecuted instantiation: gsroptab.c:rop113 Unexecuted instantiation: gsroptab.c:rop114 Unexecuted instantiation: gsroptab.c:rop115 Unexecuted instantiation: gsroptab.c:rop116 Unexecuted instantiation: gsroptab.c:rop117 Unexecuted instantiation: gsroptab.c:rop118 Unexecuted instantiation: gsroptab.c:rop119 Unexecuted instantiation: gsroptab.c:rop120 Unexecuted instantiation: gsroptab.c:rop121 Unexecuted instantiation: gsroptab.c:rop122 Unexecuted instantiation: gsroptab.c:rop123 Unexecuted instantiation: gsroptab.c:rop124 Unexecuted instantiation: gsroptab.c:rop125 Unexecuted instantiation: gsroptab.c:rop126 Unexecuted instantiation: gsroptab.c:rop127 Unexecuted instantiation: gsroptab.c:rop128 Unexecuted instantiation: gsroptab.c:rop129 Unexecuted instantiation: gsroptab.c:rop130 Unexecuted instantiation: gsroptab.c:rop131 Unexecuted instantiation: gsroptab.c:rop132 Unexecuted instantiation: gsroptab.c:rop133 Unexecuted instantiation: gsroptab.c:rop134 Unexecuted instantiation: gsroptab.c:rop135 Line | Count | Source | 28 | 1.26M | static rop_operand pname(rop_operand D, rop_operand S, rop_operand T)\ | 29 | 1.26M | { return expr; } |
Unexecuted instantiation: gsroptab.c:rop137 Unexecuted instantiation: gsroptab.c:rop138 Unexecuted instantiation: gsroptab.c:rop139 Unexecuted instantiation: gsroptab.c:rop140 Unexecuted instantiation: gsroptab.c:rop141 Unexecuted instantiation: gsroptab.c:rop142 Unexecuted instantiation: gsroptab.c:rop143 Unexecuted instantiation: gsroptab.c:rop144 Unexecuted instantiation: gsroptab.c:rop145 Unexecuted instantiation: gsroptab.c:rop146 Unexecuted instantiation: gsroptab.c:rop147 Unexecuted instantiation: gsroptab.c:rop148 Unexecuted instantiation: gsroptab.c:rop149 Unexecuted instantiation: gsroptab.c:rop150 Unexecuted instantiation: gsroptab.c:rop151 Unexecuted instantiation: gsroptab.c:rop152 Unexecuted instantiation: gsroptab.c:rop153 Unexecuted instantiation: gsroptab.c:rop154 Unexecuted instantiation: gsroptab.c:rop155 Unexecuted instantiation: gsroptab.c:rop156 Unexecuted instantiation: gsroptab.c:rop157 Unexecuted instantiation: gsroptab.c:rop158 Unexecuted instantiation: gsroptab.c:rop159 Unexecuted instantiation: gsroptab.c:rop160 Unexecuted instantiation: gsroptab.c:rop161 Unexecuted instantiation: gsroptab.c:rop162 Unexecuted instantiation: gsroptab.c:rop163 Unexecuted instantiation: gsroptab.c:rop164 Unexecuted instantiation: gsroptab.c:rop165 Unexecuted instantiation: gsroptab.c:rop166 Unexecuted instantiation: gsroptab.c:rop167 Unexecuted instantiation: gsroptab.c:rop168 Unexecuted instantiation: gsroptab.c:rop169 Unexecuted instantiation: gsroptab.c:rop170 Unexecuted instantiation: gsroptab.c:rop171 Unexecuted instantiation: gsroptab.c:rop172 Unexecuted instantiation: gsroptab.c:rop173 Unexecuted instantiation: gsroptab.c:rop174 Unexecuted instantiation: gsroptab.c:rop175 Unexecuted instantiation: gsroptab.c:rop176 Unexecuted instantiation: gsroptab.c:rop177 Unexecuted instantiation: gsroptab.c:rop178 Unexecuted instantiation: gsroptab.c:rop179 Unexecuted instantiation: gsroptab.c:rop180 Unexecuted instantiation: gsroptab.c:rop181 Unexecuted instantiation: gsroptab.c:rop182 Unexecuted instantiation: gsroptab.c:rop183 Unexecuted instantiation: gsroptab.c:rop184 Unexecuted instantiation: gsroptab.c:rop185 Unexecuted instantiation: gsroptab.c:rop186 Line | Count | Source | 28 | 2.61M | static rop_operand pname(rop_operand D, rop_operand S, rop_operand T)\ | 29 | 2.61M | { return expr; } |
Unexecuted instantiation: gsroptab.c:rop188 Unexecuted instantiation: gsroptab.c:rop189 Unexecuted instantiation: gsroptab.c:rop190 Unexecuted instantiation: gsroptab.c:rop191 Unexecuted instantiation: gsroptab.c:rop192 Unexecuted instantiation: gsroptab.c:rop193 Unexecuted instantiation: gsroptab.c:rop194 Unexecuted instantiation: gsroptab.c:rop195 Unexecuted instantiation: gsroptab.c:rop196 Unexecuted instantiation: gsroptab.c:rop197 Unexecuted instantiation: gsroptab.c:rop198 Unexecuted instantiation: gsroptab.c:rop199 Unexecuted instantiation: gsroptab.c:rop200 Unexecuted instantiation: gsroptab.c:rop201 Unexecuted instantiation: gsroptab.c:rop202 Unexecuted instantiation: gsroptab.c:rop203 Unexecuted instantiation: gsroptab.c:rop204 Unexecuted instantiation: gsroptab.c:rop205 Unexecuted instantiation: gsroptab.c:rop206 Unexecuted instantiation: gsroptab.c:rop207 Unexecuted instantiation: gsroptab.c:rop208 Unexecuted instantiation: gsroptab.c:rop209 Unexecuted instantiation: gsroptab.c:rop210 Unexecuted instantiation: gsroptab.c:rop211 Unexecuted instantiation: gsroptab.c:rop212 Unexecuted instantiation: gsroptab.c:rop213 Unexecuted instantiation: gsroptab.c:rop214 Unexecuted instantiation: gsroptab.c:rop215 Unexecuted instantiation: gsroptab.c:rop216 Unexecuted instantiation: gsroptab.c:rop217 Unexecuted instantiation: gsroptab.c:rop218 Unexecuted instantiation: gsroptab.c:rop219 Unexecuted instantiation: gsroptab.c:rop220 Unexecuted instantiation: gsroptab.c:rop221 Unexecuted instantiation: gsroptab.c:rop222 Unexecuted instantiation: gsroptab.c:rop223 Unexecuted instantiation: gsroptab.c:rop224 Unexecuted instantiation: gsroptab.c:rop225 Unexecuted instantiation: gsroptab.c:rop226 Unexecuted instantiation: gsroptab.c:rop227 Unexecuted instantiation: gsroptab.c:rop228 Unexecuted instantiation: gsroptab.c:rop229 Unexecuted instantiation: gsroptab.c:rop230 Unexecuted instantiation: gsroptab.c:rop231 Unexecuted instantiation: gsroptab.c:rop232 Unexecuted instantiation: gsroptab.c:rop233 Unexecuted instantiation: gsroptab.c:rop234 Unexecuted instantiation: gsroptab.c:rop235 Unexecuted instantiation: gsroptab.c:rop236 Unexecuted instantiation: gsroptab.c:rop237 Unexecuted instantiation: gsroptab.c:rop238 Unexecuted instantiation: gsroptab.c:rop239 Line | Count | Source | 28 | 5.41M | static rop_operand pname(rop_operand D, rop_operand S, rop_operand T)\ | 29 | 5.41M | { return expr; } |
Unexecuted instantiation: gsroptab.c:rop241 Unexecuted instantiation: gsroptab.c:rop242 Unexecuted instantiation: gsroptab.c:rop243 Unexecuted instantiation: gsroptab.c:rop244 Unexecuted instantiation: gsroptab.c:rop245 Unexecuted instantiation: gsroptab.c:rop246 Unexecuted instantiation: gsroptab.c:rop247 Unexecuted instantiation: gsroptab.c:rop248 Unexecuted instantiation: gsroptab.c:rop249 Line | Count | Source | 28 | 62.7k | static rop_operand pname(rop_operand D, rop_operand S, rop_operand T)\ | 29 | 62.7k | { return expr; } |
Unexecuted instantiation: gsroptab.c:rop251 Unexecuted instantiation: gsroptab.c:rop252 Unexecuted instantiation: gsroptab.c:rop253 Unexecuted instantiation: gsroptab.c:rop254 Unexecuted instantiation: gsroptab.c:rop255 |
30 | | |
31 | | #define a(u,v) (u&v) |
32 | | #define o(u,v) (u|v) |
33 | | #define x(u,v) (u^v) |
34 | | |
35 | | ROP_PROC(rop0, 0) /* 0 */ |
36 | | ROP_PROC(rop1, ~(D | S | T)) /* DTSoon */ |
37 | | ROP_PROC(rop2, D & ~(S | T)) /* DTSona */ |
38 | | ROP_PROC(rop3, ~(S | T)) /* TSon */ |
39 | | ROP_PROC(rop4, S & ~(D | T)) /* SDTona */ |
40 | | ROP_PROC(rop5, ~(D | T)) /* DTon */ |
41 | | ROP_PROC(rop6, ~(T | ~(D ^ S))) /* TDSxnon */ |
42 | | ROP_PROC(rop7, ~(T | (D & S))) /* TDSaon */ |
43 | | ROP_PROC(rop8, S & (D & ~T)) /* SDTnaa */ |
44 | | ROP_PROC(rop9, ~(T | (D ^ S))) /* TDSxon */ |
45 | | ROP_PROC(rop10, D & ~T) /* DTna */ |
46 | | ROP_PROC(rop11, ~(T | (S & ~D))) /* TSDnaon */ |
47 | | ROP_PROC(rop12, S & ~T) /* STna */ |
48 | | ROP_PROC(rop13, ~(T | (D & ~S))) /* TDSnaon */ |
49 | | ROP_PROC(rop14, ~(T | ~(D | S))) /* TDSonon */ |
50 | | ROP_PROC(rop15, ~T) /* Tn */ |
51 | | ROP_PROC(rop16, T & ~(D | S)) /* TDSona */ |
52 | | ROP_PROC(rop17, ~(D | S)) /* DSon */ |
53 | | ROP_PROC(rop18, ~(S | ~(D ^ T))) /* SDTxnon */ |
54 | | ROP_PROC(rop19, ~(S | (D & T))) /* SDTaon */ |
55 | | ROP_PROC(rop20, ~(D | ~(T ^ S))) /* DTSxnon */ |
56 | | ROP_PROC(rop21, ~(D | (T & S))) /* DTSaon */ |
57 | | ROP_PROC(rop22, (T ^ (S ^ (D & ~(T & S))))) /* TSDTSanaxx */ |
58 | | ROP_PROC(rop23, ~(S ^ ((S ^ T) & (D ^ S)))) /* SSTxDSxaxn */ |
59 | | ROP_PROC(rop24, (S ^ T) & (T ^ D)) /* STxTDxa */ |
60 | | ROP_PROC(rop25, ~(S ^ (D & ~(T & S)))) /* SDTSanaxn */ |
61 | | ROP_PROC(rop26, T ^ (D | (S & T))) /* TDSTaox */ |
62 | | ROP_PROC(rop27, ~(S ^ (D & (T ^ S)))) /* SDTSxaxn */ |
63 | | ROP_PROC(rop28, T ^ (S | (D & T))) /* TSDTaox */ |
64 | | ROP_PROC(rop29, ~(D ^ (S & (T ^ D)))) /* DSTDxaxn */ |
65 | | ROP_PROC(rop30, T ^ (D | S)) /* TDSox */ |
66 | | ROP_PROC(rop31, ~(T & (D | S))) /* TDSoan */ |
67 | | ROP_PROC(rop32, D & (T & ~S)) /* DTSnaa */ |
68 | | ROP_PROC(rop33, ~(S | (D ^ T))) /* SDTxon */ |
69 | | ROP_PROC(rop34, D & ~S) /* DSna */ |
70 | | ROP_PROC(rop35, ~(S | (T & ~D))) /* STDnaon */ |
71 | | ROP_PROC(rop36, (S ^ T) & (D ^ S)) /* STxDSxa */ |
72 | | ROP_PROC(rop37, ~(T ^ (D & ~(S & T)))) /* TDSTanaxn */ |
73 | | ROP_PROC(rop38, S ^ (D | (T & S))) /* SDTSaox */ |
74 | | ROP_PROC(rop39, S ^ (D | ~(T ^ S))) /* SDTSxnox */ |
75 | | ROP_PROC(rop40, D & (T ^ S)) /* DTSxa */ |
76 | | ROP_PROC(rop41, ~(T ^ (S ^ (D | (T & S))))) /* TSDTSaoxxn */ |
77 | | ROP_PROC(rop42, D & ~(T & S)) /* DTSana */ |
78 | | ROP_PROC(rop43, ~x(a(x(D, T), x(T, S)), S)) /* SSTxTDxaxn */ |
79 | | ROP_PROC(rop44, (S ^ (T & (D | S)))) /* STDSoax */ |
80 | | ROP_PROC(rop45, T ^ (S | ~D)) /* TSDnox */ |
81 | | ROP_PROC(rop46, (T ^ (S | (D ^ T)))) /* TSDTxox */ |
82 | | ROP_PROC(rop47, ~(T & (S | ~D))) /* TSDnoan */ |
83 | | ROP_PROC(rop48, T & ~S) /* TSna */ |
84 | | ROP_PROC(rop49, ~(S | (D & ~T))) /* SDTnaon */ |
85 | | ROP_PROC(rop50, S ^ (D | (T | S))) /* SDTSoox */ |
86 | | ROP_PROC(rop51, ~S) /* Sn */ |
87 | | ROP_PROC(rop52, S ^ (T | (D & S))) /* STDSaox */ |
88 | | ROP_PROC(rop53, S ^ (T | ~(D ^ S))) /* STDSxnox */ |
89 | | ROP_PROC(rop54, S ^ (D | T)) /* SDTox */ |
90 | | ROP_PROC(rop55, ~(S & (D | T))) /* SDToan */ |
91 | | ROP_PROC(rop56, T ^ (S & (D | T))) /* TSDToax */ |
92 | | ROP_PROC(rop57, S ^ (T | ~D)) /* STDnox */ |
93 | | ROP_PROC(rop58, S ^ (T | (D ^ S))) /* STDSxox */ |
94 | | ROP_PROC(rop59, ~(S & (T | ~D))) /* STDnoan */ |
95 | | ROP_PROC(rop60, T ^ S) /* TSx */ |
96 | | ROP_PROC(rop61, S ^ (T | ~(D | S))) /* STDSonox */ |
97 | | ROP_PROC(rop62, S ^ (T | (D & ~S))) /* STDSnaox */ |
98 | | ROP_PROC(rop63, ~(T & S)) /* TSan */ |
99 | | ROP_PROC(rop64, T & (S & ~D)) /* TSDnaa */ |
100 | | ROP_PROC(rop65, ~(D | (T ^ S))) /* DTSxon */ |
101 | | ROP_PROC(rop66, (S ^ D) & (T ^ D)) /* SDxTDxa */ |
102 | | ROP_PROC(rop67, ~(S ^ (T & ~(D & S)))) /* STDSanaxn */ |
103 | | ROP_PROC(rop68, S & ~D) /* SDna */ |
104 | | ROP_PROC(rop69, ~(D | (T & ~S))) /* DTSnaon */ |
105 | | ROP_PROC(rop70, D ^ (S | (T & D))) /* DSTDaox */ |
106 | | ROP_PROC(rop71, ~(T ^ (S & (D ^ T)))) /* TSDTxaxn */ |
107 | | ROP_PROC(rop72, S & (D ^ T)) /* SDTxa */ |
108 | | ROP_PROC(rop73, ~(T ^ (D ^ (S | (T & D))))) /* TDSTDaoxxn */ |
109 | | ROP_PROC(rop74, D ^ (T & (S | D))) /* DTSDoax */ |
110 | | ROP_PROC(rop75, T ^ (D | ~S)) /* TDSnox */ |
111 | | ROP_PROC(rop76, S & ~(D & T)) /* SDTana */ |
112 | | ROP_PROC(rop77, ~(S ^ ((S ^ T) | (D ^ S)))) /* SSTxDSxoxn */ |
113 | | ROP_PROC(rop78, T ^ (D | (S ^ T))) /* TDSTxox */ |
114 | | ROP_PROC(rop79, ~(T & (D | ~S))) /* TDSnoan */ |
115 | | ROP_PROC(rop80, T & ~D) /* TDna */ |
116 | | ROP_PROC(rop81, ~(D | (S & ~T))) /* DSTnaon */ |
117 | | ROP_PROC(rop82, D ^ (T | (S & D))) /* DTSDaox */ |
118 | | ROP_PROC(rop83, ~(S ^ (T & (D ^ S)))) /* STDSxaxn */ |
119 | | ROP_PROC(rop84, ~(D | ~(T | S))) /* DTSonon */ |
120 | | ROP_PROC(rop85, ~D) /* Dn */ |
121 | | ROP_PROC(rop86, D ^ (T | S)) /* DTSox */ |
122 | | ROP_PROC(rop87, ~(D & (T | S))) /* DTSoan */ |
123 | | ROP_PROC(rop88, T ^ (D & (S | T))) /* TDSToax */ |
124 | | ROP_PROC(rop89, D ^ (T | ~S)) /* DTSnox */ |
125 | | ROP_PROC(rop90, D ^ T) /* DTx */ |
126 | | ROP_PROC(rop91, D ^ (T | ~(S | D))) /* DTSDonox */ |
127 | | ROP_PROC(rop92, D ^ (T | (S ^ D))) /* DTSDxox */ |
128 | | ROP_PROC(rop93, ~(D & (T | ~S))) /* DTSnoan */ |
129 | | ROP_PROC(rop94, D ^ (T | (S & ~D))) /* DTSDnaox */ |
130 | | ROP_PROC(rop95, ~(D & T)) /* DTan */ |
131 | | ROP_PROC(rop96, T & (D ^ S)) /* TDSxa */ |
132 | | ROP_PROC(rop97, ~(D ^ (S ^ (T | (D & S))))) /* DSTDSaoxxn */ |
133 | | ROP_PROC(rop98, D ^ (S & (T | D))) /* DSTDoax */ |
134 | | ROP_PROC(rop99, S ^ (D | ~T)) /* SDTnox */ |
135 | | ROP_PROC(rop100, S ^ (D & (T | S))) /* SDTSoax */ |
136 | | ROP_PROC(rop101, D ^ (S | ~T)) /* DSTnox */ |
137 | | ROP_PROC(rop102, D ^ S) /* DSx */ |
138 | | ROP_PROC(rop103, S ^ (D | ~(T | S))) /* SDTSonox */ |
139 | | ROP_PROC(rop104, ~(D ^ (S ^ (T | ~(D | S))))) /* DSTDSonoxxn */ |
140 | | ROP_PROC(rop105, ~(T ^ (D ^ S))) /* TDSxxn */ |
141 | | ROP_PROC(rop106, D ^ (T & S)) /* DTSax */ |
142 | | ROP_PROC(rop107, ~(T ^ (S ^ (D & (T | S))))) /* TSDTSoaxxn */ |
143 | | ROP_PROC(rop108, (D & T) ^ S) /* SDTax */ |
144 | | ROP_PROC(rop109, ~((((T | D) & S) ^ D) ^ T)) /* TDSTDoaxxn */ |
145 | | ROP_PROC(rop110, ((~S | T) & D) ^ S) /* SDTSnoax */ |
146 | | ROP_PROC(rop111, ~(~(D ^ S) & T)) /* TDSxnan */ |
147 | | ROP_PROC(rop112, ~(D & S) & T) /* TDSana */ |
148 | | ROP_PROC(rop113, ~(((S ^ D) & (T ^ D)) ^ S)) /* SSDxTDxaxn */ |
149 | | ROP_PROC(rop114, ((T ^ S) | D) ^ S) /* SDTSxox */ |
150 | | ROP_PROC(rop115, ~((~T | D) & S)) /* SDTnoan */ |
151 | | ROP_PROC(rop116, ((T ^ D) | S) ^ D) /* DSTDxox */ |
152 | | ROP_PROC(rop117, ~((~T | S) & D)) /* DSTnoan */ |
153 | | ROP_PROC(rop118, ((~S & T) | D) ^ S) /* SDTSnaox */ |
154 | | ROP_PROC(rop119, ~(D & S)) /* DSan */ |
155 | | ROP_PROC(rop120, (D & S) ^ T) /* TDSax */ |
156 | | ROP_PROC(rop121, ~((((D | S) & T) ^ S) ^ D)) /* DSTDSoaxxn */ |
157 | | ROP_PROC(rop122, ((~D | S) & T) ^ D) /* DTSDnoax */ |
158 | | ROP_PROC(rop123, ~(~(D ^ T) & S)) /* SDTxnan */ |
159 | | ROP_PROC(rop124, ((~S | D) & T) ^ S) /* STDSnoax */ |
160 | | ROP_PROC(rop125, ~(~(T ^ S) & D)) /* DTSxnan */ |
161 | | ROP_PROC(rop126, (S ^ T) | (D ^ S)) /* STxDSxo */ |
162 | | ROP_PROC(rop127, ~((T & S) & D)) /* DTSaan */ |
163 | | ROP_PROC(rop128, (T & S) & D) /* DTSaa */ |
164 | | ROP_PROC(rop129, ~((S ^ T) | (D ^ S))) /* STxDSxon */ |
165 | | ROP_PROC(rop130, ~(T ^ S) & D) /* DTSxna */ |
166 | | ROP_PROC(rop131, ~(((~S | D) & T) ^ S)) /* STDSnoaxn */ |
167 | | ROP_PROC(rop132, ~(D ^ T) & S) /* SDTxna */ |
168 | | ROP_PROC(rop133, ~(((~T | S) & D) ^ T)) /* TDSTnoaxn */ |
169 | | ROP_PROC(rop134, (((D | S) & T) ^ S) ^ D) /* DSTDSoaxx */ |
170 | | ROP_PROC(rop135, ~((D & S) ^ T)) /* TDSaxn */ |
171 | | ROP_PROC(rop136, D & S) /* DSa */ |
172 | | ROP_PROC(rop137, ~(((~S & T) | D) ^ S)) /* SDTSnaoxn */ |
173 | | ROP_PROC(rop138, (~T | S) & D) /* DSTnoa */ |
174 | | ROP_PROC(rop139, ~(((T ^ D) | S) ^ D)) /* DSTDxoxn */ |
175 | | ROP_PROC(rop140, (~T | D) & S) /* SDTnoa */ |
176 | | ROP_PROC(rop141, ~(((T ^ S) | D) ^ S)) /* SDTSxoxn */ |
177 | | ROP_PROC(rop142, ((S ^ D) & (T ^ D)) ^ S) /* SSDxTDxax */ |
178 | | ROP_PROC(rop143, ~(~(D & S) & T)) /* TDSanan */ |
179 | | ROP_PROC(rop144, ~(D ^ S) & T) /* TDSxna */ |
180 | | ROP_PROC(rop145, ~(((~S | T) & D) ^ S)) /* SDTSnoaxn */ |
181 | | ROP_PROC(rop146, (((D | T) & S) ^ T) ^ D) /* DTSDToaxx */ |
182 | | ROP_PROC(rop147, ~((T & D) ^ S)) /* STDaxn */ |
183 | | ROP_PROC(rop148, (((T | S) & D) ^ S) ^ T) /* TSDTSoaxx */ |
184 | | ROP_PROC(rop149, ~((T & S) ^ D)) /* DTSaxn */ |
185 | | ROP_PROC(rop150, (T ^ S) ^ D) /* DTSxx */ |
186 | | ROP_PROC(rop151, ((~(T | S) | D) ^ S) ^ T) /* TSDTSonoxx */ |
187 | | ROP_PROC(rop152, ~((~(T | S) | D) ^ S)) /* SDTSonoxn */ |
188 | | ROP_PROC(rop153, ~(D ^ S)) /* DSxn */ |
189 | | ROP_PROC(rop154, (~S & T) ^ D) /* DTSnax */ |
190 | | ROP_PROC(rop155, ~(((T | S) & D) ^ S)) /* SDTSoaxn */ |
191 | | ROP_PROC(rop156, (~D & T) ^ S) /* STDnax */ |
192 | | ROP_PROC(rop157, ~(((T | D) & S) ^ D)) /* DSTDoaxn */ |
193 | | ROP_PROC(rop158, (((D & S) | T) ^ S) ^ D) /* DSTDSaoxx */ |
194 | | ROP_PROC(rop159, ~((D ^ S) & T)) /* TDSxan */ |
195 | | ROP_PROC(rop160, D & T) /* DTa */ |
196 | | ROP_PROC(rop161, ~(((~T & S) | D) ^ T)) /* TDSTnaoxn */ |
197 | | ROP_PROC(rop162, (~S | T) & D) /* DTSnoa */ |
198 | | ROP_PROC(rop163, ~(((D ^ S) | T) ^ D)) /* DTSDxoxn */ |
199 | | ROP_PROC(rop164, ~((~(T | S) | D) ^ T)) /* TDSTonoxn */ |
200 | | ROP_PROC(rop165, ~(D ^ T)) /* TDxn */ |
201 | | ROP_PROC(rop166, (~T & S) ^ D) /* DSTnax */ |
202 | | ROP_PROC(rop167, ~(((T | S) & D) ^ T)) /* TDSToaxn */ |
203 | | ROP_PROC(rop168, ((S | T) & D)) /* DTSoa */ |
204 | | ROP_PROC(rop169, ~((S | T) ^ D)) /* DTSoxn */ |
205 | | ROP_PROC(rop170, D) /* D */ |
206 | | ROP_PROC(rop171, ~(S | T) | D) /* DTSono */ |
207 | | ROP_PROC(rop172, (((S ^ D) & T) ^ S)) /* STDSxax */ |
208 | | ROP_PROC(rop173, ~(((D & S) | T) ^ D)) /* DTSDaoxn */ |
209 | | ROP_PROC(rop174, (~T & S) | D) /* DSTnao */ |
210 | | ROP_PROC(rop175, ~T | D) /* DTno */ |
211 | | ROP_PROC(rop176, (~S | D) & T) /* TDSnoa */ |
212 | | ROP_PROC(rop177, ~(((T ^ S) | D) ^ T)) /* TDSTxoxn */ |
213 | | ROP_PROC(rop178, ((S ^ D) | (S ^ T)) ^ S) /* SSTxDSxox */ |
214 | | ROP_PROC(rop179, ~(~(T & D) & S)) /* SDTanan */ |
215 | | ROP_PROC(rop180, (~D & S) ^ T) /* TSDnax */ |
216 | | ROP_PROC(rop181, ~(((D | S) & T) ^ D)) /* DTSDoaxn */ |
217 | | ROP_PROC(rop182, (((T & D) | S) ^ T) ^ D) /* DTSDTaoxx */ |
218 | | ROP_PROC(rop183, ~((T ^ D) & S)) /* SDTxan */ |
219 | | ROP_PROC(rop184, ((T ^ D) & S) ^ T) /* TSDTxax */ |
220 | | ROP_PROC(rop185, (~((D & T) | S) ^ D)) /* DSTDaoxn */ |
221 | | ROP_PROC(rop186, (~S & T) | D) /* DTSnao */ |
222 | | ROP_PROC(rop187, ~S | D) /* DSno */ |
223 | | ROP_PROC(rop188, (~(S & D) & T) ^ S) /* STDSanax */ |
224 | | ROP_PROC(rop189, ~((D ^ T) & (D ^ S))) /* SDxTDxan */ |
225 | | ROP_PROC(rop190, (S ^ T) | D) /* DTSxo */ |
226 | | ROP_PROC(rop191, ~(S & T) | D) /* DTSano */ |
227 | | ROP_PROC(rop192, T & S) /* TSa */ |
228 | | ROP_PROC(rop193, ~(((~S & D) | T) ^ S)) /* STDSnaoxn */ |
229 | | ROP_PROC(rop194, ~x(o(~o(S, D), T), S)) /* STDSonoxn */ |
230 | | ROP_PROC(rop195, ~(S ^ T)) /* TSxn */ |
231 | | ROP_PROC(rop196, ((~D | T) & S)) /* STDnoa */ |
232 | | ROP_PROC(rop197, ~(((S ^ D) | T) ^ S)) /* STDSxoxn */ |
233 | | ROP_PROC(rop198, ((~T & D) ^ S)) /* SDTnax */ |
234 | | ROP_PROC(rop199, ~(((T | D) & S) ^ T)) /* TSDToaxn */ |
235 | | ROP_PROC(rop200, ((T | D) & S)) /* SDToa */ |
236 | | ROP_PROC(rop201, ~((D | T) ^ S)) /* STDoxn */ |
237 | | ROP_PROC(rop202, ((D ^ S) & T) ^ D) /* DTSDxax */ |
238 | | ROP_PROC(rop203, ~(((S & D) | T) ^ S)) /* STDSaoxn */ |
239 | | ROP_PROC(rop204, S) /* S */ |
240 | | ROP_PROC(rop205, ~(T | D) | S) /* SDTono */ |
241 | | ROP_PROC(rop206, (~T & D) | S) /* SDTnao */ |
242 | | ROP_PROC(rop207, ~T | S) /* STno */ |
243 | | ROP_PROC(rop208, (~D | S) & T) /* TSDnoa */ |
244 | | ROP_PROC(rop209, ~(((T ^ D) | S) ^ T)) /* TSDTxoxn */ |
245 | | ROP_PROC(rop210, (~S & D) ^ T) /* TDSnax */ |
246 | | ROP_PROC(rop211, ~(((S | D) & T) ^ S)) /* STDSoaxn */ |
247 | | ROP_PROC(rop212, x(a(x(D, T), x(T, S)), S)) /* SSTxTDxax */ |
248 | | ROP_PROC(rop213, ~(~(S & T) & D)) /* DTSanan */ |
249 | | ROP_PROC(rop214, ((((S & T) | D) ^ S) ^ T)) /* TSDTS aoxx */ |
250 | | ROP_PROC(rop215, ~((S ^ T) & D)) /* DTS xan */ |
251 | | ROP_PROC(rop216, ((T ^ S) & D) ^ T) /* TDST xax */ |
252 | | ROP_PROC(rop217, ~(((S & T) | D) ^ S)) /* SDTS aoxn */ |
253 | | ROP_PROC(rop218, x(a(~a(D, S), T), D)) /* DTSD anax */ |
254 | | ROP_PROC(rop219, ~a(x(S, D), x(T, S))) /* STxDSxan */ |
255 | | ROP_PROC(rop220, (~D & T) | S) /* STD nao */ |
256 | | ROP_PROC(rop221, ~D | S) /* SDno */ |
257 | | ROP_PROC(rop222, (T ^ D) | S) /* SDT xo */ |
258 | | ROP_PROC(rop223, (~(T & D)) | S) /* SDT ano */ |
259 | | ROP_PROC(rop224, ((S | D) & T)) /* TDS oa */ |
260 | | ROP_PROC(rop225, ~((S | D) ^ T)) /* TDS oxn */ |
261 | | ROP_PROC(rop226, (((D ^ T) & S) ^ D)) /* DSTD xax */ |
262 | | ROP_PROC(rop227, ~(((T & D) | S) ^ T)) /* TSDT aoxn */ |
263 | | ROP_PROC(rop228, ((S ^ T) & D) ^ S) /* SDTSxax */ |
264 | | ROP_PROC(rop229, ~(((T & S) | D) ^ T)) /* TDST aoxn */ |
265 | | ROP_PROC(rop230, (~(S & T) & D) ^ S) /* SDTSanax */ |
266 | | ROP_PROC(rop231, ~a(x(D, T), x(T, S))) /* STxTDxan */ |
267 | | ROP_PROC(rop232, x(a(x(S, D), x(T, S)), S)) /* SS TxD Sxax */ |
268 | | ROP_PROC(rop233, ~x(x(a(~a(S, D), T), S), D)) /* DST DSan axxn */ |
269 | | ROP_PROC(rop234, (S & T) | D) /* DTSao */ |
270 | | ROP_PROC(rop235, ~(S ^ T) | D) /* DTSxno */ |
271 | | ROP_PROC(rop236, (T & D) | S) /* SDTao */ |
272 | | ROP_PROC(rop237, ~(T ^ D) | S) /* SDTxno */ |
273 | | ROP_PROC(rop238, S | D) /* DSo */ |
274 | | ROP_PROC(rop239, (~T | D) | S) /* SDTnoo */ |
275 | | ROP_PROC(rop240, T) /* T */ |
276 | | ROP_PROC(rop241, ~(S | D) | T) /* TDSono */ |
277 | | ROP_PROC(rop242, (~S & D) | T) /* TDSnao */ |
278 | | ROP_PROC(rop243, ~S | T) /* TSno */ |
279 | | ROP_PROC(rop244, (~D & S) | T) /* TSDnao */ |
280 | | ROP_PROC(rop245, ~D | T) /* TDno */ |
281 | | ROP_PROC(rop246, (S ^ D) | T) /* TDSxo */ |
282 | | ROP_PROC(rop247, ~(S & D) | T) /* TDSano */ |
283 | | ROP_PROC(rop248, (S & D) | T) /* TDSao */ |
284 | | ROP_PROC(rop249, ~(S ^ D) | T) /* TDSxno */ |
285 | | ROP_PROC(rop250, D | T) /* DTo */ |
286 | | ROP_PROC(rop251, (~S | T) | D) /* DTSnoo */ |
287 | | ROP_PROC(rop252, S | T) /* TSo */ |
288 | | ROP_PROC(rop253, (~D | S) | T) /* TSDnoo */ |
289 | | ROP_PROC(rop254, S | T | D) /* DTSoo */ |
290 | | ROP_PROC(rop255, ~(rop_operand) 0) /* 1 */ |
291 | | #undef ROP_PROC |
292 | | |
293 | | const rop_proc rop_proc_table[256] = { |
294 | | rop0, rop1, rop2, rop3, rop4, rop5, rop6, rop7, |
295 | | rop8, rop9, rop10, rop11, rop12, rop13, rop14, rop15, |
296 | | rop16, rop17, rop18, rop19, rop20, rop21, rop22, rop23, |
297 | | rop24, rop25, rop26, rop27, rop28, rop29, rop30, rop31, |
298 | | rop32, rop33, rop34, rop35, rop36, rop37, rop38, rop39, |
299 | | rop40, rop41, rop42, rop43, rop44, rop45, rop46, rop47, |
300 | | rop48, rop49, rop50, rop51, rop52, rop53, rop54, rop55, |
301 | | rop56, rop57, rop58, rop59, rop60, rop61, rop62, rop63, |
302 | | rop64, rop65, rop66, rop67, rop68, rop69, rop70, rop71, |
303 | | rop72, rop73, rop74, rop75, rop76, rop77, rop78, rop79, |
304 | | rop80, rop81, rop82, rop83, rop84, rop85, rop86, rop87, |
305 | | rop88, rop89, rop90, rop91, rop92, rop93, rop94, rop95, |
306 | | rop96, rop97, rop98, rop99, rop100, rop101, rop102, rop103, |
307 | | rop104, rop105, rop106, rop107, rop108, rop109, rop110, rop111, |
308 | | rop112, rop113, rop114, rop115, rop116, rop117, rop118, rop119, |
309 | | rop120, rop121, rop122, rop123, rop124, rop125, rop126, rop127, |
310 | | rop128, rop129, rop130, rop131, rop132, rop133, rop134, rop135, |
311 | | rop136, rop137, rop138, rop139, rop140, rop141, rop142, rop143, |
312 | | rop144, rop145, rop146, rop147, rop148, rop149, rop150, rop151, |
313 | | rop152, rop153, rop154, rop155, rop156, rop157, rop158, rop159, |
314 | | rop160, rop161, rop162, rop163, rop164, rop165, rop166, rop167, |
315 | | rop168, rop169, rop170, rop171, rop172, rop173, rop174, rop175, |
316 | | rop176, rop177, rop178, rop179, rop180, rop181, rop182, rop183, |
317 | | rop184, rop185, rop186, rop187, rop188, rop189, rop190, rop191, |
318 | | rop192, rop193, rop194, rop195, rop196, rop197, rop198, rop199, |
319 | | rop200, rop201, rop202, rop203, rop204, rop205, rop206, rop207, |
320 | | rop208, rop209, rop210, rop211, rop212, rop213, rop214, rop215, |
321 | | rop216, rop217, rop218, rop219, rop220, rop221, rop222, rop223, |
322 | | rop224, rop225, rop226, rop227, rop228, rop229, rop230, rop231, |
323 | | rop232, rop233, rop234, rop235, rop236, rop237, rop238, rop239, |
324 | | rop240, rop241, rop242, rop243, rop244, rop245, rop246, rop247, |
325 | | rop248, rop249, rop250, rop251, rop252, rop253, rop254, rop255 |
326 | | }; |
327 | | |
328 | | /* |
329 | | * Here is the program that generated the table below. |
330 | | * |
331 | | int |
332 | | main(int argc, char *argv[]) |
333 | | { uint i; |
334 | | for ( i = 0; i < 256; ++i ) |
335 | | printf("%d,", |
336 | | (rop3_uses_D(i) ? rop_usage_D : 0) | |
337 | | (rop3_uses_S(i) ? rop_usage_S : 0) | |
338 | | (rop3_uses_T(i) ? rop_usage_T : 0)); |
339 | | fflush(stdout); |
340 | | return 0; |
341 | | } |
342 | | */ |
343 | | |
344 | | const byte /*rop_usage_t */ rop_usage_table[256] = |
345 | | { |
346 | | 0, 7, 7, 6, 7, 5, 7, 7, 7, 7, 5, 7, 6, 7, 7, 4, |
347 | | 7, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
348 | | 7, 7, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
349 | | 6, 7, 7, 2, 7, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7, 6, |
350 | | 7, 7, 7, 7, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
351 | | 5, 7, 7, 7, 7, 1, 7, 7, 7, 7, 5, 7, 7, 7, 7, 5, |
352 | | 7, 7, 7, 7, 7, 7, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
353 | | 7, 7, 7, 7, 7, 7, 7, 3, 7, 7, 7, 7, 7, 7, 7, 7, |
354 | | 7, 7, 7, 7, 7, 7, 7, 7, 3, 7, 7, 7, 7, 7, 7, 7, |
355 | | 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, 7, 7, 7, 7, 7, 7, |
356 | | 5, 7, 7, 7, 7, 5, 7, 7, 7, 7, 1, 7, 7, 7, 7, 5, |
357 | | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, 7, 7, 7, 7, |
358 | | 6, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 2, 7, 7, 6, |
359 | | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, 7, 7, |
360 | | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, 7, |
361 | | 4, 7, 7, 6, 7, 5, 7, 7, 7, 7, 5, 7, 6, 7, 7, 0 |
362 | | }; |