⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ppc-spe.c

📁 用于进行gcc测试
💻 C
📖 第 1 页 / 共 2 页
字号:
/* { dg-do compile { target powerpc-*-eabispe } } *//* { dg-options "-mcpu=8540 -mabi=spe -O0" } *//* (Test with -O0 so we don't optimize any of them away).  */#include <spe.h>/* Test PowerPC SPE extensions.  */#define vector __attribute__((vector_size(8)))vector int a, b, c, *ap;vector float f, g, h;unsigned int *uip;unsigned short *usp;int i, j, *ip;uint64_t ull;int64_t sll;unsigned ui;float fl;uint16_t u16;int16_t s16;/* These are the only documented/supported accesor functions for the   SPE builtins.  */voidtest_api (){  c = __ev_addw (a, b);  c = __ev_addiw (a, 8);  c = __ev_subfw (a, b);  c = __ev_subifw (8, a);  c = __ev_abs (a);  c = __ev_neg (a);  c = __ev_extsb (a);  c = __ev_extsh (a);  c = __ev_and (a, b);  c = __ev_or (a, b);  c = __ev_xor (a, b);  c = __ev_nand (a, b);  c = __ev_nor (a, b);  c = __ev_eqv (a, b);  c = __ev_andc (a, b);  c = __ev_orc (a, b);  c = __ev_rlw (a, b);  c = __ev_rlwi (a, 8);  c = __ev_slw (a, b);  c = __ev_slwi (a, 8);  c = __ev_srws (a, b);  c = __ev_srwu (a, b);  c = __ev_srwis (a, 8);  c = __ev_srwiu (a, 8);  c = __ev_cntlzw (a);  c = __ev_cntlsw (a);  c = __ev_rndw (a);  c = __ev_mergehi (a, b);  c = __ev_mergelo (a, b);  c = __ev_mergelohi (a, b);  c = __ev_mergehilo (a, b);  c = __ev_splati (5);  c = __ev_splatfi (6);  c = __ev_divws (a, b);  c = __ev_divwu (a, b);  c = __ev_mra (a);  i = __brinc (5, 6);  /* Loads.  */  c = __ev_lddx (ap, i);  c = __ev_ldwx (ap, i);  c = __ev_ldhx (ap, i);  c = __ev_lwhex (uip, i);  c = __ev_lwhoux (uip, i);  c = __ev_lwhosx (uip, i);  c = __ev_lwwsplatx (uip, i);  c = __ev_lwhsplatx (uip, i);  c = __ev_lhhesplatx (usp, i);  c = __ev_lhhousplatx (usp, i);  c = __ev_lhhossplatx (usp, i);  c = __ev_ldd (ap, 5);  c = __ev_ldw (ap, 6);  c = __ev_ldh (ap, 7);  c = __ev_lwhe (uip, 6);  c = __ev_lwhou (uip, 6);  c = __ev_lwhos (uip, 7);  c = __ev_lwwsplat (uip, 7);  c = __ev_lwhsplat (uip, 7);  c = __ev_lhhesplat (usp, 7);  c = __ev_lhhousplat (usp, 7);  c = __ev_lhhossplat (usp, 7);  /* Stores.  */  __ev_stddx (a, ap, 9);  __ev_stdwx (a, ap, 9);  __ev_stdhx (a, ap, 9);  __ev_stwwex (a, uip, 9);  __ev_stwwox (a, uip, 9);  __ev_stwhex (a, uip, 9);  __ev_stwhox (a, uip, 9);  __ev_stdd (a, ap, 9);  __ev_stdw (a, ap, 9);  __ev_stdh (a, ap, 9);  __ev_stwwe (a, uip, 9);  __ev_stwwo (a, uip, 9);  __ev_stwhe (a, uip, 9);  __ev_stwho (a, uip, 9);  /* Fixed point complex.  */  c = __ev_mhossf (a, b);  c = __ev_mhosmf (a, b);  c = __ev_mhosmi (a, b);  c = __ev_mhoumi (a, b);  c = __ev_mhessf (a, b);  c = __ev_mhesmf (a, b);  c = __ev_mhesmi (a, b);  c = __ev_mheumi (a, b);  c = __ev_mhossfa (a, b);  c = __ev_mhosmfa (a, b);  c = __ev_mhosmia (a, b);  c = __ev_mhoumia (a, b);  c = __ev_mhessfa (a, b);  c = __ev_mhesmfa (a, b);  c = __ev_mhesmia (a, b);  c = __ev_mheumia (a, b);  c = __ev_mhoumf (a, b);  c = __ev_mheumf (a, b);  c = __ev_mhoumfa (a, b);  c = __ev_mheumfa (a, b);  c = __ev_mhossfaaw (a, b);  c = __ev_mhossiaaw (a, b);  c = __ev_mhosmfaaw (a, b);  c = __ev_mhosmiaaw (a, b);  c = __ev_mhousiaaw (a, b);  c = __ev_mhoumiaaw (a, b);  c = __ev_mhessfaaw (a, b);  c = __ev_mhessiaaw (a, b);  c = __ev_mhesmfaaw (a, b);  c = __ev_mhesmiaaw (a, b);  c = __ev_mheusiaaw (a, b);  c = __ev_mheumiaaw (a, b);  c = __ev_mhousfaaw (a, b);  c = __ev_mhoumfaaw (a, b);  c = __ev_mheusfaaw (a, b);  c = __ev_mheumfaaw (a, b);  c = __ev_mhossfanw (a, b);  c = __ev_mhossianw (a, b);  c = __ev_mhosmfanw (a, b);  c = __ev_mhosmianw (a, b);  c = __ev_mhousianw (a, b);  c = __ev_mhoumianw (a, b);  c = __ev_mhessfanw (a, b);  c = __ev_mhessianw (a, b);  c = __ev_mhesmfanw (a, b);  c = __ev_mhesmianw (a, b);  c = __ev_mheusianw (a, b);  c = __ev_mheumianw (a, b);  c = __ev_mhousfanw (a, b);  c = __ev_mhoumfanw (a, b);  c = __ev_mheusfanw (a, b);  c = __ev_mheumfanw (a, b);  c = __ev_mhogsmfaa (a, b);  c = __ev_mhogsmiaa (a, b);  c = __ev_mhogumiaa (a, b);  c = __ev_mhegsmfaa (a, b);  c = __ev_mhegsmiaa (a, b);  c = __ev_mhegumiaa (a, b);  c = __ev_mhogumfaa (a, b);  c = __ev_mhegumfaa (a, b);  c = __ev_mhogsmfan (a, b);  c = __ev_mhogsmian (a, b);  c = __ev_mhogumian (a, b);  c = __ev_mhegsmfan (a, b);  c = __ev_mhegsmian (a, b);  c = __ev_mhegumian (a, b);  c = __ev_mhogumfan (a, b);  c = __ev_mhegumfan (a, b);  c = __ev_mwhssf (a, b);  c = __ev_mwhsmf (a, b);  c = __ev_mwhsmi (a, b);  c = __ev_mwhumi (a, b);  c = __ev_mwhssfa (a, b);  c = __ev_mwhsmfa (a, b);  c = __ev_mwhsmia (a, b);  c = __ev_mwhumia (a, b);  c = __ev_mwhumf (a, b);  c = __ev_mwhumfa (a, b);  c = __ev_mwlumi (a, b);  c = __ev_mwlumia (a, b);  c = __ev_mwlumiaaw (a, b);  c = __ev_mwlssiaaw (a, b);  c = __ev_mwlsmiaaw (a, b);  c = __ev_mwlusiaaw (a, b);  c = __ev_mwlusiaaw (a, b);  c = __ev_mwlssianw (a, b);  c = __ev_mwlsmianw (a, b);  c = __ev_mwlusianw (a, b);  c = __ev_mwlumianw (a, b);  c = __ev_mwssf (a, b);  c = __ev_mwsmf (a, b);  c = __ev_mwsmi (a, b);  c = __ev_mwumi (a, b);  c = __ev_mwssfa (a, b);  c = __ev_mwsmfa (a, b);  c = __ev_mwsmia (a, b);  c = __ev_mwumia (a, b);  c = __ev_mwumf (a, b);  c = __ev_mwumfa (a, b);  c = __ev_mwssfaa (a, b);  c = __ev_mwsmfaa (a, b);  c = __ev_mwsmiaa (a, b);  c = __ev_mwumiaa (a, b);  c = __ev_mwumfaa (a, b);  c = __ev_mwssfan (a, b);  c = __ev_mwsmfan (a, b);  c = __ev_mwsmian (a, b);  c = __ev_mwumian (a, b);  c = __ev_mwumfan (a, b);  c = __ev_addssiaaw (a);  c = __ev_addsmiaaw (a);  c = __ev_addusiaaw (a);  c = __ev_addumiaaw (a);  c = __ev_addusfaaw (a);  c = __ev_addumfaaw (a);  c = __ev_addsmfaaw (a);  c = __ev_addssfaaw (a);  c = __ev_subfssiaaw (a);  c = __ev_subfsmiaaw (a);  c = __ev_subfusiaaw (a);  c = __ev_subfumiaaw (a);  c = __ev_subfusfaaw (a);  c = __ev_subfumfaaw (a);  c = __ev_subfsmfaaw (a);  c = __ev_subfssfaaw (a);  /* Floating point SIMD instructions.  */  c = __ev_fsabs (a);  c = __ev_fsnabs (a);  c = __ev_fsneg (a);  c = __ev_fsadd (a, b);  c = __ev_fssub (a, b);  c = __ev_fsmul (a, b);  c = __ev_fsdiv (a, b);  c = __ev_fscfui (a);  c = __ev_fscfsi (a);  c = __ev_fscfuf (a);  c = __ev_fscfsf (a);  c = __ev_fsctui (a);  c = __ev_fsctsi (a);  c = __ev_fsctuf (a);  c = __ev_fsctsf (a);  c = __ev_fsctuiz (a);  c = __ev_fsctsiz (a);  /* Non supported sythetic instructions made from two instructions.  */  c = __ev_mwhssfaaw (a, b);  c = __ev_mwhssiaaw (a, b);  c = __ev_mwhsmfaaw (a, b);  c = __ev_mwhsmiaaw (a, b);  c = __ev_mwhusiaaw (a, b);  c = __ev_mwhumiaaw (a, b);  c = __ev_mwhusfaaw (a, b);  c = __ev_mwhumfaaw (a, b);  c = __ev_mwhssfanw (a, b);  c = __ev_mwhssianw (a, b);  c = __ev_mwhsmfanw (a, b);  c = __ev_mwhsmianw (a, b);  c = __ev_mwhusianw (a, b);  c = __ev_mwhumianw (a, b);  c = __ev_mwhusfanw (a, b);  c = __ev_mwhumfanw (a, b);  c = __ev_mwhgssfaa (a, b);  c = __ev_mwhgsmfaa (a, b);  c = __ev_mwhgsmiaa (a, b);  c = __ev_mwhgumiaa (a, b);  c = __ev_mwhgssfan (a, b);  c = __ev_mwhgsmfan (a, b);  c = __ev_mwhgsmian (a, b);  c = __ev_mwhgumian (a, b);  /* Creating, insertion, and extraction.  */  a = __ev_create_u64 ((uint64_t) 55);  a = __ev_create_s64 ((int64_t) 66);  a = __ev_create_fs (3.14F, 2.18F);  a = __ev_create_u32 ((uint32_t) 5, (uint32_t) i);  a = __ev_create_s32 ((int32_t) 5, (int32_t) 6);  a = __ev_create_u16 ((uint16_t) 6, (uint16_t) 6, (uint16_t) 7, (uint16_t) 1);  a = __ev_create_s16 ((int16_t) 6, (int16_t) 6, (int16_t) 7, (int16_t) 9);  a = __ev_create_sfix32_fs (3.0F, 2.0F);  a = __ev_create_ufix32_fs (3.0F, 2.0F);  a = __ev_create_ufix32_u32 (3U, 5U);  a = __ev_create_sfix32_s32 (6, 9);  ull = __ev_convert_u64 (a);  sll = __ev_convert_s64 (a);  i = __ev_get_upper_u32 (a);  ui = __ev_get_lower_u32 (a);  i = __ev_get_upper_s32 (a);  i = __ev_get_lower_s32 (a);  fl = __ev_get_upper_fs (a);  fl = __ev_get_lower_fs (a);  u16 = __ev_get_u16 (a, 5U);  s16 = __ev_get_s16 (a, 5U);  ui = __ev_get_upper_ufix32_u32 (a);  ui = __ev_get_lower_ufix32_u32 (a);  i = __ev_get_upper_sfix32_s32 (a);  i = __ev_get_lower_sfix32_s32 (a);  fl = __ev_get_upper_sfix32_fs (a);  fl = __ev_get_lower_sfix32_fs (a);  fl = __ev_get_upper_ufix32_fs (a);  fl = __ev_get_lower_ufix32_fs (a);  a = __ev_set_upper_u32 (a, 5U);  a = __ev_set_lower_u32 (a, 5U);  a = __ev_set_upper_s32 (a, 5U);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -