123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845 |
- //===-- NVPTXReplaceImageHandles.cpp - Replace image handles for Fermi ----===//
- //
- // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- // See https://llvm.org/LICENSE.txt for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- //===----------------------------------------------------------------------===//
- //
- // On Fermi, image handles are not supported. To work around this, we traverse
- // the machine code and replace image handles with concrete symbols. For this
- // to work reliably, inlining of all function call must be performed.
- //
- //===----------------------------------------------------------------------===//
- #include "NVPTX.h"
- #include "NVPTXMachineFunctionInfo.h"
- #include "NVPTXSubtarget.h"
- #include "NVPTXTargetMachine.h"
- #include "MCTargetDesc/NVPTXBaseInfo.h"
- #include "llvm/ADT/DenseSet.h"
- #include "llvm/CodeGen/MachineFunction.h"
- #include "llvm/CodeGen/MachineFunctionPass.h"
- #include "llvm/CodeGen/MachineRegisterInfo.h"
- #include "llvm/Support/raw_ostream.h"
- using namespace llvm;
- namespace {
- class NVPTXReplaceImageHandles : public MachineFunctionPass {
- private:
- static char ID;
- DenseSet<MachineInstr *> InstrsToRemove;
- public:
- NVPTXReplaceImageHandles();
- bool runOnMachineFunction(MachineFunction &MF) override;
- StringRef getPassName() const override {
- return "NVPTX Replace Image Handles";
- }
- private:
- bool processInstr(MachineInstr &MI);
- bool replaceImageHandle(MachineOperand &Op, MachineFunction &MF);
- bool findIndexForHandle(MachineOperand &Op, MachineFunction &MF,
- unsigned &Idx);
- };
- }
- char NVPTXReplaceImageHandles::ID = 0;
- NVPTXReplaceImageHandles::NVPTXReplaceImageHandles()
- : MachineFunctionPass(ID) {}
- bool NVPTXReplaceImageHandles::runOnMachineFunction(MachineFunction &MF) {
- bool Changed = false;
- InstrsToRemove.clear();
- for (MachineBasicBlock &MBB : MF)
- for (MachineInstr &MI : MBB)
- Changed |= processInstr(MI);
- // Now clean up any handle-access instructions
- // This is needed in debug mode when code cleanup passes are not executed,
- // but we need the handle access to be eliminated because they are not
- // valid instructions when image handles are disabled.
- for (MachineInstr *MI : InstrsToRemove)
- MI->eraseFromParent();
- return Changed;
- }
- static unsigned suldRegisterToIndexOpcode(unsigned RegOC) {
- switch (RegOC) {
- case NVPTX::SULD_1D_I8_CLAMP_R:
- return NVPTX::SULD_1D_I8_CLAMP_I;
- case NVPTX::SULD_1D_I16_CLAMP_R:
- return NVPTX::SULD_1D_I16_CLAMP_I;
- case NVPTX::SULD_1D_I32_CLAMP_R:
- return NVPTX::SULD_1D_I32_CLAMP_I;
- case NVPTX::SULD_1D_I64_CLAMP_R:
- return NVPTX::SULD_1D_I64_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_I8_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_I8_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_I16_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_I16_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_I32_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_I32_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_I64_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_I64_CLAMP_I;
- case NVPTX::SULD_2D_I8_CLAMP_R:
- return NVPTX::SULD_2D_I8_CLAMP_I;
- case NVPTX::SULD_2D_I16_CLAMP_R:
- return NVPTX::SULD_2D_I16_CLAMP_I;
- case NVPTX::SULD_2D_I32_CLAMP_R:
- return NVPTX::SULD_2D_I32_CLAMP_I;
- case NVPTX::SULD_2D_I64_CLAMP_R:
- return NVPTX::SULD_2D_I64_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_I8_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_I8_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_I16_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_I16_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_I32_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_I32_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_I64_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_I64_CLAMP_I;
- case NVPTX::SULD_3D_I8_CLAMP_R:
- return NVPTX::SULD_3D_I8_CLAMP_I;
- case NVPTX::SULD_3D_I16_CLAMP_R:
- return NVPTX::SULD_3D_I16_CLAMP_I;
- case NVPTX::SULD_3D_I32_CLAMP_R:
- return NVPTX::SULD_3D_I32_CLAMP_I;
- case NVPTX::SULD_3D_I64_CLAMP_R:
- return NVPTX::SULD_3D_I64_CLAMP_I;
- case NVPTX::SULD_1D_V2I8_CLAMP_R:
- return NVPTX::SULD_1D_V2I8_CLAMP_I;
- case NVPTX::SULD_1D_V2I16_CLAMP_R:
- return NVPTX::SULD_1D_V2I16_CLAMP_I;
- case NVPTX::SULD_1D_V2I32_CLAMP_R:
- return NVPTX::SULD_1D_V2I32_CLAMP_I;
- case NVPTX::SULD_1D_V2I64_CLAMP_R:
- return NVPTX::SULD_1D_V2I64_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_V2I8_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_V2I8_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_V2I16_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_V2I16_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_V2I32_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_V2I32_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_V2I64_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_V2I64_CLAMP_I;
- case NVPTX::SULD_2D_V2I8_CLAMP_R:
- return NVPTX::SULD_2D_V2I8_CLAMP_I;
- case NVPTX::SULD_2D_V2I16_CLAMP_R:
- return NVPTX::SULD_2D_V2I16_CLAMP_I;
- case NVPTX::SULD_2D_V2I32_CLAMP_R:
- return NVPTX::SULD_2D_V2I32_CLAMP_I;
- case NVPTX::SULD_2D_V2I64_CLAMP_R:
- return NVPTX::SULD_2D_V2I64_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_V2I8_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_V2I8_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_V2I16_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_V2I16_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_V2I32_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_V2I32_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_V2I64_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_V2I64_CLAMP_I;
- case NVPTX::SULD_3D_V2I8_CLAMP_R:
- return NVPTX::SULD_3D_V2I8_CLAMP_I;
- case NVPTX::SULD_3D_V2I16_CLAMP_R:
- return NVPTX::SULD_3D_V2I16_CLAMP_I;
- case NVPTX::SULD_3D_V2I32_CLAMP_R:
- return NVPTX::SULD_3D_V2I32_CLAMP_I;
- case NVPTX::SULD_3D_V2I64_CLAMP_R:
- return NVPTX::SULD_3D_V2I64_CLAMP_I;
- case NVPTX::SULD_1D_V4I8_CLAMP_R:
- return NVPTX::SULD_1D_V4I8_CLAMP_I;
- case NVPTX::SULD_1D_V4I16_CLAMP_R:
- return NVPTX::SULD_1D_V4I16_CLAMP_I;
- case NVPTX::SULD_1D_V4I32_CLAMP_R:
- return NVPTX::SULD_1D_V4I32_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_V4I8_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_V4I8_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_V4I16_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_V4I16_CLAMP_I;
- case NVPTX::SULD_1D_ARRAY_V4I32_CLAMP_R:
- return NVPTX::SULD_1D_ARRAY_V4I32_CLAMP_I;
- case NVPTX::SULD_2D_V4I8_CLAMP_R:
- return NVPTX::SULD_2D_V4I8_CLAMP_I;
- case NVPTX::SULD_2D_V4I16_CLAMP_R:
- return NVPTX::SULD_2D_V4I16_CLAMP_I;
- case NVPTX::SULD_2D_V4I32_CLAMP_R:
- return NVPTX::SULD_2D_V4I32_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_V4I8_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_V4I8_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_V4I16_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_V4I16_CLAMP_I;
- case NVPTX::SULD_2D_ARRAY_V4I32_CLAMP_R:
- return NVPTX::SULD_2D_ARRAY_V4I32_CLAMP_I;
- case NVPTX::SULD_3D_V4I8_CLAMP_R:
- return NVPTX::SULD_3D_V4I8_CLAMP_I;
- case NVPTX::SULD_3D_V4I16_CLAMP_R:
- return NVPTX::SULD_3D_V4I16_CLAMP_I;
- case NVPTX::SULD_3D_V4I32_CLAMP_R:
- return NVPTX::SULD_3D_V4I32_CLAMP_I;
- case NVPTX::SULD_1D_I8_TRAP_R:
- return NVPTX::SULD_1D_I8_TRAP_I;
- case NVPTX::SULD_1D_I16_TRAP_R:
- return NVPTX::SULD_1D_I16_TRAP_I;
- case NVPTX::SULD_1D_I32_TRAP_R:
- return NVPTX::SULD_1D_I32_TRAP_I;
- case NVPTX::SULD_1D_I64_TRAP_R:
- return NVPTX::SULD_1D_I64_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_I8_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_I8_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_I16_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_I16_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_I32_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_I32_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_I64_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_I64_TRAP_I;
- case NVPTX::SULD_2D_I8_TRAP_R:
- return NVPTX::SULD_2D_I8_TRAP_I;
- case NVPTX::SULD_2D_I16_TRAP_R:
- return NVPTX::SULD_2D_I16_TRAP_I;
- case NVPTX::SULD_2D_I32_TRAP_R:
- return NVPTX::SULD_2D_I32_TRAP_I;
- case NVPTX::SULD_2D_I64_TRAP_R:
- return NVPTX::SULD_2D_I64_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_I8_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_I8_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_I16_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_I16_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_I32_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_I32_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_I64_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_I64_TRAP_I;
- case NVPTX::SULD_3D_I8_TRAP_R:
- return NVPTX::SULD_3D_I8_TRAP_I;
- case NVPTX::SULD_3D_I16_TRAP_R:
- return NVPTX::SULD_3D_I16_TRAP_I;
- case NVPTX::SULD_3D_I32_TRAP_R:
- return NVPTX::SULD_3D_I32_TRAP_I;
- case NVPTX::SULD_3D_I64_TRAP_R:
- return NVPTX::SULD_3D_I64_TRAP_I;
- case NVPTX::SULD_1D_V2I8_TRAP_R:
- return NVPTX::SULD_1D_V2I8_TRAP_I;
- case NVPTX::SULD_1D_V2I16_TRAP_R:
- return NVPTX::SULD_1D_V2I16_TRAP_I;
- case NVPTX::SULD_1D_V2I32_TRAP_R:
- return NVPTX::SULD_1D_V2I32_TRAP_I;
- case NVPTX::SULD_1D_V2I64_TRAP_R:
- return NVPTX::SULD_1D_V2I64_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_V2I8_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_V2I8_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_V2I16_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_V2I16_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_V2I32_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_V2I32_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_V2I64_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_V2I64_TRAP_I;
- case NVPTX::SULD_2D_V2I8_TRAP_R:
- return NVPTX::SULD_2D_V2I8_TRAP_I;
- case NVPTX::SULD_2D_V2I16_TRAP_R:
- return NVPTX::SULD_2D_V2I16_TRAP_I;
- case NVPTX::SULD_2D_V2I32_TRAP_R:
- return NVPTX::SULD_2D_V2I32_TRAP_I;
- case NVPTX::SULD_2D_V2I64_TRAP_R:
- return NVPTX::SULD_2D_V2I64_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_V2I8_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_V2I8_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_V2I16_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_V2I16_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_V2I32_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_V2I32_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_V2I64_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_V2I64_TRAP_I;
- case NVPTX::SULD_3D_V2I8_TRAP_R:
- return NVPTX::SULD_3D_V2I8_TRAP_I;
- case NVPTX::SULD_3D_V2I16_TRAP_R:
- return NVPTX::SULD_3D_V2I16_TRAP_I;
- case NVPTX::SULD_3D_V2I32_TRAP_R:
- return NVPTX::SULD_3D_V2I32_TRAP_I;
- case NVPTX::SULD_3D_V2I64_TRAP_R:
- return NVPTX::SULD_3D_V2I64_TRAP_I;
- case NVPTX::SULD_1D_V4I8_TRAP_R:
- return NVPTX::SULD_1D_V4I8_TRAP_I;
- case NVPTX::SULD_1D_V4I16_TRAP_R:
- return NVPTX::SULD_1D_V4I16_TRAP_I;
- case NVPTX::SULD_1D_V4I32_TRAP_R:
- return NVPTX::SULD_1D_V4I32_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_V4I8_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_V4I8_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_V4I16_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_V4I16_TRAP_I;
- case NVPTX::SULD_1D_ARRAY_V4I32_TRAP_R:
- return NVPTX::SULD_1D_ARRAY_V4I32_TRAP_I;
- case NVPTX::SULD_2D_V4I8_TRAP_R:
- return NVPTX::SULD_2D_V4I8_TRAP_I;
- case NVPTX::SULD_2D_V4I16_TRAP_R:
- return NVPTX::SULD_2D_V4I16_TRAP_I;
- case NVPTX::SULD_2D_V4I32_TRAP_R:
- return NVPTX::SULD_2D_V4I32_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_V4I8_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_V4I8_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_V4I16_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_V4I16_TRAP_I;
- case NVPTX::SULD_2D_ARRAY_V4I32_TRAP_R:
- return NVPTX::SULD_2D_ARRAY_V4I32_TRAP_I;
- case NVPTX::SULD_3D_V4I8_TRAP_R:
- return NVPTX::SULD_3D_V4I8_TRAP_I;
- case NVPTX::SULD_3D_V4I16_TRAP_R:
- return NVPTX::SULD_3D_V4I16_TRAP_I;
- case NVPTX::SULD_3D_V4I32_TRAP_R:
- return NVPTX::SULD_3D_V4I32_TRAP_I;
- case NVPTX::SULD_1D_I8_ZERO_R:
- return NVPTX::SULD_1D_I8_ZERO_I;
- case NVPTX::SULD_1D_I16_ZERO_R:
- return NVPTX::SULD_1D_I16_ZERO_I;
- case NVPTX::SULD_1D_I32_ZERO_R:
- return NVPTX::SULD_1D_I32_ZERO_I;
- case NVPTX::SULD_1D_I64_ZERO_R:
- return NVPTX::SULD_1D_I64_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_I8_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_I8_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_I16_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_I16_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_I32_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_I32_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_I64_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_I64_ZERO_I;
- case NVPTX::SULD_2D_I8_ZERO_R:
- return NVPTX::SULD_2D_I8_ZERO_I;
- case NVPTX::SULD_2D_I16_ZERO_R:
- return NVPTX::SULD_2D_I16_ZERO_I;
- case NVPTX::SULD_2D_I32_ZERO_R:
- return NVPTX::SULD_2D_I32_ZERO_I;
- case NVPTX::SULD_2D_I64_ZERO_R:
- return NVPTX::SULD_2D_I64_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_I8_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_I8_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_I16_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_I16_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_I32_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_I32_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_I64_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_I64_ZERO_I;
- case NVPTX::SULD_3D_I8_ZERO_R:
- return NVPTX::SULD_3D_I8_ZERO_I;
- case NVPTX::SULD_3D_I16_ZERO_R:
- return NVPTX::SULD_3D_I16_ZERO_I;
- case NVPTX::SULD_3D_I32_ZERO_R:
- return NVPTX::SULD_3D_I32_ZERO_I;
- case NVPTX::SULD_3D_I64_ZERO_R:
- return NVPTX::SULD_3D_I64_ZERO_I;
- case NVPTX::SULD_1D_V2I8_ZERO_R:
- return NVPTX::SULD_1D_V2I8_ZERO_I;
- case NVPTX::SULD_1D_V2I16_ZERO_R:
- return NVPTX::SULD_1D_V2I16_ZERO_I;
- case NVPTX::SULD_1D_V2I32_ZERO_R:
- return NVPTX::SULD_1D_V2I32_ZERO_I;
- case NVPTX::SULD_1D_V2I64_ZERO_R:
- return NVPTX::SULD_1D_V2I64_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_V2I8_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_V2I8_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_V2I16_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_V2I16_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_V2I32_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_V2I32_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_V2I64_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_V2I64_ZERO_I;
- case NVPTX::SULD_2D_V2I8_ZERO_R:
- return NVPTX::SULD_2D_V2I8_ZERO_I;
- case NVPTX::SULD_2D_V2I16_ZERO_R:
- return NVPTX::SULD_2D_V2I16_ZERO_I;
- case NVPTX::SULD_2D_V2I32_ZERO_R:
- return NVPTX::SULD_2D_V2I32_ZERO_I;
- case NVPTX::SULD_2D_V2I64_ZERO_R:
- return NVPTX::SULD_2D_V2I64_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_V2I8_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_V2I8_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_V2I16_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_V2I16_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_V2I32_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_V2I32_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_V2I64_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_V2I64_ZERO_I;
- case NVPTX::SULD_3D_V2I8_ZERO_R:
- return NVPTX::SULD_3D_V2I8_ZERO_I;
- case NVPTX::SULD_3D_V2I16_ZERO_R:
- return NVPTX::SULD_3D_V2I16_ZERO_I;
- case NVPTX::SULD_3D_V2I32_ZERO_R:
- return NVPTX::SULD_3D_V2I32_ZERO_I;
- case NVPTX::SULD_3D_V2I64_ZERO_R:
- return NVPTX::SULD_3D_V2I64_ZERO_I;
- case NVPTX::SULD_1D_V4I8_ZERO_R:
- return NVPTX::SULD_1D_V4I8_ZERO_I;
- case NVPTX::SULD_1D_V4I16_ZERO_R:
- return NVPTX::SULD_1D_V4I16_ZERO_I;
- case NVPTX::SULD_1D_V4I32_ZERO_R:
- return NVPTX::SULD_1D_V4I32_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_V4I8_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_V4I8_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_V4I16_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_V4I16_ZERO_I;
- case NVPTX::SULD_1D_ARRAY_V4I32_ZERO_R:
- return NVPTX::SULD_1D_ARRAY_V4I32_ZERO_I;
- case NVPTX::SULD_2D_V4I8_ZERO_R:
- return NVPTX::SULD_2D_V4I8_ZERO_I;
- case NVPTX::SULD_2D_V4I16_ZERO_R:
- return NVPTX::SULD_2D_V4I16_ZERO_I;
- case NVPTX::SULD_2D_V4I32_ZERO_R:
- return NVPTX::SULD_2D_V4I32_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_V4I8_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_V4I8_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_V4I16_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_V4I16_ZERO_I;
- case NVPTX::SULD_2D_ARRAY_V4I32_ZERO_R:
- return NVPTX::SULD_2D_ARRAY_V4I32_ZERO_I;
- case NVPTX::SULD_3D_V4I8_ZERO_R:
- return NVPTX::SULD_3D_V4I8_ZERO_I;
- case NVPTX::SULD_3D_V4I16_ZERO_R:
- return NVPTX::SULD_3D_V4I16_ZERO_I;
- case NVPTX::SULD_3D_V4I32_ZERO_R:
- return NVPTX::SULD_3D_V4I32_ZERO_I;
- default:
- llvm_unreachable("Unhandled SULD opcode");
- }
- }
- static unsigned sustRegisterToIndexOpcode(unsigned RegOC) {
- switch (RegOC) {
- case NVPTX::SUST_B_1D_B8_CLAMP_R:
- return NVPTX::SUST_B_1D_B8_CLAMP_I;
- case NVPTX::SUST_B_1D_B16_CLAMP_R:
- return NVPTX::SUST_B_1D_B16_CLAMP_I;
- case NVPTX::SUST_B_1D_B32_CLAMP_R:
- return NVPTX::SUST_B_1D_B32_CLAMP_I;
- case NVPTX::SUST_B_1D_B64_CLAMP_R:
- return NVPTX::SUST_B_1D_B64_CLAMP_I;
- case NVPTX::SUST_B_1D_V2B8_CLAMP_R:
- return NVPTX::SUST_B_1D_V2B8_CLAMP_I;
- case NVPTX::SUST_B_1D_V2B16_CLAMP_R:
- return NVPTX::SUST_B_1D_V2B16_CLAMP_I;
- case NVPTX::SUST_B_1D_V2B32_CLAMP_R:
- return NVPTX::SUST_B_1D_V2B32_CLAMP_I;
- case NVPTX::SUST_B_1D_V2B64_CLAMP_R:
- return NVPTX::SUST_B_1D_V2B64_CLAMP_I;
- case NVPTX::SUST_B_1D_V4B8_CLAMP_R:
- return NVPTX::SUST_B_1D_V4B8_CLAMP_I;
- case NVPTX::SUST_B_1D_V4B16_CLAMP_R:
- return NVPTX::SUST_B_1D_V4B16_CLAMP_I;
- case NVPTX::SUST_B_1D_V4B32_CLAMP_R:
- return NVPTX::SUST_B_1D_V4B32_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_B8_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_B8_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_B16_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_B16_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_B32_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_B32_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_B64_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_B64_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B8_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B8_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B16_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B16_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B32_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B32_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B64_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B64_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B8_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B8_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B16_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B16_CLAMP_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B32_CLAMP_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B32_CLAMP_I;
- case NVPTX::SUST_B_2D_B8_CLAMP_R:
- return NVPTX::SUST_B_2D_B8_CLAMP_I;
- case NVPTX::SUST_B_2D_B16_CLAMP_R:
- return NVPTX::SUST_B_2D_B16_CLAMP_I;
- case NVPTX::SUST_B_2D_B32_CLAMP_R:
- return NVPTX::SUST_B_2D_B32_CLAMP_I;
- case NVPTX::SUST_B_2D_B64_CLAMP_R:
- return NVPTX::SUST_B_2D_B64_CLAMP_I;
- case NVPTX::SUST_B_2D_V2B8_CLAMP_R:
- return NVPTX::SUST_B_2D_V2B8_CLAMP_I;
- case NVPTX::SUST_B_2D_V2B16_CLAMP_R:
- return NVPTX::SUST_B_2D_V2B16_CLAMP_I;
- case NVPTX::SUST_B_2D_V2B32_CLAMP_R:
- return NVPTX::SUST_B_2D_V2B32_CLAMP_I;
- case NVPTX::SUST_B_2D_V2B64_CLAMP_R:
- return NVPTX::SUST_B_2D_V2B64_CLAMP_I;
- case NVPTX::SUST_B_2D_V4B8_CLAMP_R:
- return NVPTX::SUST_B_2D_V4B8_CLAMP_I;
- case NVPTX::SUST_B_2D_V4B16_CLAMP_R:
- return NVPTX::SUST_B_2D_V4B16_CLAMP_I;
- case NVPTX::SUST_B_2D_V4B32_CLAMP_R:
- return NVPTX::SUST_B_2D_V4B32_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_B8_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_B8_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_B16_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_B16_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_B32_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_B32_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_B64_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_B64_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B8_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B8_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B16_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B16_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B32_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B32_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B64_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B64_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B8_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B8_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B16_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B16_CLAMP_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B32_CLAMP_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B32_CLAMP_I;
- case NVPTX::SUST_B_3D_B8_CLAMP_R:
- return NVPTX::SUST_B_3D_B8_CLAMP_I;
- case NVPTX::SUST_B_3D_B16_CLAMP_R:
- return NVPTX::SUST_B_3D_B16_CLAMP_I;
- case NVPTX::SUST_B_3D_B32_CLAMP_R:
- return NVPTX::SUST_B_3D_B32_CLAMP_I;
- case NVPTX::SUST_B_3D_B64_CLAMP_R:
- return NVPTX::SUST_B_3D_B64_CLAMP_I;
- case NVPTX::SUST_B_3D_V2B8_CLAMP_R:
- return NVPTX::SUST_B_3D_V2B8_CLAMP_I;
- case NVPTX::SUST_B_3D_V2B16_CLAMP_R:
- return NVPTX::SUST_B_3D_V2B16_CLAMP_I;
- case NVPTX::SUST_B_3D_V2B32_CLAMP_R:
- return NVPTX::SUST_B_3D_V2B32_CLAMP_I;
- case NVPTX::SUST_B_3D_V2B64_CLAMP_R:
- return NVPTX::SUST_B_3D_V2B64_CLAMP_I;
- case NVPTX::SUST_B_3D_V4B8_CLAMP_R:
- return NVPTX::SUST_B_3D_V4B8_CLAMP_I;
- case NVPTX::SUST_B_3D_V4B16_CLAMP_R:
- return NVPTX::SUST_B_3D_V4B16_CLAMP_I;
- case NVPTX::SUST_B_3D_V4B32_CLAMP_R:
- return NVPTX::SUST_B_3D_V4B32_CLAMP_I;
- case NVPTX::SUST_B_1D_B8_TRAP_R:
- return NVPTX::SUST_B_1D_B8_TRAP_I;
- case NVPTX::SUST_B_1D_B16_TRAP_R:
- return NVPTX::SUST_B_1D_B16_TRAP_I;
- case NVPTX::SUST_B_1D_B32_TRAP_R:
- return NVPTX::SUST_B_1D_B32_TRAP_I;
- case NVPTX::SUST_B_1D_B64_TRAP_R:
- return NVPTX::SUST_B_1D_B64_TRAP_I;
- case NVPTX::SUST_B_1D_V2B8_TRAP_R:
- return NVPTX::SUST_B_1D_V2B8_TRAP_I;
- case NVPTX::SUST_B_1D_V2B16_TRAP_R:
- return NVPTX::SUST_B_1D_V2B16_TRAP_I;
- case NVPTX::SUST_B_1D_V2B32_TRAP_R:
- return NVPTX::SUST_B_1D_V2B32_TRAP_I;
- case NVPTX::SUST_B_1D_V2B64_TRAP_R:
- return NVPTX::SUST_B_1D_V2B64_TRAP_I;
- case NVPTX::SUST_B_1D_V4B8_TRAP_R:
- return NVPTX::SUST_B_1D_V4B8_TRAP_I;
- case NVPTX::SUST_B_1D_V4B16_TRAP_R:
- return NVPTX::SUST_B_1D_V4B16_TRAP_I;
- case NVPTX::SUST_B_1D_V4B32_TRAP_R:
- return NVPTX::SUST_B_1D_V4B32_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_B8_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_B8_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_B16_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_B16_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_B32_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_B32_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_B64_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_B64_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B8_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B8_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B16_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B16_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B32_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B32_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B64_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B64_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B8_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B8_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B16_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B16_TRAP_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B32_TRAP_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B32_TRAP_I;
- case NVPTX::SUST_B_2D_B8_TRAP_R:
- return NVPTX::SUST_B_2D_B8_TRAP_I;
- case NVPTX::SUST_B_2D_B16_TRAP_R:
- return NVPTX::SUST_B_2D_B16_TRAP_I;
- case NVPTX::SUST_B_2D_B32_TRAP_R:
- return NVPTX::SUST_B_2D_B32_TRAP_I;
- case NVPTX::SUST_B_2D_B64_TRAP_R:
- return NVPTX::SUST_B_2D_B64_TRAP_I;
- case NVPTX::SUST_B_2D_V2B8_TRAP_R:
- return NVPTX::SUST_B_2D_V2B8_TRAP_I;
- case NVPTX::SUST_B_2D_V2B16_TRAP_R:
- return NVPTX::SUST_B_2D_V2B16_TRAP_I;
- case NVPTX::SUST_B_2D_V2B32_TRAP_R:
- return NVPTX::SUST_B_2D_V2B32_TRAP_I;
- case NVPTX::SUST_B_2D_V2B64_TRAP_R:
- return NVPTX::SUST_B_2D_V2B64_TRAP_I;
- case NVPTX::SUST_B_2D_V4B8_TRAP_R:
- return NVPTX::SUST_B_2D_V4B8_TRAP_I;
- case NVPTX::SUST_B_2D_V4B16_TRAP_R:
- return NVPTX::SUST_B_2D_V4B16_TRAP_I;
- case NVPTX::SUST_B_2D_V4B32_TRAP_R:
- return NVPTX::SUST_B_2D_V4B32_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_B8_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_B8_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_B16_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_B16_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_B32_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_B32_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_B64_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_B64_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B8_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B8_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B16_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B16_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B32_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B32_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B64_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B64_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B8_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B8_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B16_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B16_TRAP_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B32_TRAP_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B32_TRAP_I;
- case NVPTX::SUST_B_3D_B8_TRAP_R:
- return NVPTX::SUST_B_3D_B8_TRAP_I;
- case NVPTX::SUST_B_3D_B16_TRAP_R:
- return NVPTX::SUST_B_3D_B16_TRAP_I;
- case NVPTX::SUST_B_3D_B32_TRAP_R:
- return NVPTX::SUST_B_3D_B32_TRAP_I;
- case NVPTX::SUST_B_3D_B64_TRAP_R:
- return NVPTX::SUST_B_3D_B64_TRAP_I;
- case NVPTX::SUST_B_3D_V2B8_TRAP_R:
- return NVPTX::SUST_B_3D_V2B8_TRAP_I;
- case NVPTX::SUST_B_3D_V2B16_TRAP_R:
- return NVPTX::SUST_B_3D_V2B16_TRAP_I;
- case NVPTX::SUST_B_3D_V2B32_TRAP_R:
- return NVPTX::SUST_B_3D_V2B32_TRAP_I;
- case NVPTX::SUST_B_3D_V2B64_TRAP_R:
- return NVPTX::SUST_B_3D_V2B64_TRAP_I;
- case NVPTX::SUST_B_3D_V4B8_TRAP_R:
- return NVPTX::SUST_B_3D_V4B8_TRAP_I;
- case NVPTX::SUST_B_3D_V4B16_TRAP_R:
- return NVPTX::SUST_B_3D_V4B16_TRAP_I;
- case NVPTX::SUST_B_3D_V4B32_TRAP_R:
- return NVPTX::SUST_B_3D_V4B32_TRAP_I;
- case NVPTX::SUST_B_1D_B8_ZERO_R:
- return NVPTX::SUST_B_1D_B8_ZERO_I;
- case NVPTX::SUST_B_1D_B16_ZERO_R:
- return NVPTX::SUST_B_1D_B16_ZERO_I;
- case NVPTX::SUST_B_1D_B32_ZERO_R:
- return NVPTX::SUST_B_1D_B32_ZERO_I;
- case NVPTX::SUST_B_1D_B64_ZERO_R:
- return NVPTX::SUST_B_1D_B64_ZERO_I;
- case NVPTX::SUST_B_1D_V2B8_ZERO_R:
- return NVPTX::SUST_B_1D_V2B8_ZERO_I;
- case NVPTX::SUST_B_1D_V2B16_ZERO_R:
- return NVPTX::SUST_B_1D_V2B16_ZERO_I;
- case NVPTX::SUST_B_1D_V2B32_ZERO_R:
- return NVPTX::SUST_B_1D_V2B32_ZERO_I;
- case NVPTX::SUST_B_1D_V2B64_ZERO_R:
- return NVPTX::SUST_B_1D_V2B64_ZERO_I;
- case NVPTX::SUST_B_1D_V4B8_ZERO_R:
- return NVPTX::SUST_B_1D_V4B8_ZERO_I;
- case NVPTX::SUST_B_1D_V4B16_ZERO_R:
- return NVPTX::SUST_B_1D_V4B16_ZERO_I;
- case NVPTX::SUST_B_1D_V4B32_ZERO_R:
- return NVPTX::SUST_B_1D_V4B32_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_B8_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_B8_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_B16_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_B16_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_B32_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_B32_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_B64_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_B64_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B8_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B8_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B16_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B16_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B32_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B32_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_V2B64_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_V2B64_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B8_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B8_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B16_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B16_ZERO_I;
- case NVPTX::SUST_B_1D_ARRAY_V4B32_ZERO_R:
- return NVPTX::SUST_B_1D_ARRAY_V4B32_ZERO_I;
- case NVPTX::SUST_B_2D_B8_ZERO_R:
- return NVPTX::SUST_B_2D_B8_ZERO_I;
- case NVPTX::SUST_B_2D_B16_ZERO_R:
- return NVPTX::SUST_B_2D_B16_ZERO_I;
- case NVPTX::SUST_B_2D_B32_ZERO_R:
- return NVPTX::SUST_B_2D_B32_ZERO_I;
- case NVPTX::SUST_B_2D_B64_ZERO_R:
- return NVPTX::SUST_B_2D_B64_ZERO_I;
- case NVPTX::SUST_B_2D_V2B8_ZERO_R:
- return NVPTX::SUST_B_2D_V2B8_ZERO_I;
- case NVPTX::SUST_B_2D_V2B16_ZERO_R:
- return NVPTX::SUST_B_2D_V2B16_ZERO_I;
- case NVPTX::SUST_B_2D_V2B32_ZERO_R:
- return NVPTX::SUST_B_2D_V2B32_ZERO_I;
- case NVPTX::SUST_B_2D_V2B64_ZERO_R:
- return NVPTX::SUST_B_2D_V2B64_ZERO_I;
- case NVPTX::SUST_B_2D_V4B8_ZERO_R:
- return NVPTX::SUST_B_2D_V4B8_ZERO_I;
- case NVPTX::SUST_B_2D_V4B16_ZERO_R:
- return NVPTX::SUST_B_2D_V4B16_ZERO_I;
- case NVPTX::SUST_B_2D_V4B32_ZERO_R:
- return NVPTX::SUST_B_2D_V4B32_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_B8_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_B8_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_B16_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_B16_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_B32_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_B32_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_B64_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_B64_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B8_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B8_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B16_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B16_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B32_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B32_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_V2B64_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_V2B64_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B8_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B8_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B16_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B16_ZERO_I;
- case NVPTX::SUST_B_2D_ARRAY_V4B32_ZERO_R:
- return NVPTX::SUST_B_2D_ARRAY_V4B32_ZERO_I;
- case NVPTX::SUST_B_3D_B8_ZERO_R:
- return NVPTX::SUST_B_3D_B8_ZERO_I;
- case NVPTX::SUST_B_3D_B16_ZERO_R:
- return NVPTX::SUST_B_3D_B16_ZERO_I;
- case NVPTX::SUST_B_3D_B32_ZERO_R:
- return NVPTX::SUST_B_3D_B32_ZERO_I;
- case NVPTX::SUST_B_3D_B64_ZERO_R:
- return NVPTX::SUST_B_3D_B64_ZERO_I;
- case NVPTX::SUST_B_3D_V2B8_ZERO_R:
- return NVPTX::SUST_B_3D_V2B8_ZERO_I;
- case NVPTX::SUST_B_3D_V2B16_ZERO_R:
- return NVPTX::SUST_B_3D_V2B16_ZERO_I;
- case NVPTX::SUST_B_3D_V2B32_ZERO_R:
- return NVPTX::SUST_B_3D_V2B32_ZERO_I;
- case NVPTX::SUST_B_3D_V2B64_ZERO_R:
- return NVPTX::SUST_B_3D_V2B64_ZERO_I;
- case NVPTX::SUST_B_3D_V4B8_ZERO_R:
- return NVPTX::SUST_B_3D_V4B8_ZERO_I;
- case NVPTX::SUST_B_3D_V4B16_ZERO_R:
- return NVPTX::SUST_B_3D_V4B16_ZERO_I;
- case NVPTX::SUST_B_3D_V4B32_ZERO_R:
- return NVPTX::SUST_B_3D_V4B32_ZERO_I;
- case NVPTX::SUST_P_1D_B8_TRAP_R:
- return NVPTX::SUST_P_1D_B8_TRAP_I;
- case NVPTX::SUST_P_1D_B16_TRAP_R:
- return NVPTX::SUST_P_1D_B16_TRAP_I;
- case NVPTX::SUST_P_1D_B32_TRAP_R:
- return NVPTX::SUST_P_1D_B32_TRAP_I;
- case NVPTX::SUST_P_1D_V2B8_TRAP_R:
- return NVPTX::SUST_P_1D_V2B8_TRAP_I;
- case NVPTX::SUST_P_1D_V2B16_TRAP_R:
- return NVPTX::SUST_P_1D_V2B16_TRAP_I;
- case NVPTX::SUST_P_1D_V2B32_TRAP_R:
- return NVPTX::SUST_P_1D_V2B32_TRAP_I;
- case NVPTX::SUST_P_1D_V4B8_TRAP_R:
- return NVPTX::SUST_P_1D_V4B8_TRAP_I;
- case NVPTX::SUST_P_1D_V4B16_TRAP_R:
- return NVPTX::SUST_P_1D_V4B16_TRAP_I;
- case NVPTX::SUST_P_1D_V4B32_TRAP_R:
- return NVPTX::SUST_P_1D_V4B32_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_B8_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_B8_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_B16_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_B16_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_B32_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_B32_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_V2B8_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_V2B8_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_V2B16_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_V2B16_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_V2B32_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_V2B32_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_V4B8_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_V4B8_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_V4B16_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_V4B16_TRAP_I;
- case NVPTX::SUST_P_1D_ARRAY_V4B32_TRAP_R:
- return NVPTX::SUST_P_1D_ARRAY_V4B32_TRAP_I;
- case NVPTX::SUST_P_2D_B8_TRAP_R:
- return NVPTX::SUST_P_2D_B8_TRAP_I;
- case NVPTX::SUST_P_2D_B16_TRAP_R:
- return NVPTX::SUST_P_2D_B16_TRAP_I;
- case NVPTX::SUST_P_2D_B32_TRAP_R:
- return NVPTX::SUST_P_2D_B32_TRAP_I;
- case NVPTX::SUST_P_2D_V2B8_TRAP_R:
- return NVPTX::SUST_P_2D_V2B8_TRAP_I;
- case NVPTX::SUST_P_2D_V2B16_TRAP_R:
- return NVPTX::SUST_P_2D_V2B16_TRAP_I;
- case NVPTX::SUST_P_2D_V2B32_TRAP_R:
- return NVPTX::SUST_P_2D_V2B32_TRAP_I;
- case NVPTX::SUST_P_2D_V4B8_TRAP_R:
- return NVPTX::SUST_P_2D_V4B8_TRAP_I;
- case NVPTX::SUST_P_2D_V4B16_TRAP_R:
- return NVPTX::SUST_P_2D_V4B16_TRAP_I;
- case NVPTX::SUST_P_2D_V4B32_TRAP_R:
- return NVPTX::SUST_P_2D_V4B32_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_B8_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_B8_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_B16_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_B16_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_B32_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_B32_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_V2B8_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_V2B8_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_V2B16_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_V2B16_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_V2B32_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_V2B32_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_V4B8_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_V4B8_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_V4B16_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_V4B16_TRAP_I;
- case NVPTX::SUST_P_2D_ARRAY_V4B32_TRAP_R:
- return NVPTX::SUST_P_2D_ARRAY_V4B32_TRAP_I;
- case NVPTX::SUST_P_3D_B8_TRAP_R:
- return NVPTX::SUST_P_3D_B8_TRAP_I;
- case NVPTX::SUST_P_3D_B16_TRAP_R:
- return NVPTX::SUST_P_3D_B16_TRAP_I;
- case NVPTX::SUST_P_3D_B32_TRAP_R:
- return NVPTX::SUST_P_3D_B32_TRAP_I;
- case NVPTX::SUST_P_3D_V2B8_TRAP_R:
- return NVPTX::SUST_P_3D_V2B8_TRAP_I;
- case NVPTX::SUST_P_3D_V2B16_TRAP_R:
- return NVPTX::SUST_P_3D_V2B16_TRAP_I;
- case NVPTX::SUST_P_3D_V2B32_TRAP_R:
- return NVPTX::SUST_P_3D_V2B32_TRAP_I;
- case NVPTX::SUST_P_3D_V4B8_TRAP_R:
- return NVPTX::SUST_P_3D_V4B8_TRAP_I;
- case NVPTX::SUST_P_3D_V4B16_TRAP_R:
- return NVPTX::SUST_P_3D_V4B16_TRAP_I;
- case NVPTX::SUST_P_3D_V4B32_TRAP_R:
- return NVPTX::SUST_P_3D_V4B32_TRAP_I;
- default:
- llvm_unreachable("Unhandled SUST opcode");
- }
- }
- static unsigned texRegisterToIndexOpcode(unsigned RegOC) {
- switch (RegOC) {
- case NVPTX::TEX_1D_F32_S32_RR:
- return NVPTX::TEX_1D_F32_S32_IR;
- case NVPTX::TEX_1D_F32_S32_RI:
- return NVPTX::TEX_1D_F32_S32_II;
- case NVPTX::TEX_1D_F32_F32_RR:
- return NVPTX::TEX_1D_F32_F32_IR;
- case NVPTX::TEX_1D_F32_F32_RI:
- return NVPTX::TEX_1D_F32_F32_II;
- case NVPTX::TEX_1D_F32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_F32_F32_LEVEL_IR;
- case NVPTX::TEX_1D_F32_F32_LEVEL_RI:
- return NVPTX::TEX_1D_F32_F32_LEVEL_II;
- case NVPTX::TEX_1D_F32_F32_GRAD_RR:
- return NVPTX::TEX_1D_F32_F32_GRAD_IR;
- case NVPTX::TEX_1D_F32_F32_GRAD_RI:
- return NVPTX::TEX_1D_F32_F32_GRAD_II;
- case NVPTX::TEX_1D_S32_S32_RR:
- return NVPTX::TEX_1D_S32_S32_IR;
- case NVPTX::TEX_1D_S32_S32_RI:
- return NVPTX::TEX_1D_S32_S32_II;
- case NVPTX::TEX_1D_S32_F32_RR:
- return NVPTX::TEX_1D_S32_F32_IR;
- case NVPTX::TEX_1D_S32_F32_RI:
- return NVPTX::TEX_1D_S32_F32_II;
- case NVPTX::TEX_1D_S32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_S32_F32_LEVEL_IR;
- case NVPTX::TEX_1D_S32_F32_LEVEL_RI:
- return NVPTX::TEX_1D_S32_F32_LEVEL_II;
- case NVPTX::TEX_1D_S32_F32_GRAD_RR:
- return NVPTX::TEX_1D_S32_F32_GRAD_IR;
- case NVPTX::TEX_1D_S32_F32_GRAD_RI:
- return NVPTX::TEX_1D_S32_F32_GRAD_II;
- case NVPTX::TEX_1D_U32_S32_RR:
- return NVPTX::TEX_1D_U32_S32_IR;
- case NVPTX::TEX_1D_U32_S32_RI:
- return NVPTX::TEX_1D_U32_S32_II;
- case NVPTX::TEX_1D_U32_F32_RR:
- return NVPTX::TEX_1D_U32_F32_IR;
- case NVPTX::TEX_1D_U32_F32_RI:
- return NVPTX::TEX_1D_U32_F32_II;
- case NVPTX::TEX_1D_U32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_U32_F32_LEVEL_IR;
- case NVPTX::TEX_1D_U32_F32_LEVEL_RI:
- return NVPTX::TEX_1D_U32_F32_LEVEL_II;
- case NVPTX::TEX_1D_U32_F32_GRAD_RR:
- return NVPTX::TEX_1D_U32_F32_GRAD_IR;
- case NVPTX::TEX_1D_U32_F32_GRAD_RI:
- return NVPTX::TEX_1D_U32_F32_GRAD_II;
- case NVPTX::TEX_1D_ARRAY_F32_S32_RR:
- return NVPTX::TEX_1D_ARRAY_F32_S32_IR;
- case NVPTX::TEX_1D_ARRAY_F32_S32_RI:
- return NVPTX::TEX_1D_ARRAY_F32_S32_II;
- case NVPTX::TEX_1D_ARRAY_F32_F32_RR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_IR;
- case NVPTX::TEX_1D_ARRAY_F32_F32_RI:
- return NVPTX::TEX_1D_ARRAY_F32_F32_II;
- case NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_IR;
- case NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_RI:
- return NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_II;
- case NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_RR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_IR;
- case NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_RI:
- return NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_II;
- case NVPTX::TEX_1D_ARRAY_S32_S32_RR:
- return NVPTX::TEX_1D_ARRAY_S32_S32_IR;
- case NVPTX::TEX_1D_ARRAY_S32_S32_RI:
- return NVPTX::TEX_1D_ARRAY_S32_S32_II;
- case NVPTX::TEX_1D_ARRAY_S32_F32_RR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_IR;
- case NVPTX::TEX_1D_ARRAY_S32_F32_RI:
- return NVPTX::TEX_1D_ARRAY_S32_F32_II;
- case NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_IR;
- case NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_RI:
- return NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_II;
- case NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_RR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_IR;
- case NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_RI:
- return NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_II;
- case NVPTX::TEX_1D_ARRAY_U32_S32_RR:
- return NVPTX::TEX_1D_ARRAY_U32_S32_IR;
- case NVPTX::TEX_1D_ARRAY_U32_S32_RI:
- return NVPTX::TEX_1D_ARRAY_U32_S32_II;
- case NVPTX::TEX_1D_ARRAY_U32_F32_RR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_IR;
- case NVPTX::TEX_1D_ARRAY_U32_F32_RI:
- return NVPTX::TEX_1D_ARRAY_U32_F32_II;
- case NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_IR;
- case NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_RI:
- return NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_II;
- case NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_RR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_IR;
- case NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_RI:
- return NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_II;
- case NVPTX::TEX_2D_F32_S32_RR:
- return NVPTX::TEX_2D_F32_S32_IR;
- case NVPTX::TEX_2D_F32_S32_RI:
- return NVPTX::TEX_2D_F32_S32_II;
- case NVPTX::TEX_2D_F32_F32_RR:
- return NVPTX::TEX_2D_F32_F32_IR;
- case NVPTX::TEX_2D_F32_F32_RI:
- return NVPTX::TEX_2D_F32_F32_II;
- case NVPTX::TEX_2D_F32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_F32_F32_LEVEL_IR;
- case NVPTX::TEX_2D_F32_F32_LEVEL_RI:
- return NVPTX::TEX_2D_F32_F32_LEVEL_II;
- case NVPTX::TEX_2D_F32_F32_GRAD_RR:
- return NVPTX::TEX_2D_F32_F32_GRAD_IR;
- case NVPTX::TEX_2D_F32_F32_GRAD_RI:
- return NVPTX::TEX_2D_F32_F32_GRAD_II;
- case NVPTX::TEX_2D_S32_S32_RR:
- return NVPTX::TEX_2D_S32_S32_IR;
- case NVPTX::TEX_2D_S32_S32_RI:
- return NVPTX::TEX_2D_S32_S32_II;
- case NVPTX::TEX_2D_S32_F32_RR:
- return NVPTX::TEX_2D_S32_F32_IR;
- case NVPTX::TEX_2D_S32_F32_RI:
- return NVPTX::TEX_2D_S32_F32_II;
- case NVPTX::TEX_2D_S32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_S32_F32_LEVEL_IR;
- case NVPTX::TEX_2D_S32_F32_LEVEL_RI:
- return NVPTX::TEX_2D_S32_F32_LEVEL_II;
- case NVPTX::TEX_2D_S32_F32_GRAD_RR:
- return NVPTX::TEX_2D_S32_F32_GRAD_IR;
- case NVPTX::TEX_2D_S32_F32_GRAD_RI:
- return NVPTX::TEX_2D_S32_F32_GRAD_II;
- case NVPTX::TEX_2D_U32_S32_RR:
- return NVPTX::TEX_2D_U32_S32_IR;
- case NVPTX::TEX_2D_U32_S32_RI:
- return NVPTX::TEX_2D_U32_S32_II;
- case NVPTX::TEX_2D_U32_F32_RR:
- return NVPTX::TEX_2D_U32_F32_IR;
- case NVPTX::TEX_2D_U32_F32_RI:
- return NVPTX::TEX_2D_U32_F32_II;
- case NVPTX::TEX_2D_U32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_U32_F32_LEVEL_IR;
- case NVPTX::TEX_2D_U32_F32_LEVEL_RI:
- return NVPTX::TEX_2D_U32_F32_LEVEL_II;
- case NVPTX::TEX_2D_U32_F32_GRAD_RR:
- return NVPTX::TEX_2D_U32_F32_GRAD_IR;
- case NVPTX::TEX_2D_U32_F32_GRAD_RI:
- return NVPTX::TEX_2D_U32_F32_GRAD_II;
- case NVPTX::TEX_2D_ARRAY_F32_S32_RR:
- return NVPTX::TEX_2D_ARRAY_F32_S32_IR;
- case NVPTX::TEX_2D_ARRAY_F32_S32_RI:
- return NVPTX::TEX_2D_ARRAY_F32_S32_II;
- case NVPTX::TEX_2D_ARRAY_F32_F32_RR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_IR;
- case NVPTX::TEX_2D_ARRAY_F32_F32_RI:
- return NVPTX::TEX_2D_ARRAY_F32_F32_II;
- case NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_IR;
- case NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_RI:
- return NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_II;
- case NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_RR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_IR;
- case NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_RI:
- return NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_II;
- case NVPTX::TEX_2D_ARRAY_S32_S32_RR:
- return NVPTX::TEX_2D_ARRAY_S32_S32_IR;
- case NVPTX::TEX_2D_ARRAY_S32_S32_RI:
- return NVPTX::TEX_2D_ARRAY_S32_S32_II;
- case NVPTX::TEX_2D_ARRAY_S32_F32_RR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_IR;
- case NVPTX::TEX_2D_ARRAY_S32_F32_RI:
- return NVPTX::TEX_2D_ARRAY_S32_F32_II;
- case NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_IR;
- case NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_RI:
- return NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_II;
- case NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_RR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_IR;
- case NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_RI:
- return NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_II;
- case NVPTX::TEX_2D_ARRAY_U32_S32_RR:
- return NVPTX::TEX_2D_ARRAY_U32_S32_IR;
- case NVPTX::TEX_2D_ARRAY_U32_S32_RI:
- return NVPTX::TEX_2D_ARRAY_U32_S32_II;
- case NVPTX::TEX_2D_ARRAY_U32_F32_RR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_IR;
- case NVPTX::TEX_2D_ARRAY_U32_F32_RI:
- return NVPTX::TEX_2D_ARRAY_U32_F32_II;
- case NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_IR;
- case NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_RI:
- return NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_II;
- case NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_RR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_IR;
- case NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_RI:
- return NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_II;
- case NVPTX::TEX_3D_F32_S32_RR:
- return NVPTX::TEX_3D_F32_S32_IR;
- case NVPTX::TEX_3D_F32_S32_RI:
- return NVPTX::TEX_3D_F32_S32_II;
- case NVPTX::TEX_3D_F32_F32_RR:
- return NVPTX::TEX_3D_F32_F32_IR;
- case NVPTX::TEX_3D_F32_F32_RI:
- return NVPTX::TEX_3D_F32_F32_II;
- case NVPTX::TEX_3D_F32_F32_LEVEL_RR:
- return NVPTX::TEX_3D_F32_F32_LEVEL_IR;
- case NVPTX::TEX_3D_F32_F32_LEVEL_RI:
- return NVPTX::TEX_3D_F32_F32_LEVEL_II;
- case NVPTX::TEX_3D_F32_F32_GRAD_RR:
- return NVPTX::TEX_3D_F32_F32_GRAD_IR;
- case NVPTX::TEX_3D_F32_F32_GRAD_RI:
- return NVPTX::TEX_3D_F32_F32_GRAD_II;
- case NVPTX::TEX_3D_S32_S32_RR:
- return NVPTX::TEX_3D_S32_S32_IR;
- case NVPTX::TEX_3D_S32_S32_RI:
- return NVPTX::TEX_3D_S32_S32_II;
- case NVPTX::TEX_3D_S32_F32_RR:
- return NVPTX::TEX_3D_S32_F32_IR;
- case NVPTX::TEX_3D_S32_F32_RI:
- return NVPTX::TEX_3D_S32_F32_II;
- case NVPTX::TEX_3D_S32_F32_LEVEL_RR:
- return NVPTX::TEX_3D_S32_F32_LEVEL_IR;
- case NVPTX::TEX_3D_S32_F32_LEVEL_RI:
- return NVPTX::TEX_3D_S32_F32_LEVEL_II;
- case NVPTX::TEX_3D_S32_F32_GRAD_RR:
- return NVPTX::TEX_3D_S32_F32_GRAD_IR;
- case NVPTX::TEX_3D_S32_F32_GRAD_RI:
- return NVPTX::TEX_3D_S32_F32_GRAD_II;
- case NVPTX::TEX_3D_U32_S32_RR:
- return NVPTX::TEX_3D_U32_S32_IR;
- case NVPTX::TEX_3D_U32_S32_RI:
- return NVPTX::TEX_3D_U32_S32_II;
- case NVPTX::TEX_3D_U32_F32_RR:
- return NVPTX::TEX_3D_U32_F32_IR;
- case NVPTX::TEX_3D_U32_F32_RI:
- return NVPTX::TEX_3D_U32_F32_II;
- case NVPTX::TEX_3D_U32_F32_LEVEL_RR:
- return NVPTX::TEX_3D_U32_F32_LEVEL_IR;
- case NVPTX::TEX_3D_U32_F32_LEVEL_RI:
- return NVPTX::TEX_3D_U32_F32_LEVEL_II;
- case NVPTX::TEX_3D_U32_F32_GRAD_RR:
- return NVPTX::TEX_3D_U32_F32_GRAD_IR;
- case NVPTX::TEX_3D_U32_F32_GRAD_RI:
- return NVPTX::TEX_3D_U32_F32_GRAD_II;
- case NVPTX::TEX_CUBE_F32_F32_RR:
- return NVPTX::TEX_CUBE_F32_F32_IR;
- case NVPTX::TEX_CUBE_F32_F32_RI:
- return NVPTX::TEX_CUBE_F32_F32_II;
- case NVPTX::TEX_CUBE_F32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_F32_F32_LEVEL_IR;
- case NVPTX::TEX_CUBE_F32_F32_LEVEL_RI:
- return NVPTX::TEX_CUBE_F32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_S32_F32_RR:
- return NVPTX::TEX_CUBE_S32_F32_IR;
- case NVPTX::TEX_CUBE_S32_F32_RI:
- return NVPTX::TEX_CUBE_S32_F32_II;
- case NVPTX::TEX_CUBE_S32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_S32_F32_LEVEL_IR;
- case NVPTX::TEX_CUBE_S32_F32_LEVEL_RI:
- return NVPTX::TEX_CUBE_S32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_U32_F32_RR:
- return NVPTX::TEX_CUBE_U32_F32_IR;
- case NVPTX::TEX_CUBE_U32_F32_RI:
- return NVPTX::TEX_CUBE_U32_F32_II;
- case NVPTX::TEX_CUBE_U32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_U32_F32_LEVEL_IR;
- case NVPTX::TEX_CUBE_U32_F32_LEVEL_RI:
- return NVPTX::TEX_CUBE_U32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_RR:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_IR;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_RI:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_II;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_IR;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_RI:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_RR:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_IR;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_RI:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_II;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_IR;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_RI:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_RR:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_IR;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_RI:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_II;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_IR;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_RI:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_II;
- case NVPTX::TLD4_R_2D_F32_F32_RR:
- return NVPTX::TLD4_R_2D_F32_F32_IR;
- case NVPTX::TLD4_R_2D_F32_F32_RI:
- return NVPTX::TLD4_R_2D_F32_F32_II;
- case NVPTX::TLD4_G_2D_F32_F32_RR:
- return NVPTX::TLD4_G_2D_F32_F32_IR;
- case NVPTX::TLD4_G_2D_F32_F32_RI:
- return NVPTX::TLD4_G_2D_F32_F32_II;
- case NVPTX::TLD4_B_2D_F32_F32_RR:
- return NVPTX::TLD4_B_2D_F32_F32_IR;
- case NVPTX::TLD4_B_2D_F32_F32_RI:
- return NVPTX::TLD4_B_2D_F32_F32_II;
- case NVPTX::TLD4_A_2D_F32_F32_RR:
- return NVPTX::TLD4_A_2D_F32_F32_IR;
- case NVPTX::TLD4_A_2D_F32_F32_RI:
- return NVPTX::TLD4_A_2D_F32_F32_II;
- case NVPTX::TLD4_R_2D_S32_F32_RR:
- return NVPTX::TLD4_R_2D_S32_F32_IR;
- case NVPTX::TLD4_R_2D_S32_F32_RI:
- return NVPTX::TLD4_R_2D_S32_F32_II;
- case NVPTX::TLD4_G_2D_S32_F32_RR:
- return NVPTX::TLD4_G_2D_S32_F32_IR;
- case NVPTX::TLD4_G_2D_S32_F32_RI:
- return NVPTX::TLD4_G_2D_S32_F32_II;
- case NVPTX::TLD4_B_2D_S32_F32_RR:
- return NVPTX::TLD4_B_2D_S32_F32_IR;
- case NVPTX::TLD4_B_2D_S32_F32_RI:
- return NVPTX::TLD4_B_2D_S32_F32_II;
- case NVPTX::TLD4_A_2D_S32_F32_RR:
- return NVPTX::TLD4_A_2D_S32_F32_IR;
- case NVPTX::TLD4_A_2D_S32_F32_RI:
- return NVPTX::TLD4_A_2D_S32_F32_II;
- case NVPTX::TLD4_R_2D_U32_F32_RR:
- return NVPTX::TLD4_R_2D_U32_F32_IR;
- case NVPTX::TLD4_R_2D_U32_F32_RI:
- return NVPTX::TLD4_R_2D_U32_F32_II;
- case NVPTX::TLD4_G_2D_U32_F32_RR:
- return NVPTX::TLD4_G_2D_U32_F32_IR;
- case NVPTX::TLD4_G_2D_U32_F32_RI:
- return NVPTX::TLD4_G_2D_U32_F32_II;
- case NVPTX::TLD4_B_2D_U32_F32_RR:
- return NVPTX::TLD4_B_2D_U32_F32_IR;
- case NVPTX::TLD4_B_2D_U32_F32_RI:
- return NVPTX::TLD4_B_2D_U32_F32_II;
- case NVPTX::TLD4_A_2D_U32_F32_RR:
- return NVPTX::TLD4_A_2D_U32_F32_IR;
- case NVPTX::TLD4_A_2D_U32_F32_RI:
- return NVPTX::TLD4_A_2D_U32_F32_II;
- case NVPTX::TEX_UNIFIED_1D_F32_S32_R:
- return NVPTX::TEX_UNIFIED_1D_F32_S32_I;
- case NVPTX::TEX_UNIFIED_1D_F32_F32_R:
- return NVPTX::TEX_UNIFIED_1D_F32_F32_I;
- case NVPTX::TEX_UNIFIED_1D_F32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_1D_F32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_1D_F32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_1D_F32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_1D_S32_S32_R:
- return NVPTX::TEX_UNIFIED_1D_S32_S32_I;
- case NVPTX::TEX_UNIFIED_1D_S32_F32_R:
- return NVPTX::TEX_UNIFIED_1D_S32_F32_I;
- case NVPTX::TEX_UNIFIED_1D_S32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_1D_S32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_1D_S32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_1D_S32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_1D_U32_S32_R:
- return NVPTX::TEX_UNIFIED_1D_U32_S32_I;
- case NVPTX::TEX_UNIFIED_1D_U32_F32_R:
- return NVPTX::TEX_UNIFIED_1D_U32_F32_I;
- case NVPTX::TEX_UNIFIED_1D_U32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_1D_U32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_1D_U32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_1D_U32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_F32_S32_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_F32_S32_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_F32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_S32_S32_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_S32_S32_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_S32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_U32_S32_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_U32_S32_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_1D_ARRAY_U32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_2D_F32_S32_R:
- return NVPTX::TEX_UNIFIED_2D_F32_S32_I;
- case NVPTX::TEX_UNIFIED_2D_F32_F32_R:
- return NVPTX::TEX_UNIFIED_2D_F32_F32_I;
- case NVPTX::TEX_UNIFIED_2D_F32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_2D_F32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_2D_F32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_2D_F32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_2D_S32_S32_R:
- return NVPTX::TEX_UNIFIED_2D_S32_S32_I;
- case NVPTX::TEX_UNIFIED_2D_S32_F32_R:
- return NVPTX::TEX_UNIFIED_2D_S32_F32_I;
- case NVPTX::TEX_UNIFIED_2D_S32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_2D_S32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_2D_S32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_2D_S32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_2D_U32_S32_R:
- return NVPTX::TEX_UNIFIED_2D_U32_S32_I;
- case NVPTX::TEX_UNIFIED_2D_U32_F32_R:
- return NVPTX::TEX_UNIFIED_2D_U32_F32_I;
- case NVPTX::TEX_UNIFIED_2D_U32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_2D_U32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_2D_U32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_2D_U32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_F32_S32_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_F32_S32_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_F32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_S32_S32_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_S32_S32_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_S32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_U32_S32_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_U32_S32_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_2D_ARRAY_U32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_3D_F32_S32_R:
- return NVPTX::TEX_UNIFIED_3D_F32_S32_I;
- case NVPTX::TEX_UNIFIED_3D_F32_F32_R:
- return NVPTX::TEX_UNIFIED_3D_F32_F32_I;
- case NVPTX::TEX_UNIFIED_3D_F32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_3D_F32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_3D_F32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_3D_F32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_3D_S32_S32_R:
- return NVPTX::TEX_UNIFIED_3D_S32_S32_I;
- case NVPTX::TEX_UNIFIED_3D_S32_F32_R:
- return NVPTX::TEX_UNIFIED_3D_S32_F32_I;
- case NVPTX::TEX_UNIFIED_3D_S32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_3D_S32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_3D_S32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_3D_S32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_3D_U32_S32_R:
- return NVPTX::TEX_UNIFIED_3D_U32_S32_I;
- case NVPTX::TEX_UNIFIED_3D_U32_F32_R:
- return NVPTX::TEX_UNIFIED_3D_U32_F32_I;
- case NVPTX::TEX_UNIFIED_3D_U32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_3D_U32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_3D_U32_F32_GRAD_R:
- return NVPTX::TEX_UNIFIED_3D_U32_F32_GRAD_I;
- case NVPTX::TEX_UNIFIED_CUBE_F32_F32_R:
- return NVPTX::TEX_UNIFIED_CUBE_F32_F32_I;
- case NVPTX::TEX_UNIFIED_CUBE_F32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_CUBE_F32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_CUBE_S32_F32_R:
- return NVPTX::TEX_UNIFIED_CUBE_S32_F32_I;
- case NVPTX::TEX_UNIFIED_CUBE_S32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_CUBE_S32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_CUBE_U32_F32_R:
- return NVPTX::TEX_UNIFIED_CUBE_U32_F32_I;
- case NVPTX::TEX_UNIFIED_CUBE_U32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_CUBE_U32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_CUBE_ARRAY_F32_F32_R:
- return NVPTX::TEX_UNIFIED_CUBE_ARRAY_F32_F32_I;
- case NVPTX::TEX_UNIFIED_CUBE_ARRAY_F32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_CUBE_ARRAY_F32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_CUBE_ARRAY_S32_F32_R:
- return NVPTX::TEX_UNIFIED_CUBE_ARRAY_S32_F32_I;
- case NVPTX::TEX_UNIFIED_CUBE_ARRAY_S32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_CUBE_ARRAY_S32_F32_LEVEL_I;
- case NVPTX::TEX_UNIFIED_CUBE_ARRAY_U32_F32_R:
- return NVPTX::TEX_UNIFIED_CUBE_ARRAY_U32_F32_I;
- case NVPTX::TEX_UNIFIED_CUBE_ARRAY_U32_F32_LEVEL_R:
- return NVPTX::TEX_UNIFIED_CUBE_ARRAY_U32_F32_LEVEL_I;
- case NVPTX::TLD4_UNIFIED_R_2D_F32_F32_R:
- return NVPTX::TLD4_UNIFIED_R_2D_F32_F32_I;
- case NVPTX::TLD4_UNIFIED_G_2D_F32_F32_R:
- return NVPTX::TLD4_UNIFIED_G_2D_F32_F32_I;
- case NVPTX::TLD4_UNIFIED_B_2D_F32_F32_R:
- return NVPTX::TLD4_UNIFIED_B_2D_F32_F32_I;
- case NVPTX::TLD4_UNIFIED_A_2D_F32_F32_R:
- return NVPTX::TLD4_UNIFIED_A_2D_F32_F32_I;
- case NVPTX::TLD4_UNIFIED_R_2D_S32_F32_R:
- return NVPTX::TLD4_UNIFIED_R_2D_S32_F32_I;
- case NVPTX::TLD4_UNIFIED_G_2D_S32_F32_R:
- return NVPTX::TLD4_UNIFIED_G_2D_S32_F32_I;
- case NVPTX::TLD4_UNIFIED_B_2D_S32_F32_R:
- return NVPTX::TLD4_UNIFIED_B_2D_S32_F32_I;
- case NVPTX::TLD4_UNIFIED_A_2D_S32_F32_R:
- return NVPTX::TLD4_UNIFIED_A_2D_S32_F32_I;
- case NVPTX::TLD4_UNIFIED_R_2D_U32_F32_R:
- return NVPTX::TLD4_UNIFIED_R_2D_U32_F32_I;
- case NVPTX::TLD4_UNIFIED_G_2D_U32_F32_R:
- return NVPTX::TLD4_UNIFIED_G_2D_U32_F32_I;
- case NVPTX::TLD4_UNIFIED_B_2D_U32_F32_R:
- return NVPTX::TLD4_UNIFIED_B_2D_U32_F32_I;
- case NVPTX::TLD4_UNIFIED_A_2D_U32_F32_R:
- return NVPTX::TLD4_UNIFIED_A_2D_U32_F32_I;
- default:
- llvm_unreachable("Unhandled TEX opcode");
- };
- }
- static unsigned samplerRegisterToIndexOpcode(unsigned RegOC) {
- switch (RegOC) {
- case NVPTX::TEX_1D_F32_S32_RR:
- return NVPTX::TEX_1D_F32_S32_RI;
- case NVPTX::TEX_1D_F32_S32_IR:
- return NVPTX::TEX_1D_F32_S32_II;
- case NVPTX::TEX_1D_F32_F32_RR:
- return NVPTX::TEX_1D_F32_F32_RI;
- case NVPTX::TEX_1D_F32_F32_IR:
- return NVPTX::TEX_1D_F32_F32_II;
- case NVPTX::TEX_1D_F32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_F32_F32_LEVEL_RI;
- case NVPTX::TEX_1D_F32_F32_LEVEL_IR:
- return NVPTX::TEX_1D_F32_F32_LEVEL_II;
- case NVPTX::TEX_1D_F32_F32_GRAD_RR:
- return NVPTX::TEX_1D_F32_F32_GRAD_RI;
- case NVPTX::TEX_1D_F32_F32_GRAD_IR:
- return NVPTX::TEX_1D_F32_F32_GRAD_II;
- case NVPTX::TEX_1D_S32_S32_RR:
- return NVPTX::TEX_1D_S32_S32_RI;
- case NVPTX::TEX_1D_S32_S32_IR:
- return NVPTX::TEX_1D_S32_S32_II;
- case NVPTX::TEX_1D_S32_F32_RR:
- return NVPTX::TEX_1D_S32_F32_RI;
- case NVPTX::TEX_1D_S32_F32_IR:
- return NVPTX::TEX_1D_S32_F32_II;
- case NVPTX::TEX_1D_S32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_S32_F32_LEVEL_RI;
- case NVPTX::TEX_1D_S32_F32_LEVEL_IR:
- return NVPTX::TEX_1D_S32_F32_LEVEL_II;
- case NVPTX::TEX_1D_S32_F32_GRAD_RR:
- return NVPTX::TEX_1D_S32_F32_GRAD_RI;
- case NVPTX::TEX_1D_S32_F32_GRAD_IR:
- return NVPTX::TEX_1D_S32_F32_GRAD_II;
- case NVPTX::TEX_1D_U32_S32_RR:
- return NVPTX::TEX_1D_U32_S32_RI;
- case NVPTX::TEX_1D_U32_S32_IR:
- return NVPTX::TEX_1D_U32_S32_II;
- case NVPTX::TEX_1D_U32_F32_RR:
- return NVPTX::TEX_1D_U32_F32_RI;
- case NVPTX::TEX_1D_U32_F32_IR:
- return NVPTX::TEX_1D_U32_F32_II;
- case NVPTX::TEX_1D_U32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_U32_F32_LEVEL_RI;
- case NVPTX::TEX_1D_U32_F32_LEVEL_IR:
- return NVPTX::TEX_1D_U32_F32_LEVEL_II;
- case NVPTX::TEX_1D_U32_F32_GRAD_RR:
- return NVPTX::TEX_1D_U32_F32_GRAD_RI;
- case NVPTX::TEX_1D_U32_F32_GRAD_IR:
- return NVPTX::TEX_1D_U32_F32_GRAD_II;
- case NVPTX::TEX_1D_ARRAY_F32_S32_RR:
- return NVPTX::TEX_1D_ARRAY_F32_S32_RI;
- case NVPTX::TEX_1D_ARRAY_F32_S32_IR:
- return NVPTX::TEX_1D_ARRAY_F32_S32_II;
- case NVPTX::TEX_1D_ARRAY_F32_F32_RR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_RI;
- case NVPTX::TEX_1D_ARRAY_F32_F32_IR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_II;
- case NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_RI;
- case NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_IR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_LEVEL_II;
- case NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_RR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_RI;
- case NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_IR:
- return NVPTX::TEX_1D_ARRAY_F32_F32_GRAD_II;
- case NVPTX::TEX_1D_ARRAY_S32_S32_RR:
- return NVPTX::TEX_1D_ARRAY_S32_S32_RI;
- case NVPTX::TEX_1D_ARRAY_S32_S32_IR:
- return NVPTX::TEX_1D_ARRAY_S32_S32_II;
- case NVPTX::TEX_1D_ARRAY_S32_F32_RR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_RI;
- case NVPTX::TEX_1D_ARRAY_S32_F32_IR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_II;
- case NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_RI;
- case NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_IR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_LEVEL_II;
- case NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_RR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_RI;
- case NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_IR:
- return NVPTX::TEX_1D_ARRAY_S32_F32_GRAD_II;
- case NVPTX::TEX_1D_ARRAY_U32_S32_RR:
- return NVPTX::TEX_1D_ARRAY_U32_S32_RI;
- case NVPTX::TEX_1D_ARRAY_U32_S32_IR:
- return NVPTX::TEX_1D_ARRAY_U32_S32_II;
- case NVPTX::TEX_1D_ARRAY_U32_F32_RR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_RI;
- case NVPTX::TEX_1D_ARRAY_U32_F32_IR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_II;
- case NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_RR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_RI;
- case NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_IR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_LEVEL_II;
- case NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_RR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_RI;
- case NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_IR:
- return NVPTX::TEX_1D_ARRAY_U32_F32_GRAD_II;
- case NVPTX::TEX_2D_F32_S32_RR:
- return NVPTX::TEX_2D_F32_S32_RI;
- case NVPTX::TEX_2D_F32_S32_IR:
- return NVPTX::TEX_2D_F32_S32_II;
- case NVPTX::TEX_2D_F32_F32_RR:
- return NVPTX::TEX_2D_F32_F32_RI;
- case NVPTX::TEX_2D_F32_F32_IR:
- return NVPTX::TEX_2D_F32_F32_II;
- case NVPTX::TEX_2D_F32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_F32_F32_LEVEL_RI;
- case NVPTX::TEX_2D_F32_F32_LEVEL_IR:
- return NVPTX::TEX_2D_F32_F32_LEVEL_II;
- case NVPTX::TEX_2D_F32_F32_GRAD_RR:
- return NVPTX::TEX_2D_F32_F32_GRAD_RI;
- case NVPTX::TEX_2D_F32_F32_GRAD_IR:
- return NVPTX::TEX_2D_F32_F32_GRAD_II;
- case NVPTX::TEX_2D_S32_S32_RR:
- return NVPTX::TEX_2D_S32_S32_RI;
- case NVPTX::TEX_2D_S32_S32_IR:
- return NVPTX::TEX_2D_S32_S32_II;
- case NVPTX::TEX_2D_S32_F32_RR:
- return NVPTX::TEX_2D_S32_F32_RI;
- case NVPTX::TEX_2D_S32_F32_IR:
- return NVPTX::TEX_2D_S32_F32_II;
- case NVPTX::TEX_2D_S32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_S32_F32_LEVEL_RI;
- case NVPTX::TEX_2D_S32_F32_LEVEL_IR:
- return NVPTX::TEX_2D_S32_F32_LEVEL_II;
- case NVPTX::TEX_2D_S32_F32_GRAD_RR:
- return NVPTX::TEX_2D_S32_F32_GRAD_RI;
- case NVPTX::TEX_2D_S32_F32_GRAD_IR:
- return NVPTX::TEX_2D_S32_F32_GRAD_II;
- case NVPTX::TEX_2D_U32_S32_RR:
- return NVPTX::TEX_2D_U32_S32_RI;
- case NVPTX::TEX_2D_U32_S32_IR:
- return NVPTX::TEX_2D_U32_S32_II;
- case NVPTX::TEX_2D_U32_F32_RR:
- return NVPTX::TEX_2D_U32_F32_RI;
- case NVPTX::TEX_2D_U32_F32_IR:
- return NVPTX::TEX_2D_U32_F32_II;
- case NVPTX::TEX_2D_U32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_U32_F32_LEVEL_RI;
- case NVPTX::TEX_2D_U32_F32_LEVEL_IR:
- return NVPTX::TEX_2D_U32_F32_LEVEL_II;
- case NVPTX::TEX_2D_U32_F32_GRAD_RR:
- return NVPTX::TEX_2D_U32_F32_GRAD_RI;
- case NVPTX::TEX_2D_U32_F32_GRAD_IR:
- return NVPTX::TEX_2D_U32_F32_GRAD_II;
- case NVPTX::TEX_2D_ARRAY_F32_S32_RR:
- return NVPTX::TEX_2D_ARRAY_F32_S32_RI;
- case NVPTX::TEX_2D_ARRAY_F32_S32_IR:
- return NVPTX::TEX_2D_ARRAY_F32_S32_II;
- case NVPTX::TEX_2D_ARRAY_F32_F32_RR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_RI;
- case NVPTX::TEX_2D_ARRAY_F32_F32_IR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_II;
- case NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_RI;
- case NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_IR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_LEVEL_II;
- case NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_RR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_RI;
- case NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_IR:
- return NVPTX::TEX_2D_ARRAY_F32_F32_GRAD_II;
- case NVPTX::TEX_2D_ARRAY_S32_S32_RR:
- return NVPTX::TEX_2D_ARRAY_S32_S32_RI;
- case NVPTX::TEX_2D_ARRAY_S32_S32_IR:
- return NVPTX::TEX_2D_ARRAY_S32_S32_II;
- case NVPTX::TEX_2D_ARRAY_S32_F32_RR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_RI;
- case NVPTX::TEX_2D_ARRAY_S32_F32_IR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_II;
- case NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_RI;
- case NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_IR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_LEVEL_II;
- case NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_RR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_RI;
- case NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_IR:
- return NVPTX::TEX_2D_ARRAY_S32_F32_GRAD_II;
- case NVPTX::TEX_2D_ARRAY_U32_S32_RR:
- return NVPTX::TEX_2D_ARRAY_U32_S32_RI;
- case NVPTX::TEX_2D_ARRAY_U32_S32_IR:
- return NVPTX::TEX_2D_ARRAY_U32_S32_II;
- case NVPTX::TEX_2D_ARRAY_U32_F32_RR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_RI;
- case NVPTX::TEX_2D_ARRAY_U32_F32_IR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_II;
- case NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_RR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_RI;
- case NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_IR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_LEVEL_II;
- case NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_RR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_RI;
- case NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_IR:
- return NVPTX::TEX_2D_ARRAY_U32_F32_GRAD_II;
- case NVPTX::TEX_3D_F32_S32_RR:
- return NVPTX::TEX_3D_F32_S32_RI;
- case NVPTX::TEX_3D_F32_S32_IR:
- return NVPTX::TEX_3D_F32_S32_II;
- case NVPTX::TEX_3D_F32_F32_RR:
- return NVPTX::TEX_3D_F32_F32_RI;
- case NVPTX::TEX_3D_F32_F32_IR:
- return NVPTX::TEX_3D_F32_F32_II;
- case NVPTX::TEX_3D_F32_F32_LEVEL_RR:
- return NVPTX::TEX_3D_F32_F32_LEVEL_RI;
- case NVPTX::TEX_3D_F32_F32_LEVEL_IR:
- return NVPTX::TEX_3D_F32_F32_LEVEL_II;
- case NVPTX::TEX_3D_F32_F32_GRAD_RR:
- return NVPTX::TEX_3D_F32_F32_GRAD_RI;
- case NVPTX::TEX_3D_F32_F32_GRAD_IR:
- return NVPTX::TEX_3D_F32_F32_GRAD_II;
- case NVPTX::TEX_3D_S32_S32_RR:
- return NVPTX::TEX_3D_S32_S32_RI;
- case NVPTX::TEX_3D_S32_S32_IR:
- return NVPTX::TEX_3D_S32_S32_II;
- case NVPTX::TEX_3D_S32_F32_RR:
- return NVPTX::TEX_3D_S32_F32_RI;
- case NVPTX::TEX_3D_S32_F32_IR:
- return NVPTX::TEX_3D_S32_F32_II;
- case NVPTX::TEX_3D_S32_F32_LEVEL_RR:
- return NVPTX::TEX_3D_S32_F32_LEVEL_RI;
- case NVPTX::TEX_3D_S32_F32_LEVEL_IR:
- return NVPTX::TEX_3D_S32_F32_LEVEL_II;
- case NVPTX::TEX_3D_S32_F32_GRAD_RR:
- return NVPTX::TEX_3D_S32_F32_GRAD_RI;
- case NVPTX::TEX_3D_S32_F32_GRAD_IR:
- return NVPTX::TEX_3D_S32_F32_GRAD_II;
- case NVPTX::TEX_3D_U32_S32_RR:
- return NVPTX::TEX_3D_U32_S32_RI;
- case NVPTX::TEX_3D_U32_S32_IR:
- return NVPTX::TEX_3D_U32_S32_II;
- case NVPTX::TEX_3D_U32_F32_RR:
- return NVPTX::TEX_3D_U32_F32_RI;
- case NVPTX::TEX_3D_U32_F32_IR:
- return NVPTX::TEX_3D_U32_F32_II;
- case NVPTX::TEX_3D_U32_F32_LEVEL_RR:
- return NVPTX::TEX_3D_U32_F32_LEVEL_RI;
- case NVPTX::TEX_3D_U32_F32_LEVEL_IR:
- return NVPTX::TEX_3D_U32_F32_LEVEL_II;
- case NVPTX::TEX_3D_U32_F32_GRAD_RR:
- return NVPTX::TEX_3D_U32_F32_GRAD_RI;
- case NVPTX::TEX_3D_U32_F32_GRAD_IR:
- return NVPTX::TEX_3D_U32_F32_GRAD_II;
- case NVPTX::TEX_CUBE_F32_F32_RR:
- return NVPTX::TEX_CUBE_F32_F32_RI;
- case NVPTX::TEX_CUBE_F32_F32_IR:
- return NVPTX::TEX_CUBE_F32_F32_II;
- case NVPTX::TEX_CUBE_F32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_F32_F32_LEVEL_RI;
- case NVPTX::TEX_CUBE_F32_F32_LEVEL_IR:
- return NVPTX::TEX_CUBE_F32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_S32_F32_RR:
- return NVPTX::TEX_CUBE_S32_F32_RI;
- case NVPTX::TEX_CUBE_S32_F32_IR:
- return NVPTX::TEX_CUBE_S32_F32_II;
- case NVPTX::TEX_CUBE_S32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_S32_F32_LEVEL_RI;
- case NVPTX::TEX_CUBE_S32_F32_LEVEL_IR:
- return NVPTX::TEX_CUBE_S32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_U32_F32_RR:
- return NVPTX::TEX_CUBE_U32_F32_RI;
- case NVPTX::TEX_CUBE_U32_F32_IR:
- return NVPTX::TEX_CUBE_U32_F32_II;
- case NVPTX::TEX_CUBE_U32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_U32_F32_LEVEL_RI;
- case NVPTX::TEX_CUBE_U32_F32_LEVEL_IR:
- return NVPTX::TEX_CUBE_U32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_RR:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_RI;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_IR:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_II;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_RI;
- case NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_IR:
- return NVPTX::TEX_CUBE_ARRAY_F32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_RR:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_RI;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_IR:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_II;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_RI;
- case NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_IR:
- return NVPTX::TEX_CUBE_ARRAY_S32_F32_LEVEL_II;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_RR:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_RI;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_IR:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_II;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_RR:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_RI;
- case NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_IR:
- return NVPTX::TEX_CUBE_ARRAY_U32_F32_LEVEL_II;
- case NVPTX::TLD4_R_2D_F32_F32_RR:
- return NVPTX::TLD4_R_2D_F32_F32_RI;
- case NVPTX::TLD4_R_2D_F32_F32_IR:
- return NVPTX::TLD4_R_2D_F32_F32_II;
- case NVPTX::TLD4_G_2D_F32_F32_RR:
- return NVPTX::TLD4_G_2D_F32_F32_RI;
- case NVPTX::TLD4_G_2D_F32_F32_IR:
- return NVPTX::TLD4_G_2D_F32_F32_II;
- case NVPTX::TLD4_B_2D_F32_F32_RR:
- return NVPTX::TLD4_B_2D_F32_F32_RI;
- case NVPTX::TLD4_B_2D_F32_F32_IR:
- return NVPTX::TLD4_B_2D_F32_F32_II;
- case NVPTX::TLD4_A_2D_F32_F32_RR:
- return NVPTX::TLD4_A_2D_F32_F32_RI;
- case NVPTX::TLD4_A_2D_F32_F32_IR:
- return NVPTX::TLD4_A_2D_F32_F32_II;
- case NVPTX::TLD4_R_2D_S32_F32_RR:
- return NVPTX::TLD4_R_2D_S32_F32_RI;
- case NVPTX::TLD4_R_2D_S32_F32_IR:
- return NVPTX::TLD4_R_2D_S32_F32_II;
- case NVPTX::TLD4_G_2D_S32_F32_RR:
- return NVPTX::TLD4_G_2D_S32_F32_RI;
- case NVPTX::TLD4_G_2D_S32_F32_IR:
- return NVPTX::TLD4_G_2D_S32_F32_II;
- case NVPTX::TLD4_B_2D_S32_F32_RR:
- return NVPTX::TLD4_B_2D_S32_F32_RI;
- case NVPTX::TLD4_B_2D_S32_F32_IR:
- return NVPTX::TLD4_B_2D_S32_F32_II;
- case NVPTX::TLD4_A_2D_S32_F32_RR:
- return NVPTX::TLD4_A_2D_S32_F32_RI;
- case NVPTX::TLD4_A_2D_S32_F32_IR:
- return NVPTX::TLD4_A_2D_S32_F32_II;
- case NVPTX::TLD4_R_2D_U32_F32_RR:
- return NVPTX::TLD4_R_2D_U32_F32_RI;
- case NVPTX::TLD4_R_2D_U32_F32_IR:
- return NVPTX::TLD4_R_2D_U32_F32_II;
- case NVPTX::TLD4_G_2D_U32_F32_RR:
- return NVPTX::TLD4_G_2D_U32_F32_RI;
- case NVPTX::TLD4_G_2D_U32_F32_IR:
- return NVPTX::TLD4_G_2D_U32_F32_II;
- case NVPTX::TLD4_B_2D_U32_F32_RR:
- return NVPTX::TLD4_B_2D_U32_F32_RI;
- case NVPTX::TLD4_B_2D_U32_F32_IR:
- return NVPTX::TLD4_B_2D_U32_F32_II;
- case NVPTX::TLD4_A_2D_U32_F32_RR:
- return NVPTX::TLD4_A_2D_U32_F32_RI;
- case NVPTX::TLD4_A_2D_U32_F32_IR:
- return NVPTX::TLD4_A_2D_U32_F32_II;
- default:
- llvm_unreachable("Unhandled TEX opcode");
- };
- }
- static unsigned queryRegisterToIndexOpcode(unsigned RegOC) {
- switch (RegOC) {
- case NVPTX::TXQ_CHANNEL_ORDER_R:
- return NVPTX::TXQ_CHANNEL_ORDER_I;
- case NVPTX::TXQ_CHANNEL_DATA_TYPE_R:
- return NVPTX::TXQ_CHANNEL_DATA_TYPE_I;
- case NVPTX::TXQ_WIDTH_R:
- return NVPTX::TXQ_WIDTH_I;
- case NVPTX::TXQ_HEIGHT_R:
- return NVPTX::TXQ_HEIGHT_I;
- case NVPTX::TXQ_DEPTH_R:
- return NVPTX::TXQ_DEPTH_I;
- case NVPTX::TXQ_ARRAY_SIZE_R:
- return NVPTX::TXQ_ARRAY_SIZE_I;
- case NVPTX::TXQ_NUM_SAMPLES_R:
- return NVPTX::TXQ_NUM_SAMPLES_I;
- case NVPTX::TXQ_NUM_MIPMAP_LEVELS_R:
- return NVPTX::TXQ_NUM_MIPMAP_LEVELS_I;
- case NVPTX::SUQ_CHANNEL_ORDER_R:
- return NVPTX::SUQ_CHANNEL_ORDER_I;
- case NVPTX::SUQ_CHANNEL_DATA_TYPE_R:
- return NVPTX::SUQ_CHANNEL_DATA_TYPE_I;
- case NVPTX::SUQ_WIDTH_R:
- return NVPTX::SUQ_WIDTH_I;
- case NVPTX::SUQ_HEIGHT_R:
- return NVPTX::SUQ_HEIGHT_I;
- case NVPTX::SUQ_DEPTH_R:
- return NVPTX::SUQ_DEPTH_I;
- case NVPTX::SUQ_ARRAY_SIZE_R:
- return NVPTX::SUQ_ARRAY_SIZE_I;
- default:
- llvm_unreachable("Unhandled TXQ/SUQ opcode");
- };
- }
- bool NVPTXReplaceImageHandles::processInstr(MachineInstr &MI) {
- MachineFunction &MF = *MI.getParent()->getParent();
- const MCInstrDesc &MCID = MI.getDesc();
- const NVPTXInstrInfo *TII = MF.getSubtarget<NVPTXSubtarget>().getInstrInfo();
- if (MCID.TSFlags & NVPTXII::IsTexFlag) {
- // This is a texture fetch, so operand 4 is a texref and operand 5 is
- // a samplerref
- MachineOperand &TexHandle = MI.getOperand(4);
- if (replaceImageHandle(TexHandle, MF))
- MI.setDesc(TII->get(texRegisterToIndexOpcode(MI.getOpcode())));
- if (!(MCID.TSFlags & NVPTXII::IsTexModeUnifiedFlag)) {
- MachineOperand &SampHandle = MI.getOperand(5);
- if (replaceImageHandle(SampHandle, MF))
- MI.setDesc(TII->get(samplerRegisterToIndexOpcode(MI.getOpcode())));
- }
- return true;
- } else if (MCID.TSFlags & NVPTXII::IsSuldMask) {
- unsigned VecSize =
- 1 << (((MCID.TSFlags & NVPTXII::IsSuldMask) >> NVPTXII::IsSuldShift) - 1);
- // For a surface load of vector size N, the Nth operand will be the surfref
- MachineOperand &SurfHandle = MI.getOperand(VecSize);
- if (replaceImageHandle(SurfHandle, MF))
- MI.setDesc(TII->get(suldRegisterToIndexOpcode(MI.getOpcode())));
- return true;
- } else if (MCID.TSFlags & NVPTXII::IsSustFlag) {
- // This is a surface store, so operand 0 is a surfref
- MachineOperand &SurfHandle = MI.getOperand(0);
- if (replaceImageHandle(SurfHandle, MF))
- MI.setDesc(TII->get(sustRegisterToIndexOpcode(MI.getOpcode())));
- return true;
- } else if (MCID.TSFlags & NVPTXII::IsSurfTexQueryFlag) {
- // This is a query, so operand 1 is a surfref/texref
- MachineOperand &Handle = MI.getOperand(1);
- if (replaceImageHandle(Handle, MF))
- MI.setDesc(TII->get(queryRegisterToIndexOpcode(MI.getOpcode())));
- return true;
- }
- return false;
- }
- bool NVPTXReplaceImageHandles::replaceImageHandle(MachineOperand &Op,
- MachineFunction &MF) {
- unsigned Idx;
- if (findIndexForHandle(Op, MF, Idx)) {
- Op.ChangeToImmediate(Idx);
- return true;
- }
- return false;
- }
- bool NVPTXReplaceImageHandles::
- findIndexForHandle(MachineOperand &Op, MachineFunction &MF, unsigned &Idx) {
- const MachineRegisterInfo &MRI = MF.getRegInfo();
- NVPTXMachineFunctionInfo *MFI = MF.getInfo<NVPTXMachineFunctionInfo>();
- assert(Op.isReg() && "Handle is not in a reg?");
- // Which instruction defines the handle?
- MachineInstr &TexHandleDef = *MRI.getVRegDef(Op.getReg());
- switch (TexHandleDef.getOpcode()) {
- case NVPTX::LD_i64_avar: {
- // The handle is a parameter value being loaded, replace with the
- // parameter symbol
- const NVPTXTargetMachine &TM =
- static_cast<const NVPTXTargetMachine &>(MF.getTarget());
- if (TM.getDrvInterface() == NVPTX::CUDA) {
- // For CUDA, we preserve the param loads coming from function arguments
- return false;
- }
- assert(TexHandleDef.getOperand(6).isSymbol() && "Load is not a symbol!");
- StringRef Sym = TexHandleDef.getOperand(6).getSymbolName();
- std::string ParamBaseName = std::string(MF.getName());
- ParamBaseName += "_param_";
- assert(Sym.startswith(ParamBaseName) && "Invalid symbol reference");
- unsigned Param = atoi(Sym.data()+ParamBaseName.size());
- std::string NewSym;
- raw_string_ostream NewSymStr(NewSym);
- NewSymStr << MF.getName() << "_param_" << Param;
- InstrsToRemove.insert(&TexHandleDef);
- Idx = MFI->getImageHandleSymbolIndex(NewSymStr.str().c_str());
- return true;
- }
- case NVPTX::texsurf_handles: {
- // The handle is a global variable, replace with the global variable name
- assert(TexHandleDef.getOperand(1).isGlobal() && "Load is not a global!");
- const GlobalValue *GV = TexHandleDef.getOperand(1).getGlobal();
- assert(GV->hasName() && "Global sampler must be named!");
- InstrsToRemove.insert(&TexHandleDef);
- Idx = MFI->getImageHandleSymbolIndex(GV->getName().data());
- return true;
- }
- case NVPTX::nvvm_move_i64:
- case TargetOpcode::COPY: {
- bool Res = findIndexForHandle(TexHandleDef.getOperand(1), MF, Idx);
- if (Res) {
- InstrsToRemove.insert(&TexHandleDef);
- }
- return Res;
- }
- default:
- llvm_unreachable("Unknown instruction operating on handle");
- }
- }
- MachineFunctionPass *llvm::createNVPTXReplaceImageHandlesPass() {
- return new NVPTXReplaceImageHandles();
- }
|