1 /* Copyright (C) 2007 IBM
3 Author: Pete Eberlein eberlein@us.ibm.com
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <http://www.gnu.org/licenses/>.
18 The GNU General Public License is contained in the file COPYING.
26 #define CMPB(result,a,b) \
27 asm ("cmpb %0, %1, %2\n" : "=r"(result) : "r"(a), "r"(b))
30 int main(int argc
, char *argv
[])
34 for (i
= 1; i
< 256; i
++) {
47 mask
+= 0xff0000000000;
49 mask
+= 0xff000000000000;
51 mask
+= 0xff00000000000000;
53 for (j
= 0; j
< 256; j
++)
54 for (k
= 0; k
< 256; k
++)
57 unsigned long a
, b
, result
;
58 a
= (mask
& (j
* 0x101010101010101)) +
59 ((~mask
) & (k
* 0x101010101010101));
60 b
= j
* 0x101010101010101;
63 printf("%8lx %8lx %8lx %8lx\n", mask
, a
, b
, result
);