Ignore:
Timestamp:
Aug 30, 2014, 10:48:46 PM (4 years ago)
Author:
ksherdy
Message:

s2k sk to b2k IDISA translation support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/src/toolchain/b2k/lang/paramBuiltin/idisa/IDISABuiltin.java

    r4023 r4109  
    4848import static toolchain.b2k.lang.type.PrimitiveType.INTEGER;
    4949import static toolchain.b2k.lang.type.PrimitiveType.VOID;
     50import static toolchain.b2k.lang.paramBuiltin.idisa.IDISABuiltinsTranslator.IDENTITY_TRANSLATION;
     51import static toolchain.b2k.lang.paramBuiltin.idisa.IDISABuiltinsTranslator.PACK_TRANSLATION;;
    5052
    5153public enum IDISABuiltin {
     
    5355        // C++: class_name<fw>::op(data_type arg, ...)
    5456        // C:   class_name_op_fw(args...)
    55         ESIMD_MERGEH (          "mergeh",               makeRangeOfSimpleSignatures(1,BITBLOCK_SIZE/2, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    56         ESIMD_MERGEL (          "mergel",               makeRangeOfSimpleSignatures(1,BITBLOCK_SIZE/2, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    57         ESIMD_MULTH (           "multh",                makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    58         ESIMD_MULTL (           "multl",                makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    59         ESIMD_SIGNEXTENDH (     "signextendh",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    60         ESIMD_SIGNEXTENDL (     "signextendl",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    61         ESIMD_ZEROEXTENDH (     "zeroextendh",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    62         ESIMD_ZEROEXTENDL (     "zeroextendl",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    63         HSIMD_ADD_HL (          "add_hl",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    64         HSIMD_MIN_HL (          "min_hl",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    65         HSIMD_PACKH (           "packh",        makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    66         HSIMD_PACKL (           "packl",        makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    67         HSIMD_PACKSS (          "packss",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    68         HSIMD_PACKUS (          "packus",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    69         HSIMD_SIGNMASK (        "signmask",     makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITFIELD)),
    70         HSIMD_UMIN_HL (         "umin_hl",      makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    71         MVMD_FILL (                     "fill",         makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    72         MVMD_FILL16 (           "fill16",       makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
    73         MVMD_FILL2 (            "fill2",        makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    74         MVMD_FILL4 (            "fill4",        makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
    75         MVMD_FILL8 (            "fill8",        makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
     57        ESIMD_MERGEH (          "mergeh",               IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(1,BITBLOCK_SIZE/2, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     58        ESIMD_MERGEL (          "mergel",               IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(1,BITBLOCK_SIZE/2, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     59        ESIMD_MULTH (           "multh",                IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     60        ESIMD_MULTL (           "multl",                IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     61        ESIMD_SIGNEXTENDH (     "signextendh",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     62        ESIMD_SIGNEXTENDL (     "signextendl",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     63        ESIMD_ZEROEXTENDH (     "zeroextendh",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     64        ESIMD_ZEROEXTENDL (     "zeroextendl",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     65        HSIMD_ADD_HL (          "add_hl",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     66        HSIMD_MIN_HL (          "min_hl",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     67        HSIMD_PACKH (           "packh",        PACK_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     68        HSIMD_PACKL (           "packl",        PACK_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     69        HSIMD_PACKSS (          "packss",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     70        HSIMD_PACKUS (          "packus",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     71        HSIMD_SIGNMASK (        "signmask",     IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITFIELD)),
     72        HSIMD_UMIN_HL (         "umin_hl",      IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     73        MVMD_FILL (                     "fill",         IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     74        MVMD_FILL16 (           "fill16",       IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
     75        MVMD_FILL2 (            "fill2",        IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     76        MVMD_FILL4 (            "fill4",        IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
     77        MVMD_FILL8 (            "fill8",        IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
    7678        //KH: shuffle dne ?
    7779        //MVMD_SHUFFLE (                "shuffle",      makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    78         SIMD_ABS (                      "abs",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    79         SIMD_ADD (                      "add",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    80         SIMD_ADD_HL (           "add_hl",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    81         SIMD_CTZ (                      "ctz",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    82         SIMD_EQ (                       "eq",           makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    83         SIMD_GT (                       "gt",           makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    84         SIMD_HIMASK (           "himask",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),   BITBLOCK)),
    85         SIMD_IFH (                      "ifh",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
    86         SIMD_LOMASK (           "lomask",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),   BITBLOCK)),
    87         SIMD_LT (                       "lt",           makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    88         SIMD_MAX (                      "max",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    89         SIMD_MIN (                      "min",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    90         SIMD_MULT (                     "mult",         makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    91         SIMD_NEG (                      "neg",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    92         SIMD_POPCOUNT (         "popcount",     makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    93         SIMD_SLL (                      "sll",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    94         SIMD_SRA (                      "sra",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    95         SIMD_SRL (                      "srl",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    96         SIMD_SUB (                      "sub",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    97         SIMD_SUB_HL (           "sub_hl",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    98         SIMD_UGT (                      "ugt",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    99         SIMD_ULT (                      "ult",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    100         SIMD_UMAX (                     "umax",         makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    101         SIMD_UMIN (                     "umin",         makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    102         SIMD_UMULT (            "umult",        makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    103         SIMD_XOR_HL (           "xor_hl",       makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     80        SIMD_ABS (                      "abs",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     81        SIMD_ADD (                      "add",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     82        SIMD_ADD_HL (           "add_hl",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     83        SIMD_CTZ (                      "ctz",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     84        SIMD_EQ (                       "eq",           IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     85        SIMD_GT (                       "gt",           IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     86        SIMD_HIMASK (           "himask",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),   BITBLOCK)),
     87        SIMD_IFH (                      "ifh",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK, BITBLOCK,  BITBLOCK)),
     88        SIMD_LOMASK (           "lomask",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),   BITBLOCK)),
     89        SIMD_LT (                       "lt",           IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     90        SIMD_MAX (                      "max",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     91        SIMD_MIN (                      "min",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     92        SIMD_MULT (                     "mult",         IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     93        SIMD_NEG (                      "neg",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     94        SIMD_POPCOUNT (         "popcount",     IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     95        SIMD_SLL (                      "sll",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     96        SIMD_SRA (                      "sra",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     97        SIMD_SRL (                      "srl",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     98        SIMD_SUB (                      "sub",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     99        SIMD_SUB_HL (           "sub_hl",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     100        SIMD_UGT (                      "ugt",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     101        SIMD_ULT (                      "ult",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     102        SIMD_UMAX (                     "umax",         IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     103        SIMD_UMIN (                     "umin",         IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     104        SIMD_UMULT (            "umult",        IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     105        SIMD_XOR_HL (           "xor_hl",       IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    104106
    105107        //  KH: Not sure why we initially omitted any, all, vsrl, vsll
    106         SIMD_ANY (              "any",          makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    107         SIMD_ALL (              "all",          makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    108         SIMD_VRSL(              "vsrl",         makeRangeOfSimpleSignatures(64,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK, BITBLOCK)),           
    109         SIMD_VRLL(              "vsll",         makeRangeOfSimpleSignatures(64,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK, BITBLOCK)),
     108        SIMD_ANY (              "any",          IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     109        SIMD_ALL (              "all",          IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     110        SIMD_VRSL(              "vsrl",         IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(64,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK, BITBLOCK)),             
     111        SIMD_VRLL(              "vsll",         IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(64,BITBLOCK_SIZE, new SIMDBuiltinsGenerator(),  BITBLOCK,  BITBLOCK, BITBLOCK)),
    110112       
    111113        // SIMD (opPatterns == 1)
    112114        // C++: class_name<fw>::op<x>(data_type arg, ...)
    113115        // C:   class_name_op_fw(data_type arg, ..., x)
    114         MVMD_DSLLI (    "dslli",        makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK,  BITBLOCK)),
    115         MVMD_DSRLI (    "dsrli",        makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK,  BITBLOCK)),
    116         MVMD_EXTRACT (  "extract",      makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITFIELD)),
    117         MVMD_INSERT (   "insert",       makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITFIELD, BITBLOCK)),
    118         MVMD_SHUFFLEI ( "shufflei",     makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
    119         MVMD_SLLI (             "slli",         makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,  BITBLOCK)),
    120         MVMD_SPLAT (    "splat",        makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER, BITBLOCK, BITBLOCK)),
    121         MVMD_SRLI (             "srli",         makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER, BITBLOCK,  BITBLOCK)),
    122         SIMD_CONSTANT ( "constant",     makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK)),
    123         SIMD_SLLI (             "slli",         makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
    124         SIMD_SRAI (             "srai",         makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
    125         SIMD_SRLI (             "srli",         makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
     116        MVMD_DSLLI (    "dslli",        IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK,  BITBLOCK)),
     117        MVMD_DSRLI (    "dsrli",        IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK,  BITBLOCK)),
     118        MVMD_EXTRACT (  "extract",      IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITFIELD)),
     119        MVMD_INSERT (   "insert",       IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITFIELD, BITBLOCK)),
     120        MVMD_SHUFFLEI ( "shufflei",     IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
     121        MVMD_SLLI (             "slli",         IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,  BITBLOCK)),
     122        MVMD_SPLAT (    "splat",        IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER, BITBLOCK, BITBLOCK)),
     123        MVMD_SRLI (             "srli",         IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER, BITBLOCK,  BITBLOCK)),
     124        SIMD_CONSTANT ( "constant",     IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK)),
     125        SIMD_SLLI (             "slli",         IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
     126        SIMD_SRAI (             "srai",         IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
     127        SIMD_SRLI (             "srli",         IDENTITY_TRANSLATION, makeRangeOfSimpleSignatures(2,BITBLOCK_SIZE, new SIMDConstantBuiltinsGenerator(),  INTEGER,   BITBLOCK,   BITBLOCK)),
    126128               
    127129        // SIMD logic operations (opPattern == 2)
    128130        // C++: simd_op(data_type arg, ...)
    129131        // C:   simd_op(data_type arg, ...)
    130         SIMD_NOR (      "nor",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    131         SIMD_NOT (      "not",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
    132         SIMD_ANDC (     "andc", makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    133         SIMD_OR (       "or",   makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    134         SIMD_XOR (      "xor",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    135         SIMD_AND (      "and",  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     132        SIMD_NOR (      "nor",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     133        SIMD_NOT (      "not",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK,  BITBLOCK)),
     134        SIMD_ANDC (     "andc", IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     135        SIMD_OR (       "or",   IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     136        SIMD_XOR (      "xor",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
     137        SIMD_AND (      "and",  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDLogicBuiltinsGenerator(),  BITBLOCK, BITBLOCK,  BITBLOCK)),
    136138       
    137139        // SIMD (opPattern == 3)
    138140        // C++: class_name::op(data_type arg, ...)
    139141        // C:   class_name_op(data_type arg, ...)
    140         BITBLOCK_ALL (          "all",                  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,          BOOL)),
    141         BITBLOCK_ANY (          "any",                  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,          BOOL)),
    142         BITBLOCK_POPCOUNT (     "popcount",             makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,          BITFIELD)),
    143         BITBLOCK_SLL (          "sll",                  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,  BITBLOCK,  BITBLOCK)),
    144         BITBLOCK_SRL (          "srl",                  makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,  BITBLOCK,  BITBLOCK)),
     142        BITBLOCK_ALL (          "all",                  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,    BOOL)),
     143        BITBLOCK_ANY (          "any",                  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,    BOOL)),
     144        BITBLOCK_POPCOUNT (     "popcount",             IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,    BITFIELD)),
     145        BITBLOCK_SLL (          "sll",                  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,    BITBLOCK,  BITBLOCK)),
     146        BITBLOCK_SRL (          "srl",                  IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockBuiltinsGenerator(),  BITBLOCK,    BITBLOCK,  BITBLOCK)),
    145147       
    146148        // SIMD (opPattern == 4)
    147149        // C++: class_name::op<x>(data_type arg, ...)
    148150        // C:   class_name_op(data_type arg, ..., x)
    149         BITBLOCK_SLLI (         "slli"  ,       makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockImmediateBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK)),
    150         BITBLOCK_SRLI (         "srli"  ,       makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockImmediateBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK)),
     151        BITBLOCK_SLLI (         "slli"  ,       IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockImmediateBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK)),
     152        BITBLOCK_SRLI (         "srli"  ,       IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockImmediateBuiltinsGenerator(),  INTEGER,  BITBLOCK,  BITBLOCK)),
    151153       
    152154        // SIMD Stores (with args = (Bitblock, Bitblock*))
    153         BITBLOCK_STORE_ALIGNED (        "store_aligned",        makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockStoreBuiltinsGenerator(),  BITBLOCK, BITBLOCK_POINTER,  VOID)),
    154         BITBLOCK_STORE_UNALIGNED (      "store_unaligned",      makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockStoreBuiltinsGenerator(),  BITBLOCK, BITBLOCK_POINTER,  VOID)),
     155        BITBLOCK_STORE_ALIGNED (        "store_aligned",        IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockStoreBuiltinsGenerator(),  BITBLOCK, BITBLOCK_POINTER,  VOID)),
     156        BITBLOCK_STORE_UNALIGNED (      "store_unaligned",      IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockStoreBuiltinsGenerator(),  BITBLOCK, BITBLOCK_POINTER,  VOID)),
    155157       
    156158        // SIMD Loads (with args = Bitblock*)
    157         BITBLOCK_LOAD_ALIGNED (         "load_aligned",         makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockLoadBuiltinsGenerator(),  BITBLOCK_POINTER,  BITBLOCK)),
    158         BITBLOCK_LOAD_UNALIGNED (       "load_unaligned",       makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockLoadBuiltinsGenerator(),  BITBLOCK_POINTER,  BITBLOCK)),
    159 
    160         NULL_BUILTIN("Null");
     159        BITBLOCK_LOAD_ALIGNED (         "load_aligned",         IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockLoadBuiltinsGenerator(),  BITBLOCK_POINTER,  BITBLOCK)),
     160        BITBLOCK_LOAD_UNALIGNED (       "load_unaligned",       IDENTITY_TRANSLATION, makeAllSimpleSignatures(BITBLOCK_SIZE, new SIMDBitblockLoadBuiltinsGenerator(),  BITBLOCK_POINTER,  BITBLOCK)),
     161
     162        NULL_BUILTIN("Null", IDENTITY_TRANSLATION );
    161163       
    162164        private static final Map<String, IDISABuiltin> builtinForName = new HashMap<String, IDISABuiltin>();
     
    176178   
    177179    private String name;
     180    private IDISABuiltinsTranslator translator;
    178181        private ParameterizedFunctionSignature [] signatures;
    179182       
    180         private IDISABuiltin(String name, ParameterizedFunctionSignature ...signatures) {
     183        private IDISABuiltin(String name, IDISABuiltinsTranslator translator, ParameterizedFunctionSignature ...signatures) {
    181184                this.name = name;
     185                this.translator = translator;
    182186                this.signatures = signatures;
    183187        }
     
    190194        public String packageName() { return this.name().toLowerCase().split("_")[0];   }
    191195        public String baseName() { return this.name; }
     196    public IDISABuiltinsTranslator getTranslator() { return this.translator; }
    192197        public boolean hasSignature(int fieldWidth,  int argCount) {
    193198                return !getSignature(fieldWidth, argCount).isNull();
     
    235240                return (ParameterizedFunctionSignature []) signatures.toArray(new ParameterizedFunctionSignature[signatures.size()]);
    236241        }
     242
     243
    237244}
Note: See TracChangeset for help on using the changeset viewer.