• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #define sext(X)	((long long) (X))
2 #define POS	(1LL << 31)
3 #define NEG	(-POS - 1)
4 
lt_ge0(int x)5 static int lt_ge0(int x) { return (sext(x) <  (POS + 0)) == 1; }
lt_ge1(int x)6 static int lt_ge1(int x) { return (sext(x) <  (POS + 1)) == 1; }
lt_ge2(int x)7 static int lt_ge2(int x) { return (sext(x) <  (POS + 2)) == 1; }
lt_gex(int x)8 static int lt_gex(int x) { return (sext(x) <  (POS<< 1)) == 1; }
lt_gey(int x)9 static int lt_gey(int x) { return (sext(x) <  (POS<< 3)) == 1; }
le_ge0(int x)10 static int le_ge0(int x) { return (sext(x) <= (POS + 0)) == 1; }
le_ge1(int x)11 static int le_ge1(int x) { return (sext(x) <= (POS + 1)) == 1; }
le_ge2(int x)12 static int le_ge2(int x) { return (sext(x) <= (POS + 2)) == 1; }
le_gex(int x)13 static int le_gex(int x) { return (sext(x) <= (POS<< 1)) == 1; }
le_gey(int x)14 static int le_gey(int x) { return (sext(x) <= (POS<< 3)) == 1; }
ge_ge0(int x)15 static int ge_ge0(int x) { return (sext(x) >= (POS + 0)) == 0; }
ge_ge1(int x)16 static int ge_ge1(int x) { return (sext(x) >= (POS + 1)) == 0; }
ge_ge2(int x)17 static int ge_ge2(int x) { return (sext(x) >= (POS + 2)) == 0; }
ge_gex(int x)18 static int ge_gex(int x) { return (sext(x) >= (POS<< 1)) == 0; }
ge_gey(int x)19 static int ge_gey(int x) { return (sext(x) >= (POS<< 3)) == 0; }
gt_ge0(int x)20 static int gt_ge0(int x) { return (sext(x) >  (POS + 0)) == 0; }
gt_ge1(int x)21 static int gt_ge1(int x) { return (sext(x) >  (POS + 1)) == 0; }
gt_ge2(int x)22 static int gt_ge2(int x) { return (sext(x) >  (POS + 2)) == 0; }
gt_gex(int x)23 static int gt_gex(int x) { return (sext(x) >  (POS<< 1)) == 0; }
gt_gey(int x)24 static int gt_gey(int x) { return (sext(x) >  (POS<< 3)) == 0; }
25 
lt_lt0(int x)26 static int lt_lt0(int x) { return (sext(x) <  (NEG - 0)) == 0; }
lt_lt1(int x)27 static int lt_lt1(int x) { return (sext(x) <  (NEG - 1)) == 0; }
lt_lt2(int x)28 static int lt_lt2(int x) { return (sext(x) <  (NEG - 2)) == 0; }
lt_ltx(int x)29 static int lt_ltx(int x) { return (sext(x) <  (NEG<< 1)) == 0; }
lt_lty(int x)30 static int lt_lty(int x) { return (sext(x) <  (NEG<< 3)) == 0; }
le_lt0(int x)31 static int le_lt0(int x) { return (sext(x) <= (NEG - 0)) == 0; }
le_lt1(int x)32 static int le_lt1(int x) { return (sext(x) <= (NEG - 1)) == 0; }
le_lt2(int x)33 static int le_lt2(int x) { return (sext(x) <= (NEG - 2)) == 0; }
le_ltx(int x)34 static int le_ltx(int x) { return (sext(x) <= (NEG<< 1)) == 0; }
le_lty(int x)35 static int le_lty(int x) { return (sext(x) <= (NEG<< 3)) == 0; }
ge_lt0(int x)36 static int ge_lt0(int x) { return (sext(x) >= (NEG - 0)) == 1; }
ge_lt1(int x)37 static int ge_lt1(int x) { return (sext(x) >= (NEG - 1)) == 1; }
ge_lt2(int x)38 static int ge_lt2(int x) { return (sext(x) >= (NEG - 2)) == 1; }
ge_ltx(int x)39 static int ge_ltx(int x) { return (sext(x) >= (NEG<< 1)) == 1; }
ge_lty(int x)40 static int ge_lty(int x) { return (sext(x) >= (NEG<< 3)) == 1; }
gt_lt0(int x)41 static int gt_lt0(int x) { return (sext(x) >  (NEG - 0)) == 1; }
gt_lt1(int x)42 static int gt_lt1(int x) { return (sext(x) >  (NEG - 1)) == 1; }
gt_lt2(int x)43 static int gt_lt2(int x) { return (sext(x) >  (NEG - 2)) == 1; }
gt_ltx(int x)44 static int gt_ltx(int x) { return (sext(x) >  (NEG<< 1)) == 1; }
gt_lty(int x)45 static int gt_lty(int x) { return (sext(x) >  (NEG<< 3)) == 1; }
46 
47 /*
48  * check-name: cmp-sext-simm
49  * check-command: test-linearize -Wno-decl $file
50  *
51  * check-output-ignore
52  * check-output-returns: 1
53  */
54