1 #define sext(X) ((unsigned long long) (X)) 2 #define POS (1ULL << 31) 3 #define NEG ((unsigned long long) -POS) 4 sext_ltu_p2(int x)5int sext_ltu_p2(int x) { return (sext(x) < (POS + 2)) == (x >= 0); } sext_ltu_p1(int x)6int sext_ltu_p1(int x) { return (sext(x) < (POS + 1)) == (x >= 0); } sext_ltu_p0(int x)7int sext_ltu_p0(int x) { return (sext(x) < (POS + 0)) == (x >= 0); } 8 sext_leu_p1(int x)9int sext_leu_p1(int x) { return (sext(x) <= (POS + 1)) == (x >= 0); } sext_leu_p0(int x)10int sext_leu_p0(int x) { return (sext(x) <= (POS + 0)) == (x >= 0); } 11 sext_geu_m1(int x)12int sext_geu_m1(int x) { return (sext(x) >= (NEG - 1)) == (x < 0); } sext_geu_m2(int x)13int sext_geu_m2(int x) { return (sext(x) >= (NEG - 2)) == (x < 0); } 14 sext_gtu_m1(int x)15int sext_gtu_m1(int x) { return (sext(x) > (NEG - 1)) == (x < 0); } sext_gtu_m2(int x)16int sext_gtu_m2(int x) { return (sext(x) > (NEG - 2)) == (x < 0); } sext_gtu_m3(int x)17int sext_gtu_m3(int x) { return (sext(x) > (NEG - 3)) == (x < 0); } 18 19 /* 20 * check-name: cmp-sext-uimm 21 * check-command: test-linearize -Wno-decl $file 22 * 23 * check-output-ignore 24 * check-output-returns: 1 25 */ 26