• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)5 int sext_ltu_p2(int x) { return (sext(x) <  (POS + 2)) == (x >= 0); }
sext_ltu_p1(int x)6 int sext_ltu_p1(int x) { return (sext(x) <  (POS + 1)) == (x >= 0); }
sext_ltu_p0(int x)7 int sext_ltu_p0(int x) { return (sext(x) <  (POS + 0)) == (x >= 0); }
8 
sext_leu_p1(int x)9 int sext_leu_p1(int x) { return (sext(x) <= (POS + 1)) == (x >= 0); }
sext_leu_p0(int x)10 int sext_leu_p0(int x) { return (sext(x) <= (POS + 0)) == (x >= 0); }
11 
sext_geu_m1(int x)12 int sext_geu_m1(int x) { return (sext(x) >= (NEG - 1)) == (x < 0); }
sext_geu_m2(int x)13 int sext_geu_m2(int x) { return (sext(x) >= (NEG - 2)) == (x < 0); }
14 
sext_gtu_m1(int x)15 int sext_gtu_m1(int x) { return (sext(x) > (NEG - 1)) == (x < 0); }
sext_gtu_m2(int x)16 int sext_gtu_m2(int x) { return (sext(x) > (NEG - 2)) == (x < 0); }
sext_gtu_m3(int x)17 int 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