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