On Wed, 24 Sep 2025, Avinash Jayakar wrote:
> On Mon, 2025-09-22 at 13:27 +0200, Richard Biener wrote:
> >
> > /* { dg-additional-options "-mcpu=power8" { target ppc64*-*-* } } */
> >
> > > +/* { dg-require-effective-target vect_int} */
> > > +/* { dg-require-effective-target vect_condition} */
> > > +/* { dg-require-effective-target vect_shift} */
> > > +
> > > +#define TEST_FN(OP, CONST, NAME) void __GIMPLE
> > > (ssa,guessed_local(10737416)) \
> > > +NAME (int * a) \
> > > +{ \
> > > + int i; \
> > > + long unsigned int _1; \
> > > + long unsigned int _2; \
> > > + int * _3; \
> > > + int _4; \
> > > + int _5; \
> > > + unsigned int _12; \
> > > + unsigned int _13; \
> > > + \
> > > + __BB(2,guessed_local(10737416)): \
> > > + goto __BB3(precise(134217728)); \
> > > + \
> > > + __BB(3,loop_header(1),guessed_local(1063004408)): \
> > > + i_14 = __PHI (__BB5: i_11, __BB2: 0); \
> > > + _13 = __PHI (__BB5: _12, __BB2: 512u); \
> > > + _1 = (long unsigned int) i_14; \
> > > + _2 = _1 * 4ul; \
> > > + _3 = a_9(D) + _2; \
> > > + _4 = __MEM <int> (_3); \
> > > + _5 = _4 OP CONST; \
> > > + __MEM <int> (_3) = _5; \
> > > + i_11 = i_14 + 2; \
> > > + _12 = _13 - 1u; \
> > > + if (_12 != 0u) \
> > > + goto __BB5(guessed(132861994)); \
> > > + else \
> > > + goto __BB4(guessed(1355734)); \
> > > + \
> > > + __BB(5,guessed_local(1052266995)): \
> > > + goto __BB3(precise(134217728)); \
> > > + \
> > > + __BB(4,guessed_local(10737416)): \
> > > + return; \
> > > +} \
> > > +
> > > +TEST_FN(%, 2, trunc_mod_2)
> > > +TEST_FN(__FLOOR_MOD, 2, floor_mod_2)
> > > +TEST_FN(__FLOOR_DIV, 2, floor_div_2)
> > > +
> > > +TEST_FN(%, 4, trunc_mod_pow2)
> > > +TEST_FN(__FLOOR_MOD, 4, floor_mod_pow2)
> > > +TEST_FN(__FLOOR_DIV, 4, floor_div_pow2)
> > > +
> > > +TEST_FN(%, 5, trunc_mod)
> > > +TEST_FN(__FLOOR_MOD, 5, floor_mod)
> > > +TEST_FN(__FLOOR_DIV, 5, floor_div)
> >
> > Can you make this a runtime testcase as well? You can add a plain C
> > main() exercising the GIMPLE FN above.
> >
>
> Thanks for the review comments!
> Would it be ok to update the same test case by just adding a main
> function? Or create a new test file with same functions but calling
> main?
Just adding a main function is OK.
> Best regards,
> Avinash Jayakar
>
> >
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)