kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

a.c (470B)


      1 /* ADR_PREL_PG_HI21 + LDST128_ABS_LO12_NC: load a const __uint128_t. */
      2 #include <stdint.h>
      3 typedef unsigned __int128 u128;
      4 static const u128 g =
      5     ((u128)UINT64_C(0x0102030405060708) << 64) | UINT64_C(0x090a0b0c0d0e0f10);
      6 
      7 int test_main(void) {
      8   volatile u128 v = g;
      9   uint64_t hi = (uint64_t)(v >> 64);
     10   uint64_t lo = (uint64_t)(v);
     11   return (hi == UINT64_C(0x0102030405060708) &&
     12           lo == UINT64_C(0x090a0b0c0d0e0f10))
     13              ? 0
     14              : 1;
     15 }