## Mercurial > hg > CbC > GCC_original

### annotate gcc/testsuite/gcc.target/powerpc/vec-cntlzm-1.c @ 19:2b5abeee2509 default tip

Find changesets by keywords (author, files, the commit message), revision
number or hash, or revset expression.

update gcc11

author | anatofuz |
---|---|

date | Mon, 25 May 2020 07:50:57 +0900 |

parents | |

children |

rev | line source |
---|---|

19 | 1 /* { dg-do run } */ |

2 /* { dg-require-effective-target powerpc_future_hw } */ | |

3 /* { dg-options "-mdejagnu-cpu=future" } */ | |

4 | |

5 #include <altivec.h> | |

6 | |

7 extern void abort (void); | |

8 | |

9 vector unsigned long long int | |

10 do_vec_cntlzm (vector unsigned long long int source, | |

11 vector unsigned long long int mask) | |

12 { | |

13 return vec_cntlzm (source, mask); | |

14 } | |

15 | |

16 int main (int argc, char *argv []) | |

17 { | |

18 vector unsigned long long int source_a = { 0xa5f07e3cull, 0x7e3ca5f0ull }; | |

19 vector unsigned long long int source_b = { 0x3ca5f07eull, 0x5a0fe7c3ull }; | |

20 | |

21 vector unsigned long long int mask_a = { 0xffff0000ull, 0x0000ffffull }; | |

22 vector unsigned long long int mask_b = { 0x0f0f0f0full, 0xf0f0f0f0ull }; | |

23 | |

24 /* See cntlzdm-0.c for derivation of expected results. | |

25 | |

26 result_aa [0] is compute (source [0], mask [0]; | |

27 result_aa [1] is compute (source [1], mask [1]. | |

28 | |

29 result_ab [0] is compute (source [0], mask [2]; | |

30 result_ab [1] is compute (source [1], mask [3]. | |

31 | |

32 result_ba [0] is compute (source [2], mask [0]; | |

33 result_ba [1] is compute (source [3], mask [1]. | |

34 | |

35 result_bb [0] is compute (source [2], mask [2]; | |

36 result_bb [1] is compute (source [3], mask [3]. */ | |

37 | |

38 vector unsigned long long int result_aa = { 0, 0 }; | |

39 vector unsigned long long int result_ab = { 1, 1 }; | |

40 vector unsigned long long int result_ba = { 2, 0 }; | |

41 vector unsigned long long int result_bb = { 0, 1 }; | |

42 | |

43 if (!vec_all_eq (do_vec_cntlzm (source_a, mask_a), result_aa)) | |

44 abort (); | |

45 if (!vec_all_eq (do_vec_cntlzm (source_a, mask_b), result_ab)) | |

46 abort (); | |

47 if (!vec_all_eq (do_vec_cntlzm (source_b, mask_a), result_ba)) | |

48 abort (); | |

49 if (!vec_all_eq (do_vec_cntlzm (source_b, mask_b), result_bb)) | |

50 abort (); | |

51 | |

52 return 0; | |

53 } | |

54 |