1/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3/* { dg-require-effective-target powerpc_p8vector_ok } */
4/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
5/* { dg-options "-mcpu=power8 -m64 -O1" } */
6
7enum typecode
8{
9  QIcode, QUcode, HIcode, HUcode, SIcode, SUcode, DIcode, DUcode, SFcode,
10    DFcode, XFcode, Pcode, Tcode, LAST_AND_UNUSED_TYPECODE
11};
12enum bytecode_opcode
13{
14  neverneverland, drop, duplicate, over, setstackSI, adjstackSI, constQI,
15    constHI, constSI, constDI, constSF, constDF, constXF, constP, loadQI,
16    loadHI, loadSI, loadDI, loadSF, loadDF, loadXF, loadP, storeQI, storeHI,
17    storeSI, storeDI, storeSF, storeDF, storeXF, storeP, storeBLK, clearBLK,
18    addconstPSI, newlocalSI, localP, argP, convertQIHI, convertHISI,
19    convertSIDI, convertQISI, convertQUHU, convertHUSU, convertSUDU,
20    convertQUSU, convertSFDF, convertDFXF, convertHIQI, convertSIHI,
21    convertDISI, convertSIQI, convertSUQU, convertDFSF, convertXFDF,
22    convertSISF, convertSIDF, convertSIXF, convertSUSF, convertSUDF,
23    convertSUXF, convertDISF, convertDIDF, convertDIXF, convertDUSF,
24    convertDUDF, convertDUXF, convertSFSI, convertDFSI, convertXFSI,
25    convertSFSU, convertDFSU, convertXFSU, convertSFDI, convertDFDI,
26    convertXFDI, convertSFDU, convertDFDU, convertXFDU, convertPSI,
27    convertSIP, convertSIT, convertDIT, convertSFT, convertDFT, convertXFT,
28    convertPT, zxloadBI, sxloadBI, sstoreBI, addSI, addDI, addSF, addDF,
29    addXF, addPSI, subSI, subDI, subSF, subDF, subXF, subPP, mulSI, mulDI,
30    mulSU, mulDU, mulSF, mulDF, mulXF, divSI, divDI, divSU, divDU, divSF,
31    divDF, divXF, modSI, modDI, modSU, modDU, andSI, andDI, iorSI, iorDI,
32    xorSI, xorDI, lshiftSI, lshiftSU, lshiftDI, lshiftDU, rshiftSI, rshiftSU,
33    rshiftDI, rshiftDU, ltSI, ltSU, ltDI, ltDU, ltSF, ltDF, ltXF, ltP, leSI,
34    leSU, leDI, leDU, leSF, leDF, leXF, leP, geSI, geSU, geDI, geDU, geSF,
35    geDF, geXF, geP, gtSI, gtSU, gtDI, gtDU, gtSF, gtDF, gtXF, gtP, eqSI,
36    eqDI, eqSF, eqDF, eqXF, eqP, neSI, neDI, neSF, neDF, neXF, neP, negSI,
37    negDI, negSF, negDF, negXF, notSI, notDI, notT, predecQI, predecHI,
38    predecSI, predecDI, predecP, predecSF, predecDF, predecXF, predecBI,
39    preincQI, preincHI, preincSI, preincDI, preincP, preincSF, preincDF,
40    preincXF, preincBI, postdecQI, postdecHI, postdecSI, postdecDI, postdecP,
41    postdecSF, postdecDF, postdecXF, postdecBI, postincQI, postincHI,
42    postincSI, postincDI, postincP, postincSF, postincDF, postincXF,
43    postincBI, xjumpif, xjumpifnot, jump, jumpP, caseSI, caseSU, caseDI,
44    caseDU, call, returnP, ret, linenote, LAST_AND_UNUSED_OPCODE
45};
46struct binary_operator
47{
48  enum bytecode_opcode opcode;
49  enum typecode arg0;
50};
51static struct conversion_recipe
52{
53  unsigned char *opcodes;
54  int cost;
55}
56conversion_recipe[((int) LAST_AND_UNUSED_TYPECODE)][((int)
57						     LAST_AND_UNUSED_TYPECODE)];
58static struct conversion_recipe
59deduce_conversion (from, to)
60     enum typecode from, to;
61{
62  (conversion_recipe[(int) from][(int) to].
63   opcodes ? 0 : (conversion_recipe[(int) from][(int) to] =
64		  deduce_conversion (from, to), 0));
65}
66
67void
68bc_expand_binary_operation (optab, resulttype, arg0, arg1)
69     int resulttype, arg0, arg1;
70     struct binary_operator optab[];
71{
72  int i, besti, cost, bestcost;
73  enum typecode resultcode, arg0code;
74  for (i = 0; optab[i].opcode != -1; ++i)
75    {
76      (conversion_recipe[(int) arg0code][(int) optab[i].arg0].
77       opcodes ? 0 : (conversion_recipe[(int) arg0code][(int) optab[i].arg0] =
78		      deduce_conversion (arg0code, optab[i].arg0), 0));
79    }
80}
81