Nanashi-soft○プログラマ専用○Windows gcc SDL○
#include "stdio.h" #include "spu_mfcio.h" //アドレスリスト受け取り用 unsigned long addrlist[2] __attribute__((aligned(16))); //データ受け取り用(このサイズを色々変えて計測する) unsigned char data1[16] __attribute__((aligned(16))); int main(unsigned long long spe, unsigned long long argp, unsigned long long envp){ //まずは、アドレスリストを取得 mfc_list_element_t element[1]; element[0].notify = 0; element[0].reserved = 0; element[0].size = sizeof(addrlist); element[0].eal = mfc_ea2h(argp); int tag=1; spu_mfcdma64(&addrlist,mfc_ea2l(argp),(unsigned int)(element), sizeof(element), tag,MFC_GETL_CMD); spu_writech(MFC_WrTagMask, 1 << tag); spu_mfcstat(MFC_TAG_UPDATE_ALL); //データ取得1 int i; for(i=0; i < 1920*1080*4; i += sizeof(data1)){ element[0].notify = 0; element[0].reserved = 0; element[0].size = sizeof(data1); element[0].eal = mfc_ea2l(addrlist[0] + i); spu_mfcdma64(&data1,mfc_ea2h(addrlist[0]),(unsigned int)(element), sizeof(element), tag,MFC_GETL_CMD); spu_writech(MFC_WrTagMask, 1 << tag); spu_mfcstat(MFC_TAG_UPDATE_ALL); } return 0; }
spu-gcc -o spetest spetest.c