Changeset 3563 in CLRX


Ignore:
Timestamp:
Dec 25, 2017, 1:52:53 PM (6 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmGallium?: Add testcase for scratch relocations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/tests/amdasm/AsmGalliumFormat.cpp

    r3553 r3563  
    176176        os.flush();
    177177    }
     178    // scratch relocations
     179    if (!output->scratchRelocs.empty())
     180    {
     181        os << "  Scratch relocations:\n";
     182        for (const GalliumScratchReloc& rel: output->scratchRelocs)
     183            os << "    Rel: offset=" << rel.offset << ", type: " << rel.type << "\n";
     184    }
    178185    // other data from output
    179186    os << "  Comment:\n";
     
    787794  0000000000000000000000000000000000000000000000000000000000000000
    788795)ffDXD", "", true
     796    },
     797    /* scratch relocations */
     798    /* 1 - gallium scratch relocation */
     799    { R"ffDXD(            .gallium
     800            .kernel aa22
     801            .args
     802            .arg scalar, 8,,,SEXT,griddim
     803            .config
     804            .priority 1
     805            .floatmode 43
     806            .ieeemode
     807            .sgprsnum 36
     808            .vgprsnum 139
     809            .pgmrsrc2 523243
     810            .scratchbuffer 230
     811        .scratchsym scratch
     812.text
     813aa22:
     814        s_and_b32 s9,s5,44
     815        s_and_b32 s10,s5,5
     816        s_mov_b32 s1, scratch
     817        s_mov_b32 s1, scratch+7*3-21
     818        s_mov_b32 s1, (scratch+7*3-21)&(1<<32-1)
     819        s_mov_b32 s1, ((scratch)*2-scratch)&(4096*4096*256-1)
     820        s_mov_b32 s1, (-scratch+2*(scratch))%(4096*4096*256)
     821        s_mov_b32 s1, (-scratch+2*(scratch))%%(4096*4096*256)
     822        s_mov_b32 s1, (-scratch+2*(scratch))%%(4096*4096*256*9)
     823        s_mov_b32 s1, (-scratch+2*(scratch))%(4096*4096*256*9)
     824        s_mov_b32 s1, (scratch+6-6)>>(31-5+6)
     825        s_mov_b32 s1, (scratch+6-3*2)>>(234%101)
     826        s_mov_b32 s1, (scratch)>>(235%101-1)
     827        s_mov_b32 s1, (scratch)/(4096*4096*256)
     828        s_mov_b32 s1, (scratch+6-3*2)//(4096*4096*256)
     829        s_mov_b32 s1, scratch>>32
     830        s_mov_b32 s1, scratch&0xffffffff
     831)ffDXD",
     832       R"ffDXD(GalliumBinDump:
     833  Kernel: name=aa22, offset=0
     834    Config:
     835      dims=default, SGPRS=36, VGPRS=139, pgmRSRC2=0x7fbeb, ieeeMode=0x1
     836      floatMode=0x2b, priority=1, localSize=0, scratchBuffer=230
     837    Arg: scalar, true, griddim, size=8, tgtSize=8, tgtAlign=8
     838  Scratch relocations:
     839    Rel: offset=12, type: 1
     840    Rel: offset=20, type: 1
     841    Rel: offset=28, type: 1
     842    Rel: offset=36, type: 1
     843    Rel: offset=44, type: 1
     844    Rel: offset=52, type: 1
     845    Rel: offset=60, type: 1
     846    Rel: offset=68, type: 1
     847    Rel: offset=76, type: 2
     848    Rel: offset=84, type: 2
     849    Rel: offset=92, type: 2
     850    Rel: offset=100, type: 2
     851    Rel: offset=108, type: 2
     852    Rel: offset=116, type: 2
     853    Rel: offset=124, type: 1
     854  Comment:
     855  nullptr
     856  GlobalData:
     857  nullptr
     858  Code:
     859  05ac098705850a87ff0381be04000000ff0381be04000000ff0381be04000000
     860  ff0381be04000000ff0381be04000000ff0381be04000000ff0381be04000000
     861  ff0381be04000000ff0381be04000000ff0381be04000000ff0381be04000000
     862  ff0381be04000000ff0381be04000000ff0381be04000000ff0381be04000000
     863)ffDXD", "", true
     864    },
     865    { R"ffDXD(            .gallium
     866            .kernel aa22
     867            .args
     868            .arg scalar, 8,,,SEXT,griddim
     869            .config
     870            .priority 1
     871            .scratchbuffer 230
     872        .scratchsym scratch
     873.text
     874aa22:
     875        s_and_b32 s9,s5,44
     876        s_and_b32 s10,s5,5
     877        s_mov_b32 s1, (scratch+6)&0xffffffff
     878)ffDXD", "", "test.s:13:23: Error: Expression must point to start of section\n", false
    789879    }
    790880};
Note: See TracChangeset for help on using the changeset viewer.