ibit_long_logic_imm.c (487B)
1 /* 64-bit bitwise ops with an immediate operand on `long`. Exercises the 64-bit 2 * logical-immediate (bitmask) encoding of and/orr/eor on x-registers. volatile 3 * on the variable side keeps the op live. 4 * a = 0x3C; a & 0xF0 = 0x30 (48); a | 0x03 = 0x3F (63) 5 * a ^ 0xFF = 0xC3 (195); (48 + 63 + 195) - 264 = 42. */ 6 int test_main(void) { 7 volatile long a = 0x3C; 8 long and_ = a & 0xF0; 9 long or_ = a | 0x03; 10 long xor_ = a ^ 0xFF; 11 return (int)((and_ + or_ + xor_) - 264); 12 }