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, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 The GNU General Public License is contained in the file COPYING.
28 #define CMPB(result,a,b) \
29 asm ("cmpb %0, %1, %2\n" : "=r"(result) : "r"(a), "r"(b))
32 int main(int argc, char *argv[])
36 for (i = 1; i < 256; i++) {
49 mask += 0xff0000000000;
51 mask += 0xff000000000000;
53 mask += 0xff00000000000000;
55 for (j = 0; j < 256; j++)
56 for (k = 0; k < 256; k++)
59 unsigned long a, b, result;
60 a = (mask & (j * 0x101010101010101)) +
61 ((~mask) & (k * 0x101010101010101));
62 b = j * 0x101010101010101;
65 printf("%8lx %8lx %8lx %8lx\n", mask, a, b, result);