Changeset 4166 for proto


Ignore:
Timestamp:
Sep 13, 2014, 3:19:20 AM (4 years ago)
Author:
ksherdy
Message:

Filled-in mappings. A number of unused mapping remain to be completed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/src/toolchain/s2k/transformer/visitors/S2K2B2K/S2KParam2B2KIDISABuiltins.java

    r4103 r4166  
    22
    33/*
    4  * Maps non-parameterized s2k builtins to b2k builtins, i.e. not IDISA.
    5  * Expects that every s2k builtin maps to a b2k builtin.
     4 * Maps s2k parameterized intrinsics to b2k IDISA intrinsics.
    65 *
    76 * @author Ken Herdy <ksherdy at sfu dot ca>
    87 */
    9 
    108import java.util.HashMap;
    119import java.util.Map;
    1210
    13 import toolchain.s2k.lang.builtin.S2KBuiltin;
    14 import toolchain.s2k.lang.builtin.S2KBuiltins;
    1511import toolchain.s2k.lang.paramBuiltin.S2KParamBuiltin;
    1612import toolchain.s2k.lang.paramBuiltin.S2KParamBuiltins;
    17 import toolchain.b2k.lang.builtin.B2KBuiltins;
    1813import toolchain.b2k.lang.paramBuiltin.idisa.IDISABuiltin;
    1914
     
    2520       
    2621        s2KParamBuiltin2IDISABuiltin = new HashMap<S2KParamBuiltins, IDISABuiltin>();
    27        
     22        // Vertical
     23        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_NOR, IDISABuiltin.SIMD_NOR);
     24        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_NOT, IDISABuiltin.SIMD_NOT);
     25        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_ANDC, IDISABuiltin.SIMD_ANDC);
     26        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_AND, IDISABuiltin.SIMD_AND);
     27        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_OR, IDISABuiltin.SIMD_OR);
     28        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_XOR, IDISABuiltin.SIMD_XOR);
     29       
     30        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_ABS, IDISABuiltin.SIMD_ABS);
     31        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_ADD, IDISABuiltin.SIMD_ADD);
     32        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_ADD_HL, IDISABuiltin.SIMD_ADD_HL);
     33        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_CTZ, IDISABuiltin.SIMD_CTZ);
     34        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_EQ, IDISABuiltin.SIMD_EQ);
     35        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_GT, IDISABuiltin.SIMD_GT);
     36        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_HIMASK, IDISABuiltin.SIMD_HIMASK);
     37        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_IFH, IDISABuiltin.SIMD_IFH);
     38        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_LOMASK, IDISABuiltin.SIMD_LOMASK);
     39        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_LT, IDISABuiltin.SIMD_LT);
     40        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_MAX, IDISABuiltin.SIMD_MAX);
     41        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_MIN, IDISABuiltin.SIMD_MIN);
     42        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_MULT, IDISABuiltin.SIMD_MULT);
     43        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_NEG, IDISABuiltin.SIMD_NEG);
     44        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_POPCOUNT, IDISABuiltin.SIMD_POPCOUNT);
     45        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SLL, IDISABuiltin.SIMD_SLL);
     46// DNE       
     47//        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SRA, IDISABuiltin.SIMD_SRA);
     48        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SRL, IDISABuiltin.SIMD_SRL);
     49        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SUB, IDISABuiltin.SIMD_SUB);
     50// Not implemented in runtime.       
     51//        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SUB_HL, IDISABuiltin.SIMD_SUB_HL);
     52        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_XOR_HL, IDISABuiltin.SIMD_XOR_HL);
     53
     54        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_ANY, IDISABuiltin.SIMD_ANY);
     55        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_ALL, IDISABuiltin.SIMD_ALL);
     56       
     57        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_CONSTANT, IDISABuiltin.SIMD_CONSTANT);
     58        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SLLI, IDISABuiltin.SIMD_SLLI);
     59        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SRAI, IDISABuiltin.SIMD_SRAI);
     60        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VSTRM_SRLI, IDISABuiltin.SIMD_SRLI);
     61         
     62        // Horizontal
    2863        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.HSTRM_PACKH, IDISABuiltin.HSIMD_PACKH);
    2964        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.HSTRM_PACKL, IDISABuiltin.HSIMD_PACKL);
    3065       
     66        // Expansion
     67        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_MERGEH, IDISABuiltin.ESIMD_MERGEH);
     68        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_MULTH, IDISABuiltin.ESIMD_MULTH);
     69        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_SIGNEXTENDH, IDISABuiltin.ESIMD_SIGNEXTENDH);
     70        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_ZEROEXTENDH, IDISABuiltin.ESIMD_ZEROEXTENDH);
     71        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_MERGEL, IDISABuiltin.ESIMD_MERGEL);
     72        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_MULTL, IDISABuiltin.ESIMD_MULTL);
     73        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_SIGNEXTENDL, IDISABuiltin.ESIMD_SIGNEXTENDL);
     74        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.VIRT_ESTRM_ZEROEXTENDL, IDISABuiltin.ESIMD_ZEROEXTENDL);
     75       
    3176        s2KParamBuiltin2IDISABuiltin.put(S2KParamBuiltins.NULL_BUILTIN, IDISABuiltin.NULL_BUILTIN);
    3277       
    33         for(S2KParamBuiltin builtin : S2KParamBuiltins.values()) {
    34                 if(!s2KParamBuiltin2IDISABuiltin.containsKey(builtin)) {
    35                                 throw new RuntimeException("S2K builtin to B2K builtin mapping not unimplemented in :" + builtin.infoString());
    36                 }
     78        for(S2KParamBuiltins builtin : S2KParamBuiltins.values()) {
     79           
     80            if(!S2KParamBuiltins.isEStrm(builtin)) {
     81                if(!s2KParamBuiltin2IDISABuiltin.containsKey(builtin)) {
     82                                throw new RuntimeException("S2K builtin to B2K builtin mapping not unimplemented in :" + builtin.infoString());
     83                }
     84            }
    3785        }
    3886    }
Note: See TracChangeset for help on using the changeset viewer.