1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
// Copyright Naoki Shibata 2010 - 2017.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "funcproto.h"
int main(int argc, char **argv) {
if (argc < 7) {
fprintf(stderr, "Usage : %s <DP width> <SP width> <vdouble type> <vfloat type> <vint type> <isa0> [<isa1> ...]\n", argv[0]);
fprintf(stderr, "\n");
exit(-1);
}
const int wdp = atoi(argv[1]), wsp = atoi(argv[2]);
const char *vdoublename = argv[3], *vfloatname = argv[4], *vintname = argv[5];
const int isastart = 6, nisa = argc - isastart;
for(int i=0;funcList[i].name != NULL;i++) {
char ulpSuffix0[100] = "", ulpSuffix1[100] = "_";
if (funcList[i].ulp >= 0) {
sprintf(ulpSuffix0, "_u%02d", funcList[i].ulp);
sprintf(ulpSuffix1, "_u%02d", funcList[i].ulp);
}
switch(funcList[i].funcType) {
case 0:
printf("DISPATCH_vf_vf(%s, Sleef_%sd%d%s, pnt_%sd%d%s, disp_%sd%d%s",
vdoublename,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d%s%s", funcList[i].name, wdp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
printf("DISPATCH_vf_vf(%s, Sleef_%sf%d%s, pnt_%sf%d%s, disp_%sf%d%s",
vfloatname,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sf%d%s%s", funcList[i].name, wsp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
break;
case 1:
printf("DISPATCH_vf_vf_vf(%s, Sleef_%sd%d%s, pnt_%sd%d%s, disp_%sd%d%s",
vdoublename,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d%s%s", funcList[i].name, wdp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
printf("DISPATCH_vf_vf_vf(%s, Sleef_%sf%d%s, pnt_%sf%d%s, disp_%sf%d%s",
vfloatname,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sf%d%s%s", funcList[i].name, wsp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
break;
case 2:
case 6:
printf("DISPATCH_vf2_vf(%s, Sleef_%s_2, Sleef_%sd%d%s, pnt_%sd%d%s, disp_%sd%d%s",
vdoublename, vdoublename,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d%s%s", funcList[i].name, wdp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
printf("DISPATCH_vf2_vf(%s, Sleef_%s_2, Sleef_%sf%d%s, pnt_%sf%d%s, disp_%sf%d%s",
vfloatname, vfloatname,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sf%d%s%s", funcList[i].name, wsp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
break;
case 3:
printf("DISPATCH_vf_vf_vi(%s, %s, Sleef_%sd%d%s, pnt_%sd%d%s, disp_%sd%d%s",
vdoublename, vintname,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d%s%s", funcList[i].name, wdp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
break;
case 4:
printf("DISPATCH_vi_vf(%s, %s, Sleef_%sd%d%s, pnt_%sd%d%s, disp_%sd%d%s",
vdoublename, vintname,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d%s%s", funcList[i].name, wdp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
break;
case 5:
printf("DISPATCH_vf_vf_vf_vf(%s, Sleef_%sd%d%s, pnt_%sd%d%s, disp_%sd%d%s",
vdoublename,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0,
funcList[i].name, wdp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d%s%s", funcList[i].name, wdp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
printf("DISPATCH_vf_vf_vf_vf(%s, Sleef_%sf%d%s, pnt_%sf%d%s, disp_%sf%d%s",
vfloatname,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0,
funcList[i].name, wsp, ulpSuffix0);
for(int j=0;j<nisa;j++) printf(", Sleef_%sf%d%s%s", funcList[i].name, wsp, ulpSuffix1, argv[isastart + j]);
printf(")\n");
break;
case 7:
printf("DISPATCH_i_i(Sleef_%sf%d, pnt_%sf%d, disp_%sf%d",
funcList[i].name, wsp,
funcList[i].name, wsp,
funcList[i].name, wsp);
for(int j=0;j<nisa;j++) printf(", Sleef_%sf%d_%s", funcList[i].name, wsp, argv[isastart + j]);
printf(")\n");
printf("DISPATCH_i_i(Sleef_%sd%d, pnt_%sd%d, disp_%sd%d",
funcList[i].name, wdp,
funcList[i].name, wdp,
funcList[i].name, wdp);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d_%s", funcList[i].name, wdp, argv[isastart + j]);
printf(")\n");
break;
case 8:
printf("DISPATCH_p_i(Sleef_%sf%d, pnt_%sf%d, disp_%sf%d",
funcList[i].name, wsp,
funcList[i].name, wsp,
funcList[i].name, wsp);
for(int j=0;j<nisa;j++) printf(", Sleef_%sf%d_%s", funcList[i].name, wsp, argv[isastart + j]);
printf(")\n");
printf("DISPATCH_p_i(Sleef_%sd%d, pnt_%sd%d, disp_%sd%d",
funcList[i].name, wdp,
funcList[i].name, wdp,
funcList[i].name, wdp);
for(int j=0;j<nisa;j++) printf(", Sleef_%sd%d_%s", funcList[i].name, wdp, argv[isastart + j]);
printf(")\n");
break;
}
}
exit(0);
}
|