Changeset 1676 in CLRX


Ignore:
Timestamp:
Nov 7, 2015, 8:05:53 PM (5 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Added skipSpaces assignSymbol parsing routine (fixed assignment of the register symbols via '.set','.equiv','.eqv' pseudo-ops).
Added regrange test cases into AssemblerBasics?.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/Assembler.cpp

    r1672 r1676  
    956956             const char* linePtr, bool reassign, bool baseExpr)
    957957{
     958    skipSpacesToEnd(linePtr, line+lineSize);
    958959    if (linePtr!=line+lineSize && *linePtr=='%')
    959960    {
     
    992993    bool makeBaseExpr = (baseExpr && symbolName != ".");
    993994    std::unique_ptr<AsmExpression> expr(AsmExpression::parse(*this, linePtr, makeBaseExpr));
    994     skipSpacesToEnd(linePtr, line+lineSize);
    995995    if (!expr) // no expression, errors
    996996        return false;
  • CLRadeonExtender/trunk/tests/amdasm/AssemblerBasics.cpp

    r1663 r1676  
    4949    cxbyte info;
    5050    cxbyte other;
     51    bool regRange;
    5152};
    5253
     
    678679            { "x1", 5U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
    679680        },
    680         true, R"ffDXD(Expression evaluation from test.s:3:22:
     681        true, R"ffDXD(Expression evaluation from test.s:3:23:
    681682                      from test.s:4:18:
    682683test.s:1:24: Warning: Shift count out of range (between 0 and 63)
    683 Expression evaluation from test.s:6:21:
    684                       from test.s:9:22:
     684Expression evaluation from test.s:6:22:
     685                      from test.s:9:23:
    685686                      from test.s:10:18:
    686687test.s:7:24: Warning: Shift count out of range (between 0 and 63)
    687 Expression evaluation from test.s:9:22:
     688Expression evaluation from test.s:9:23:
    688689                      from test.s:10:18:
    689690test.s:6:24: Warning: Shift count out of range (between 0 and 63)
     
    744745test.s:2:17: Error: Expected ',' before argument
    745746test.s:3:21: Error: Expected ',' before argument
    746 test.s:4:22: Error: Expected assignment expression
     747test.s:4:23: Error: Expected assignment expression
    747748test.s:5:1: Error: Illegal number at statement begin
    748749test.s:6:6: Error: Symbol 'aaa' is already defined
     
    33283329            { "sym7", 1, ASMSECT_ABS, 0, true, false, false, 0, 0 }
    33293330        }, true, "", ""
    3330     }
     3331    },
     3332    /* register ranges assignment */
     3333    {   R"ffDXD(sym1 = 123
     3334        sym1 = %v[12:15]
     3335        sym2 = x*21
     3336        sym2 = %v[120:125]
     3337        sym3 = %sym2[1:3]
     3338        sym4 = %v[120:125]
     3339        sym4 = 12
     3340        .set sym5, %v[120:125]
     3341        .equiv sym6, %v[120:125]
     3342        x=43)ffDXD",
     3343        BinaryFormat::AMD, GPUDeviceType::CAPE_VERDE, false, { },
     3344        { { nullptr, ASMKERN_GLOBAL, AsmSectionType::DATA } },
     3345        {
     3346            { ".", 0, 0, 0, true, false, false, 0, 0 },
     3347            { "sym1", (256+12) | ((256+16ULL)<<32), ASMSECT_ABS, 0,
     3348                true, false, false, 0, 0, true },
     3349            { "sym2", (256+120) | ((256+126ULL)<<32), ASMSECT_ABS, 0,
     3350                true, false, false, 0, 0, true },
     3351            { "sym3", (256+121) | ((256+124ULL)<<32), ASMSECT_ABS, 0,
     3352                true, false, false, 0, 0, true },
     3353            { "sym4", 12, ASMSECT_ABS, 0, true, false, 0, 0 },
     3354            { "sym5", (256+120) | ((256+126ULL)<<32), ASMSECT_ABS, 0,
     3355                true, false, false, 0, 0, true },
     3356            { "sym6", (256+120) | ((256+126ULL)<<32), ASMSECT_ABS, 0,
     3357                true, true, false, 0, 0, true },
     3358            { "x", 43, ASMSECT_ABS, 0, true, false, 0, 0 }
     3359        }, true, "", ""
     3360    },
     3361    /*{   R"ffDXD(sym1 = 123
     3362        )ffDXD",
     3363        BinaryFormat::AMD, GPUDeviceType::CAPE_VERDE, false, { },
     3364        { { nullptr, ASMKERN_GLOBAL, AsmSectionType::DATA } },
     3365        {
     3366            { ".", 0, 0, 0, true, false, false, 0, 0 },
     3367        }, true, "", ""
     3368    }*/
    33313369};
    33323370
     
    34203458        assertValue(testName,caseName+"other", int(expSymbol.other),
    34213459                    int(resSymbol.second.other));
     3460        assertValue(testName,caseName+"regRange", int(expSymbol.regRange),
     3461                    int(resSymbol.second.regRange));
    34223462    }
    34233463    errorStream.flush();
Note: See TracChangeset for help on using the changeset viewer.