diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-03-16 19:47:03 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-03-16 19:47:03 +0100 |
commit | 7ab24b18b1c9a08b0d092c2c8144ee7b3a029c1d (patch) | |
tree | 626ffb1662cdb76fcf2979291c7adda9bacbe63f /test/monniaux/nand/nand.c | |
parent | 2227019e15866870f87488630f17cbb0797d1786 (diff) | |
download | compcert-kvx-7ab24b18b1c9a08b0d092c2c8144ee7b3a029c1d.tar.gz compcert-kvx-7ab24b18b1c9a08b0d092c2c8144ee7b3a029c1d.zip |
long nand, nor, nxor
Diffstat (limited to 'test/monniaux/nand/nand.c')
-rw-r--r-- | test/monniaux/nand/nand.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/monniaux/nand/nand.c b/test/monniaux/nand/nand.c index f808f311..9c2d2298 100644 --- a/test/monniaux/nand/nand.c +++ b/test/monniaux/nand/nand.c @@ -1,22 +1,24 @@ #include <stdio.h> -unsigned not(unsigned x) { +typedef unsigned long scalar; + +scalar not(scalar x) { return ~x; } -unsigned nand(unsigned x, unsigned y) { +scalar nand(scalar x, scalar y) { return ~(x & y); } -unsigned nor(unsigned x, unsigned y) { +scalar nor(scalar x, scalar y) { return ~(x | y); } -unsigned nxor(unsigned x, unsigned y) { +scalar nxor(scalar x, scalar y) { return ~(x ^ y); } int main() { - unsigned x = 0xF4, y = 0x33; + scalar x = 0xF4, y = 0x33; printf("%X\n", nxor(x, y)); } |