File: bool2.h

package info (click to toggle)
gcc-arm-none-eabi 15%3A8-2019-q3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 571,828 kB
  • sloc: ansic: 2,937,651; cpp: 881,644; ada: 597,189; makefile: 65,528; asm: 56,499; xml: 46,621; exp: 24,747; sh: 19,684; python: 7,256; pascal: 4,370; awk: 3,497; perl: 2,695; yacc: 316; ml: 285; f90: 234; lex: 198; objc: 194; haskell: 119
file content (29 lines) | stat: -rw-r--r-- 1,553 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Test various logical operations.  */

TYPE arg1 (TYPE p, TYPE q) { return p & q; }		/* AND  */
TYPE arg2 (TYPE p, TYPE q) { return p | q; }		/* OR   */
TYPE arg3 (TYPE p, TYPE q) { return p ^ q; }		/* XOR  */
TYPE arg4 (TYPE p)	   { return ~ p; }		/* NOR  */
TYPE arg5 (TYPE p, TYPE q) { return ~(p & q); }		/* NAND */
TYPE arg6 (TYPE p, TYPE q) { return ~(p | q); }		/* NOR  */
TYPE arg7 (TYPE p, TYPE q) { return ~(p ^ q); }		/* EQV  */
TYPE arg8 (TYPE p, TYPE q) { return (~p) & q; }		/* ANDC */
TYPE arg9 (TYPE p, TYPE q) { return (~p) | q; }		/* ORC  */
TYPE arg10(TYPE p, TYPE q) { return (~p) ^ q; }		/* EQV  */
TYPE arg11(TYPE p, TYPE q) { return p & (~q); }		/* ANDC */
TYPE arg12(TYPE p, TYPE q) { return p | (~q); }		/* ORC  */
TYPE arg13(TYPE p, TYPE q) { return p ^ (~q); }		/* EQV  */

void ptr1 (TYPE *p) { p[0] = p[1] & p[2]; }		/* AND  */
void ptr2 (TYPE *p) { p[0] = p[1] | p[2]; }		/* OR   */
void ptr3 (TYPE *p) { p[0] = p[1] ^ p[2]; }		/* XOR  */
void ptr4 (TYPE *p) { p[0] = ~p[1]; }			/* NOR  */
void ptr5 (TYPE *p) { p[0] = ~(p[1] & p[2]); }		/* NAND */
void ptr6 (TYPE *p) { p[0] = ~(p[1] | p[2]); }		/* NOR  */
void ptr7 (TYPE *p) { p[0] = ~(p[1] ^ p[2]); }		/* EQV  */
void ptr8 (TYPE *p) { p[0] = ~(p[1]) & p[2]; }		/* ANDC */
void ptr9 (TYPE *p) { p[0] = (~p[1]) | p[2]; }		/* ORC  */
void ptr10(TYPE *p) { p[0] = (~p[1]) ^ p[2]; }		/* EQV  */
void ptr11(TYPE *p) { p[0] = p[1] & (~p[2]); }		/* ANDC */
void ptr12(TYPE *p) { p[0] = p[1] | (~p[2]); }		/* ORC  */
void ptr13(TYPE *p) { p[0] = p[1] ^ (~p[2]); }		/* EQV  */