tic6x-opcode-table.h 143 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678
  1. /* TI C6X opcode table.
  2. Copyright (C) 2010-2015 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  14. MA 02110-1301, USA. */
  15. /* Define the INSN macro before including this file; it takes as
  16. arguments the fields from tic6x_opcode (defined in tic6x.h). The
  17. name is given as an identifier; the subsequent four operands should
  18. have "tic6x_func_unit_", "tic6x_insn_format_", "tic6x_pipeline_"
  19. and "TIC6X_INSN_", respectively, prepended to them by the macro
  20. definition. Also define INSNE, which has a second argument that
  21. goes after tic6x_opcode_NAME_ to form the enumeration value for
  22. this instruction, where the value otherwise formed from the name,
  23. functional unit and format is ambiguous, but otherwise has the same
  24. arguments as INSN. */
  25. #define TIC6X_INSN_C64X_AND_C67X TIC6X_INSN_C64X|TIC6X_INSN_C67X
  26. #define tic6x_insn_format_nfu_s_branch_nop_cst \
  27. tic6x_insn_format_s_branch_nop_cst
  28. #define tic6x_insn_format_s_l_1_or_2_src tic6x_insn_format_l_1_or_2_src
  29. #define RAN(id, min, max) { CONCAT2(tic6x_field_,id), (min), (max) }
  30. #define FIX(id, val) RAN(id, val, val)
  31. #define FIX0() 0, { { 0, 0, 0 } }
  32. #define FIX1(a) 1, { a }
  33. #define FIX2(a, b) 2, { a, b }
  34. #define FIX3(a, b, c) 3, { a, b, c }
  35. #define FIX4(a, b, c, d) 4, { a, b, c, d }
  36. #define OP0() 0, { { 0, 0, FALSE, 0, 0, 0, 0 } }
  37. #define OP1(a) 1, { a }
  38. #define OP2(a, b) 2, { a, b }
  39. #define OP3(a, b, c) 3, { a, b, c }
  40. #define OP4(a, b, c, d) 4, { a, b, c, d }
  41. #define OACST { tic6x_operand_asm_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
  42. #define OLCST { tic6x_operand_link_const, 0, tic6x_rw_none, 0, 0, 0, 0 }
  43. #define OHWCSTM1 { tic6x_operand_hw_const_minus_1, 0, tic6x_rw_none, 0, 0, 0, 0 }
  44. #define OHWCST0 { tic6x_operand_hw_const_0, 0, tic6x_rw_none, 0, 0, 0, 0 }
  45. #define OHWCST1 { tic6x_operand_hw_const_1, 0, tic6x_rw_none, 0, 0, 0, 0 }
  46. #define OHWCST5 { tic6x_operand_hw_const_5, 0, tic6x_rw_none, 0, 0, 0, 0 }
  47. #define OHWCST16 { tic6x_operand_hw_const_16, 0, tic6x_rw_none, 0, 0, 0, 0 }
  48. #define OHWCST24 { tic6x_operand_hw_const_24, 0, tic6x_rw_none, 0, 0, 0, 0 }
  49. #define OHWCST31 { tic6x_operand_hw_const_31, 0, tic6x_rw_none, 0, 0, 0, 0 }
  50. #define OFULIST { tic6x_operand_func_unit, 0, tic6x_rw_none, 0, 0, 0, 0 }
  51. #define ORIRP1 { tic6x_operand_irp, 4, tic6x_rw_read, 1, 1, 0, 0 }
  52. #define ORNRP1 { tic6x_operand_nrp, 4, tic6x_rw_read, 1, 1, 0, 0 }
  53. #define OWREG1 { tic6x_operand_reg, 4, tic6x_rw_write, 1, 1, 0, 0 }
  54. #define OWREG1Z { tic6x_operand_zreg, 4, tic6x_rw_write, 1, 1, 0, 0 }
  55. #define OWREG1NORS { tic6x_operand_reg_nors, 4, tic6x_rw_write, 1, 1, 0, 0 }
  56. #define ORREG1B { tic6x_operand_reg_bside, 4, tic6x_rw_write, 1, 1, 0, 0 }
  57. #define ORREG1BNORS { tic6x_operand_reg_bside_nors, 4, tic6x_rw_write, 1, 1, 0, 0 }
  58. #define OWRETREG1 { tic6x_operand_retreg, 4, tic6x_rw_write, 1, 1, 0, 0 }
  59. #define ORREG1 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 1, 0, 0 }
  60. #define ORDREG1 { tic6x_operand_dreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
  61. #define ORTREG1 { tic6x_operand_treg, 4, tic6x_rw_read, 1, 1, 0, 0 }
  62. #define ORWREG1 { tic6x_operand_reg, 4, tic6x_rw_read_write, 1, 1, 0, 0 }
  63. #define ORB15REG1 { tic6x_operand_b15reg, 4, tic6x_rw_read, 1, 1, 0, 0 }
  64. #define OWB15REG1 { tic6x_operand_b15reg, 4, tic6x_rw_write, 1, 1, 0, 0 }
  65. #define ORAREG1 { tic6x_operand_areg, 4, tic6x_rw_read, 1, 1, 0, 0 }
  66. #define ORXREG1 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 1, 0, 0 }
  67. #define ORREG12 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 2, 0, 0 }
  68. #define ORREG14 { tic6x_operand_reg, 4, tic6x_rw_read, 1, 4, 0, 0 }
  69. #define ORXREG14 { tic6x_operand_xreg, 4, tic6x_rw_read, 1, 4, 0, 0 }
  70. #define OWREG2 { tic6x_operand_reg, 4, tic6x_rw_write, 2, 2, 0, 0 }
  71. #define OWREG4 { tic6x_operand_reg, 4, tic6x_rw_write, 4, 4, 0, 0 }
  72. #define OWREG9 { tic6x_operand_reg, 4, tic6x_rw_write, 9, 9, 0, 0 }
  73. #define OWDREG5 { tic6x_operand_dreg, 4, tic6x_rw_write, 5, 5, 0, 0 }
  74. #define OWTREG5 { tic6x_operand_treg, 4, tic6x_rw_write, 5, 5, 0, 0 }
  75. #define OWREGL1 { tic6x_operand_regpair, 5, tic6x_rw_write, 1, 1, 1, 1 }
  76. #define ORREGL1 { tic6x_operand_regpair, 5, tic6x_rw_read, 1, 1, 1, 1 }
  77. #define OWREGD1 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 1, 1 }
  78. #define OWREGD12 { tic6x_operand_regpair, 8, tic6x_rw_write, 1, 1, 2, 2 }
  79. #define OWREGD4 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 4, 4 }
  80. #define ORREGD1 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
  81. #define OWREGD45 { tic6x_operand_regpair, 8, tic6x_rw_write, 4, 4, 5, 5 }
  82. #define OWREGD67 { tic6x_operand_regpair, 8, tic6x_rw_write, 6, 6, 7, 7 }
  83. #define ORDREGD1 { tic6x_operand_dregpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
  84. #define ORTREGD1 { tic6x_operand_tregpair, 8, tic6x_rw_read, 1, 1, 1, 1 }
  85. #define OWDREGD5 { tic6x_operand_dregpair, 8, tic6x_rw_write, 5, 5, 5, 5 }
  86. #define OWTREGD5 { tic6x_operand_tregpair, 8, tic6x_rw_write, 5, 5, 5, 5 }
  87. #define ORREGD12 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
  88. #define ORXREGD12 { tic6x_operand_xregpair, 8, tic6x_rw_read, 1, 1, 2, 2 }
  89. #define ORREGD1234 { tic6x_operand_regpair, 8, tic6x_rw_read, 1, 2, 3, 4 }
  90. #define ORXREGD1324 { tic6x_operand_xregpair, 8, tic6x_rw_read, 1, 3, 2, 4 }
  91. #define OWREGD910 { tic6x_operand_regpair, 8, tic6x_rw_write, 9, 9, 10, 10 }
  92. #define ORCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_read, 1, 1, 0, 0 }
  93. #define OWCREG1 { tic6x_operand_ctrl, 4, tic6x_rw_write, 1, 1, 0, 0 }
  94. #define OWILC1 { tic6x_operand_ilc, 4, tic6x_rw_write, 1, 1, 0, 0 }
  95. #define ORMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_read, 3, 3, 0, 0 }
  96. #define OWMEMDW { tic6x_operand_mem_deref, 4, tic6x_rw_write, 3, 3, 0, 0 }
  97. #define ORMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_read, 3, 3, 0, 0 }
  98. #define OWMEMSB { tic6x_operand_mem_short, 1, tic6x_rw_write, 3, 3, 0, 0 }
  99. #define ORMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_read, 3, 3, 0, 0 }
  100. #define OWMEMLB { tic6x_operand_mem_long, 1, tic6x_rw_write, 3, 3, 0, 0 }
  101. #define ORMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_read, 3, 3, 0, 0 }
  102. #define OWMEMSH { tic6x_operand_mem_short, 2, tic6x_rw_write, 3, 3, 0, 0 }
  103. #define ORMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_read, 3, 3, 0, 0 }
  104. #define OWMEMLH { tic6x_operand_mem_long, 2, tic6x_rw_write, 3, 3, 0, 0 }
  105. #define ORMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_read, 3, 3, 0, 0 }
  106. #define OWMEMSW { tic6x_operand_mem_short, 4, tic6x_rw_write, 3, 3, 0, 0 }
  107. #define ORMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_read, 3, 3, 0, 0 }
  108. #define OWMEMLW { tic6x_operand_mem_long, 4, tic6x_rw_write, 3, 3, 0, 0 }
  109. #define ORMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_read, 3, 3, 0, 0 }
  110. #define OWMEMSD { tic6x_operand_mem_short, 8, tic6x_rw_write, 3, 3, 0, 0 }
  111. #define ORMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_read, 3, 3, 0, 0 }
  112. #define OWMEMND { tic6x_operand_mem_ndw, 8, tic6x_rw_write, 3, 3, 0, 0 }
  113. #define ENC(id, meth, op) { \
  114. CONCAT2(tic6x_field_,id), \
  115. CONCAT2(tic6x_coding_,meth), \
  116. op \
  117. }
  118. #define ENC0() 0, { { 0, 0, 0 } }
  119. #define ENC1(a) 1, { a }
  120. #define ENC2(a, b) 2, { a, b }
  121. #define ENC3(a, b, c) 3, { a, b, c }
  122. #define ENC4(a, b, c, d) 4, { a, b, c, d }
  123. #define ENC5(a, b, c, d, e) 5, { a, b, c, d, e }
  124. #define ENC6(a, b, c, d, e, f) 6, { a, b, c, d, e, f }
  125. #define ENC7(a, b, c, d, e, f, g) 7, { a, b, c, d, e, f, g }
  126. INSN(abs, l, unary, 1cycle, C62X, 0,
  127. FIX1(FIX(op, 0)),
  128. OP2(ORXREG1, OWREG1),
  129. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  130. ENC(dst, reg, 1)))
  131. INSN(abs, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  132. FIX3(FIX(op, 0x38), FIX(x, 0), FIX(src1, 0)),
  133. OP2(ORREGL1, OWREGL1),
  134. ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
  135. INSN(abs2, l, unary, 1cycle, C64X, 0,
  136. FIX1(FIX(op, 0x4)),
  137. OP2(ORXREG1, OWREG1),
  138. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  139. ENC(dst, reg, 1)))
  140. INSN(absdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
  141. FIX2(FIX(op, 0x2c), FIX(x, 0)),
  142. OP2(ORREGD1, OWREGD12),
  143. ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
  144. ENC(dst, reg, 1)))
  145. INSN(abssp, s, unary, 1cycle, C67X, 0,
  146. FIX1(FIX(op, 0)),
  147. OP2(ORXREG1, OWREG1),
  148. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  149. ENC(dst, reg, 1)))
  150. INSNE(add, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
  151. FIX1(FIX(op, 0x3)),
  152. OP3(ORREG1, ORXREG1, OWREG1),
  153. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  154. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  155. INSNE(add, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, 0,
  156. FIX1(FIX(op, 0x23)),
  157. OP3(ORREG1, ORXREG1, OWREGL1),
  158. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  159. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  160. INSNE(add, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
  161. FIX1(FIX(op, 0x21)),
  162. OP3(ORXREG1, ORREGL1, OWREGL1),
  163. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  164. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  165. INSNE(add, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
  166. FIX1(FIX(op, 0x2)),
  167. OP3(OACST, ORXREG1, OWREG1),
  168. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  169. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  170. INSNE(add, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  171. FIX2(FIX(op, 0x20), FIX(x, 0)),
  172. OP3(OACST, ORREGL1, OWREGL1),
  173. ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
  174. ENC(dst, reg, 2)))
  175. INSNE(add, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
  176. FIX1(FIX(op, 0x7)),
  177. OP3(ORREG1, ORXREG1, OWREG1),
  178. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  179. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  180. INSNE(add, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
  181. FIX1(FIX(op, 0x6)),
  182. OP3(OACST, ORXREG1, OWREG1),
  183. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  184. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  185. INSNE(add, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
  186. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  187. FIX1(FIX(op, 0x10)),
  188. OP3(ORREG1, ORREG1, OWREG1),
  189. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  190. ENC(dst, reg, 2)))
  191. INSNE(add, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
  192. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  193. FIX1(FIX(op, 0x12)),
  194. OP3(ORREG1, OACST, OWREG1),
  195. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  196. ENC(dst, reg, 2)))
  197. INSNE(add, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
  198. FIX1(FIX(op, 0xa)),
  199. OP3(ORREG1, ORXREG1, OWREG1),
  200. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  201. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  202. INSNE(add, d_xsi_s5_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
  203. FIX1(FIX(op, 0xb)),
  204. OP3(ORXREG1, OACST, OWREG1),
  205. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  206. ENC(src1, scst, 1), ENC(dst, reg, 2)))
  207. /* 16 bits insn */
  208. INSN(add, l, l3_sat_0, 1cycle, C64XP, 0,
  209. FIX1(FIX(op, 0x0)),
  210. OP3(ORREG1, ORXREG1, OWREG1),
  211. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  212. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  213. INSN(add, l, l3i, 1cycle, C64XP, 0,
  214. FIX0(),
  215. OP3(OACST, ORXREG1, OWREG1),
  216. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(cst, scst_l3i, 0),
  217. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  218. INSN(add, l, lx1, 1cycle, C64XP,
  219. TIC6X_FLAG_NO_CROSS,
  220. FIX1(FIX(op, 0x3)),
  221. OP3(OHWCSTM1, ORREG1, OWREG1),
  222. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
  223. INSN(add, s, s3_sat_0, 1cycle, C64XP, 0,
  224. FIX1(FIX(op, 0x0)),
  225. OP3(ORREG1, ORXREG1, OWREG1),
  226. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  227. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  228. INSN(add, s, sx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  229. FIX1(FIX(op, 0x3)),
  230. OP3(OHWCSTM1, ORREG1, OWREG1),
  231. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
  232. INSN(add, s, sx2op, 1cycle, C64XP, 0,
  233. FIX1(FIX(op, 0x0)),
  234. OP3(ORREG1, ORXREG1, OWREG1),
  235. ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2),
  236. ENC(src2, reg, 1), ENC(x, xpath, 1)))
  237. INSN(add, d, dx2op, 1cycle, C64XP, 0,
  238. FIX1(FIX(op, 0x0)),
  239. OP3(ORREG1, ORXREG1, OWREG1),
  240. ENC5(ENC(s, fu, 0), ENC(x, xpath, 1), ENC(srcdst, reg, 0),
  241. ENC(src2, reg, 1), ENC(srcdst, reg, 2)))
  242. INSNU(add, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  243. FIX2(FIX(op, 0x5), FIX(unit, 0x0)),
  244. OP3(ORREG1, OHWCST1, OWREG1),
  245. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
  246. INSNU(add, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  247. FIX2(FIX(op, 0x5), FIX(unit, 0x1)),
  248. OP3(ORREG1, OHWCST1, OWREG1),
  249. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
  250. INSNU(add, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  251. FIX2(FIX(op, 0x5), FIX(unit, 0x2)),
  252. OP3(ORREG1, OHWCST1, OWREG1),
  253. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
  254. /**/
  255. INSNE(addab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  256. FIX1(FIX(op, 0x30)),
  257. OP3(ORREG1, ORREG1, OWREG1),
  258. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  259. ENC(dst, reg, 2)))
  260. INSNE(addab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
  261. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  262. FIX1(FIX(op, 0x32)),
  263. OP3(ORREG1, OACST, OWREG1),
  264. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  265. ENC(dst, reg, 2)))
  266. INSN(addab, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
  267. FIX1(FIX(op, 3)),
  268. OP3(ORAREG1, OLCST, OWREG1),
  269. ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 1),
  270. ENC(dst, reg, 2)))
  271. INSNE(addad, d_si_si_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
  272. TIC6X_FLAG_NO_CROSS,
  273. FIX1(FIX(op, 0x3c)),
  274. OP3(ORREG1, ORREG1, OWREG1),
  275. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  276. ENC(dst, reg, 2)))
  277. INSNE(addad, d_si_u5_si, d, 1_or_2_src, 1cycle, C64X_AND_C67X,
  278. TIC6X_FLAG_NO_CROSS,
  279. FIX1(FIX(op, 0x3d)),
  280. OP3(ORREG1, OACST, OWREG1),
  281. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  282. ENC(dst, reg, 2)))
  283. INSNE(addah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  284. FIX1(FIX(op, 0x34)),
  285. OP3(ORREG1, ORREG1, OWREG1),
  286. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  287. ENC(dst, reg, 2)))
  288. INSNE(addah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
  289. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  290. FIX1(FIX(op, 0x36)),
  291. OP3(ORREG1, OACST, OWREG1),
  292. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  293. ENC(dst, reg, 2)))
  294. INSN(addah, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
  295. FIX1(FIX(op, 5)),
  296. OP3(ORAREG1, OLCST, OWREG1),
  297. ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 1),
  298. ENC(dst, reg, 2)))
  299. INSNE(addaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  300. FIX1(FIX(op, 0x38)),
  301. OP3(ORREG1, ORREG1, OWREG1),
  302. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  303. ENC(dst, reg, 2)))
  304. INSNE(addaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X,
  305. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  306. FIX1(FIX(op, 0x3a)),
  307. OP3(ORREG1, OACST, OWREG1),
  308. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  309. ENC(dst, reg, 2)))
  310. INSN(addaw, d, adda_long, 1cycle, C64XP, TIC6X_FLAG_PREFER(0),
  311. FIX1(FIX(op, 7)),
  312. OP3(ORAREG1, OLCST, OWREG1),
  313. ENC4(ENC(s, fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 1),
  314. ENC(dst, reg, 2)))
  315. /* 16 bits insn */
  316. INSN(addaw, d, dx5, 1cycle, C64XP, TIC6X_FLAG_INSN16_BSIDE,
  317. FIX0(),
  318. OP3(ORB15REG1, OACST, OWREG1),
  319. ENC3(ENC(s, fu, 0), ENC(cst, ucst, 1), ENC(dst, reg, 2)))
  320. INSN(addaw, d, dx5p, 1cycle, C64XP, TIC6X_FLAG_INSN16_BSIDE,
  321. FIX1(FIX(op, 0)),
  322. OP3(ORB15REG1, OACST, OWB15REG1),
  323. ENC2(ENC(s, fu, 0), ENC(cst, ucst, 1)))
  324. /**/
  325. INSN(adddp, l, 1_or_2_src, addsubdp, C67X, 0,
  326. FIX1(FIX(op, 0x18)),
  327. OP3(ORREGD12, ORXREGD12, OWREGD67),
  328. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  329. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  330. INSN(adddp, s, l_1_or_2_src, addsubdp, C67XP, 0,
  331. FIX1(FIX(op, 0x72)),
  332. OP3(ORREGD12, ORXREGD12, OWREGD67),
  333. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  334. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  335. INSN(addk, s, addk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  336. FIX0(),
  337. OP2(OLCST, OWREG1),
  338. ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
  339. /* 16 bits insn */
  340. INSN(addk, s, sx5, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  341. FIX0(),
  342. OP2(OACST, OWREG1),
  343. ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
  344. /**/
  345. INSN(addkpc, s, addkpc, 1cycle, C64X,
  346. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_SIDE_B_ONLY,
  347. FIX1(FIX(s, 1)),
  348. OP3(OLCST, OWREG1, OACST),
  349. ENC3(ENC(src1, pcrel, 0), ENC(dst, reg, 1), ENC(src2, ucst, 2)))
  350. INSN(addsp, l, 1_or_2_src, 4cycle, C67X, 0,
  351. FIX1(FIX(op, 0x10)),
  352. OP3(ORREG1, ORXREG1, OWREG4),
  353. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  354. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  355. INSN(addsp, s, l_1_or_2_src, 4cycle, C67XP, 0,
  356. FIX1(FIX(op, 0x70)),
  357. OP3(ORREG1, ORXREG1, OWREG4),
  358. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  359. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  360. INSN(addsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
  361. FIX1(FIX(op, 0xc)),
  362. OP3(ORREG1, ORXREG1, OWREGD1),
  363. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  364. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  365. INSN(addsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
  366. FIX1(FIX(op, 0xd)),
  367. OP3(ORREG1, ORXREG1, OWREGD1),
  368. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  369. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  370. INSNE(addu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, 0,
  371. FIX1(FIX(op, 0x2b)),
  372. OP3(ORREG1, ORXREG1, OWREGL1),
  373. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  374. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  375. INSNE(addu, l_xui_ul_ul, l, 1_or_2_src, 1cycle, C62X, 0,
  376. FIX1(FIX(op, 0x29)),
  377. OP3(ORXREG1, ORREGL1, OWREGL1),
  378. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  379. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  380. INSN(add2, s, 1_or_2_src, 1cycle, C62X, 0,
  381. FIX1(FIX(op, 0x1)),
  382. OP3(ORREG1, ORXREG1, OWREG1),
  383. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  384. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  385. INSN(add2, l, 1_or_2_src, 1cycle, C64X, 0,
  386. FIX1(FIX(op, 0x5)),
  387. OP3(ORREG1, ORXREG1, OWREG1),
  388. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  389. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  390. INSN(add2, d, ext_1_or_2_src, 1cycle, C64X, 0,
  391. FIX1(FIX(op, 0x4)),
  392. OP3(ORREG1, ORXREG1, OWREG1),
  393. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  394. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  395. INSN(add4, l, 1_or_2_src, 1cycle, C64X, 0,
  396. FIX1(FIX(op, 0x65)),
  397. OP3(ORREG1, ORXREG1, OWREG1),
  398. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  399. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  400. INSNE(and, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  401. FIX1(FIX(op, 0x7b)),
  402. OP3(ORREG1, ORXREG1, OWREG1),
  403. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  404. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  405. INSNE(and, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  406. FIX1(FIX(op, 0x7a)),
  407. OP3(OACST, ORXREG1, OWREG1),
  408. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  409. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  410. INSNE(and, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  411. FIX1(FIX(op, 0x1f)),
  412. OP3(ORREG1, ORXREG1, OWREG1),
  413. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  414. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  415. INSNE(and, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  416. FIX1(FIX(op, 0x1e)),
  417. OP3(OACST, ORXREG1, OWREG1),
  418. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  419. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  420. INSNE(and, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
  421. FIX1(FIX(op, 0x6)),
  422. OP3(ORREG1, ORXREG1, OWREG1),
  423. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  424. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  425. INSNE(and, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
  426. FIX1(FIX(op, 0x7)),
  427. OP3(OACST, ORXREG1, OWREG1),
  428. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  429. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  430. /* 16 bits insn */
  431. INSN(and, l, l2c, 1cycle, C64XP, 0,
  432. FIX1(FIX(op, 0)),
  433. OP3(ORREG1, ORXREG1, OWREG1NORS),
  434. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  435. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  436. /**/
  437. INSN(andn, l, 1_or_2_src, 1cycle, C64X, 0,
  438. FIX1(FIX(op, 0x7c)),
  439. OP3(ORREG1, ORXREG1, OWREG1),
  440. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  441. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  442. INSN(andn, s, ext_1_or_2_src, 1cycle, C64X, 0,
  443. FIX1(FIX(op, 0x6)),
  444. OP3(ORREG1, ORXREG1, OWREG1),
  445. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  446. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  447. INSN(andn, d, ext_1_or_2_src, 1cycle, C64X, 0,
  448. FIX1(FIX(op, 0x0)),
  449. OP3(ORREG1, ORXREG1, OWREG1),
  450. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  451. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  452. INSN(avg2, m, compound, 1616_m, C64X, 0,
  453. FIX1(FIX(op, 0x13)),
  454. OP3(ORREG1, ORXREG1, OWREG2),
  455. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  456. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  457. INSN(avgu4, m, compound, 1616_m, C64X, 0,
  458. FIX1(FIX(op, 0x12)),
  459. OP3(ORREG1, ORXREG1, OWREG2),
  460. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  461. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  462. INSN(b, s, ext_branch_cond_imm, branch, C62X, TIC6X_FLAG_NO_CROSS,
  463. FIX0(),
  464. OP1(OLCST),
  465. ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
  466. INSN(b, s, branch, branch, C62X, TIC6X_FLAG_SIDE_B_ONLY,
  467. FIX1(FIX(s, 1)),
  468. OP1(ORXREG1),
  469. ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
  470. INSN(b, s, b_irp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
  471. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  472. OP1(ORIRP1),
  473. ENC0())
  474. INSN(b, s, b_nrp, branch, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY,
  475. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  476. OP1(ORNRP1),
  477. ENC0())
  478. INSN(bdec, s, bdec, branch, C64X, TIC6X_FLAG_NO_CROSS,
  479. FIX0(),
  480. OP2(OLCST, ORWREG1),
  481. ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
  482. INSN(bitc4, m, unary, 1616_m, C64X, 0,
  483. FIX1(FIX(op, 0x1e)),
  484. OP2(ORXREG1, OWREG2),
  485. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  486. ENC(dst, reg, 1)))
  487. INSN(bitr, m, unary, 1616_m, C64X, 0,
  488. FIX1(FIX(op, 0x1f)),
  489. OP2(ORXREG1, OWREG2),
  490. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  491. ENC(dst, reg, 1)))
  492. INSN(bnop, s, branch_nop_cst, branch, C64X,
  493. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
  494. FIX0(),
  495. OP2(OLCST, OACST),
  496. ENC3(ENC(s, fu, 0), ENC(src2, pcrel_half, 0), ENC(src1, ucst, 1)))
  497. INSN(bnop, nfu, s_branch_nop_cst, branch, C64XP,
  498. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP,
  499. FIX1(FIX(s, 0)),
  500. OP2(OLCST, OACST),
  501. ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
  502. INSN(bnop, s, branch_nop_reg, branch, C64X,
  503. TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP,
  504. FIX1(FIX(s, 1)),
  505. OP2(ORXREG1, OACST),
  506. ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
  507. /* 16 bits insn format */
  508. INSN(bnop, s, sbu8, branch, C64XP,
  509. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
  510. FIX0(),
  511. OP2(OLCST, OHWCST5),
  512. ENC2(ENC(s, fu, 0), ENC(cst, pcrel_half_unsigned, 0)))
  513. INSN(bnop, s, sbs7, branch, C64XP,
  514. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
  515. FIX0(),
  516. OP2(OLCST, OACST),
  517. ENC3(ENC(s, fu, 0), ENC(cst, pcrel_half, 0), ENC(n, ucst, 1)))
  518. INSN(bnop, s, sbu8c, branch, C64XP,
  519. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_INSN16_SPRED,
  520. FIX0(),
  521. OP2(OLCST, OHWCST5),
  522. ENC2(ENC(s, fu, 0), ENC(cst, pcrel_half_unsigned, 0)))
  523. INSN(bnop, s, sbs7c, branch, C64XP,
  524. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_INSN16_SPRED,
  525. FIX0(),
  526. OP2(OLCST, OACST),
  527. ENC3(ENC(s, fu, 0), ENC(cst, pcrel_half, 0), ENC(n, ucst, 1)))
  528. INSN(bnop, s, sx1b, branch, C64XP,
  529. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
  530. FIX0(),
  531. OP2(ORREG1BNORS, OACST),
  532. ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(n, ucst, 1)))
  533. /**/
  534. INSN(bpos, s, bpos, branch, C64X, TIC6X_FLAG_NO_CROSS,
  535. FIX0(),
  536. OP2(OLCST, ORREG1),
  537. ENC3(ENC(s, fu, 0), ENC(src, pcrel, 0), ENC(dst, reg, 1)))
  538. INSN(call, s, ext_branch_cond_imm, branch, C62X,
  539. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
  540. FIX0(),
  541. OP1(OLCST),
  542. ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
  543. INSN(call, s, branch, branch, C62X,
  544. TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
  545. FIX1(FIX(s, 1)),
  546. OP1(ORXREG1),
  547. ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
  548. INSN(call, s, b_irp, branch, C62X,
  549. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
  550. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  551. OP1(ORIRP1),
  552. ENC0())
  553. INSN(call, s, b_nrp, branch, C62X,
  554. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL,
  555. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  556. OP1(ORNRP1),
  557. ENC0())
  558. INSN(callnop, s, branch_nop_cst, branch, C64X,
  559. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
  560. FIX0(),
  561. OP2(OLCST, OACST),
  562. ENC3(ENC(s, fu, 0), ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
  563. INSN(callnop, nfu, s_branch_nop_cst, branch, C64XP,
  564. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
  565. FIX1(FIX(s, 0)),
  566. OP2(OLCST, OACST),
  567. ENC2(ENC(src2, pcrel, 0), ENC(src1, ucst, 1)))
  568. INSN(callnop, s, branch_nop_reg, branch, C64X,
  569. TIC6X_FLAG_MACRO|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MCNOP|TIC6X_FLAG_CALL,
  570. FIX1(FIX(s, 1)),
  571. OP2(ORXREG1, OACST),
  572. ENC3(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1)))
  573. INSN(callp, s, call_imm_nop, branch, C64XP,
  574. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
  575. FIX1(FIX(z, 1)),
  576. OP2(OLCST, OWRETREG1),
  577. ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
  578. /* 16 bits insn format */
  579. INSN(callp, s, scs10, branch, C64XP,
  580. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP,
  581. FIX0(),
  582. OP2(OLCST, OWRETREG1),
  583. ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
  584. /**/
  585. INSN(callret, s, ext_branch_cond_imm, branch, C62X,
  586. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
  587. FIX0(),
  588. OP1(OLCST),
  589. ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
  590. INSN(callret, s, branch, branch, C62X,
  591. TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
  592. FIX1(FIX(s, 1)),
  593. OP1(ORXREG1),
  594. ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
  595. INSN(callret, s, b_irp, branch, C62X,
  596. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
  597. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  598. OP1(ORIRP1),
  599. ENC0())
  600. INSN(callret, s, b_nrp, branch, C62X,
  601. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_CALL|TIC6X_FLAG_RETURN,
  602. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  603. OP1(ORNRP1),
  604. ENC0())
  605. INSN(clr, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  606. FIX1(FIX(op, 0x3)),
  607. OP4(ORREG1, OACST, OACST, OWREG1),
  608. ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
  609. ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
  610. INSN(clr, s, 1_or_2_src, 1cycle, C62X, 0,
  611. FIX1(FIX(op, 0x3f)),
  612. OP3(ORXREG1, ORREG1, OWREG1),
  613. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  614. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  615. /* 16 bits insn */
  616. INSN(clr, s, sc5, 1cycle, C64XP, 0,
  617. FIX1(FIX(op, 2)),
  618. OP4(ORREG1, OACST, OACST, OWREG1),
  619. ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1),
  620. ENC(cst, ucst, 2), ENC(srcdst, reg, 3)))
  621. /**/
  622. INSNE(cmpeq, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  623. FIX1(FIX(op, 0x53)),
  624. OP3(ORREG1, ORXREG1, OWREG1),
  625. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  626. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  627. INSNE(cmpeq, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  628. FIX1(FIX(op, 0x52)),
  629. OP3(OACST, ORXREG1, OWREG1),
  630. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  631. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  632. INSNE(cmpeq, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  633. FIX1(FIX(op, 0x51)),
  634. OP3(ORXREG1, ORREGL1, OWREG1),
  635. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  636. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  637. INSNE(cmpeq, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  638. FIX2(FIX(op, 0x50), FIX(x, 0)),
  639. OP3(OACST, ORREGL1, OWREG1),
  640. ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
  641. ENC(dst, reg, 2)))
  642. /* 16 bits insn */
  643. INSN(cmpeq, l, lx3c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  644. FIX0(),
  645. OP3(OACST, ORXREG1, OWREG1),
  646. ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
  647. ENC(dst, reg, 2)))
  648. INSN(cmpeq, l, l2c, 1cycle, C64XP, 0,
  649. FIX1(FIX(op, 3)),
  650. OP3(ORREG1, ORXREG1, OWREG1NORS),
  651. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  652. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  653. /**/
  654. INSN(cmpeq2, s, 1_or_2_src, 1cycle, C64X, 0,
  655. FIX1(FIX(op, 0x1d)),
  656. OP3(ORREG1, ORXREG1, OWREG1),
  657. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  658. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  659. INSN(cmpeq4, s, 1_or_2_src, 1cycle, C64X, 0,
  660. FIX1(FIX(op, 0x1c)),
  661. OP3(ORREG1, ORXREG1, OWREG1),
  662. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  663. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  664. INSN(cmpeqdp, s, 1_or_2_src, dpcmp, C67X, 0,
  665. FIX1(FIX(op, 0x28)),
  666. OP3(ORREGD12, ORXREGD12, OWREG2),
  667. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  668. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  669. INSN(cmpeqsp, s, 1_or_2_src, 1cycle, C67X, 0,
  670. FIX1(FIX(op, 0x38)),
  671. OP3(ORREG1, ORXREG1, OWREG1),
  672. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  673. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  674. INSNE(cmpgt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  675. FIX1(FIX(op, 0x47)),
  676. OP3(ORREG1, ORXREG1, OWREG1),
  677. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  678. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  679. INSNE(cmpgt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  680. FIX1(FIX(op, 0x46)),
  681. OP3(OACST, ORXREG1, OWREG1),
  682. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  683. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  684. INSNE(cmpgt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  685. FIX1(FIX(op, 0x45)),
  686. OP3(ORXREG1, ORREGL1, OWREG1),
  687. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  688. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  689. INSNE(cmpgt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  690. FIX2(FIX(op, 0x44), FIX(x, 0)),
  691. OP3(OACST, ORREGL1, OWREG1),
  692. ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
  693. ENC(dst, reg, 2)))
  694. INSNE(cmpgt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
  695. TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
  696. FIX1(FIX(op, 0x57)),
  697. OP3(ORXREG1, ORREG1, OWREG1),
  698. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
  699. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  700. INSNE(cmpgt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  701. FIX1(FIX(op, 0x56)),
  702. OP3(ORXREG1, OACST, OWREG1),
  703. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
  704. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  705. INSNE(cmpgt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  706. FIX1(FIX(op, 0x55)),
  707. OP3(ORREGL1, ORXREG1, OWREG1),
  708. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
  709. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  710. INSNE(cmpgt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
  711. TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
  712. FIX2(FIX(op, 0x54), FIX(x, 0)),
  713. OP3(ORREGL1, OACST, OWREG1),
  714. ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
  715. ENC(dst, reg, 2)))
  716. /* 16 bits insn */
  717. INSN(cmpgt, l, lx1c, 1cycle, C64XP, 0,
  718. FIX1(FIX(op, 1)),
  719. OP3(OACST, ORREG1, OWREG1),
  720. ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
  721. ENC(dst, reg, 2)))
  722. INSN(cmpgt, l, l2c, 1cycle, C64XP, 0,
  723. FIX1(FIX(op, 5)),
  724. OP3(ORREG1, ORXREG1, OWREG1NORS),
  725. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  726. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  727. /**/
  728. INSN(cmpgt2, s, 1_or_2_src, 1cycle, C64X, 0,
  729. FIX1(FIX(op, 0x14)),
  730. OP3(ORREG1, ORXREG1, OWREG1),
  731. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  732. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  733. INSN(cmpgtdp, s, 1_or_2_src, dpcmp, C67X, 0,
  734. FIX1(FIX(op, 0x29)),
  735. OP3(ORREGD12, ORXREGD12, OWREG2),
  736. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  737. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  738. INSN(cmpgtsp, s, 1_or_2_src, 1cycle, C67X, 0,
  739. FIX1(FIX(op, 0x39)),
  740. OP3(ORREG1, ORXREG1, OWREG1),
  741. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  742. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  743. INSNE(cmpgtu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  744. FIX1(FIX(op, 0x4f)),
  745. OP3(ORREG1, ORXREG1, OWREG1),
  746. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  747. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  748. INSNE(cmpgtu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  749. FIX2(FIX(op, 0x4e), RAN(src1, 0, 15)),
  750. OP3(OACST, ORXREG1, OWREG1),
  751. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
  752. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  753. /* Although not mentioned in SPRUFE8, CMPGTU and CMPLTU support a
  754. 5-bit unsigned constant operand on C64X and above. */
  755. INSNE(cmpgtu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
  756. FIX2(FIX(op, 0x4e), RAN(src1, 16, 31)),
  757. OP3(OACST, ORXREG1, OWREG1),
  758. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
  759. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  760. INSNE(cmpgtu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  761. FIX1(FIX(op, 0x4d)),
  762. OP3(ORXREG1, ORREGL1, OWREG1),
  763. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  764. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  765. INSNE(cmpgtu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
  766. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  767. FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 0, 15)),
  768. OP3(OACST, ORREGL1, OWREG1),
  769. ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
  770. ENC(dst, reg, 2)))
  771. INSNE(cmpgtu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
  772. FIX3(FIX(op, 0x4c), FIX(x, 0), RAN(src1, 16, 31)),
  773. OP3(OACST, ORREGL1, OWREG1),
  774. ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
  775. ENC(dst, reg, 2)))
  776. /* 16 bits insn */
  777. INSN(cmpgtu, l, lx1c, 1cycle, C64XP, 0,
  778. FIX1(FIX(op, 3)),
  779. OP3(OACST, ORREG1, OWREG1),
  780. ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
  781. ENC(dst, reg, 2)))
  782. INSN(cmpgtu, l, l2c, 1cycle, C64XP, 0,
  783. FIX1(FIX(op, 7)),
  784. OP3(ORREG1, ORXREG1, OWREG1NORS),
  785. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  786. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  787. /**/
  788. INSN(cmpgtu4, s, 1_or_2_src, 1cycle, C64X, 0,
  789. FIX1(FIX(op, 0x15)),
  790. OP3(ORREG1, ORXREG1, OWREG1),
  791. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  792. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  793. INSNE(cmplt, l_si_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  794. FIX1(FIX(op, 0x57)),
  795. OP3(ORREG1, ORXREG1, OWREG1),
  796. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  797. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  798. INSNE(cmplt, l_s5_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  799. FIX1(FIX(op, 0x56)),
  800. OP3(OACST, ORXREG1, OWREG1),
  801. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  802. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  803. INSNE(cmplt, l_xsi_sl_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  804. FIX1(FIX(op, 0x55)),
  805. OP3(ORXREG1, ORREGL1, OWREG1),
  806. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  807. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  808. INSNE(cmplt, l_s5_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  809. FIX2(FIX(op, 0x54), FIX(x, 0)),
  810. OP3(OACST, ORREGL1, OWREG1),
  811. ENC4(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(src2, reg, 1),
  812. ENC(dst, reg, 2)))
  813. INSNE(cmplt, l_xsi_si_ui, l, 1_or_2_src, 1cycle, C62X,
  814. TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
  815. FIX1(FIX(op, 0x47)),
  816. OP3(ORXREG1, ORREG1, OWREG1),
  817. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
  818. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  819. INSNE(cmplt, l_xsi_s5_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  820. FIX1(FIX(op, 0x46)),
  821. OP3(ORXREG1, OACST, OWREG1),
  822. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 1),
  823. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  824. INSNE(cmplt, l_sl_xsi_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  825. FIX1(FIX(op, 0x45)),
  826. OP3(ORREGL1, ORXREG1, OWREG1),
  827. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 1),
  828. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  829. INSNE(cmplt, l_sl_s5_ui, l, 1_or_2_src, 1cycle, C62X,
  830. TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
  831. FIX2(FIX(op, 0x44), FIX(x, 0)),
  832. OP3(ORREGL1, OACST, OWREG1),
  833. ENC4(ENC(s, fu, 0), ENC(src1, scst, 1), ENC(src2, reg, 0),
  834. ENC(dst, reg, 2)))
  835. /* 16 bits insn */
  836. INSN(cmplt, l, lx1c, 1cycle, C64XP, 0,
  837. FIX1(FIX(op, 0)),
  838. OP3(OACST, ORREG1, OWREG1),
  839. ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
  840. ENC(dst, reg, 2)))
  841. INSN(cmplt, l, l2c, 1cycle, C64XP, 0,
  842. FIX1(FIX(op, 4)),
  843. OP3(ORREG1, ORXREG1, OWREG1NORS),
  844. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  845. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  846. /**/
  847. INSN(cmplt2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
  848. FIX1(FIX(op, 0x14)),
  849. OP3(ORXREG1, ORREG1, OWREG1),
  850. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  851. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  852. INSN(cmpltdp, s, 1_or_2_src, dpcmp, C67X, 0,
  853. FIX1(FIX(op, 0x2a)),
  854. OP3(ORREGD12, ORXREGD12, OWREG2),
  855. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  856. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  857. INSN(cmpltsp, s, 1_or_2_src, 1cycle, C67X, 0,
  858. FIX1(FIX(op, 0x3a)),
  859. OP3(ORREG1, ORXREG1, OWREG1),
  860. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  861. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  862. INSNE(cmpltu, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  863. FIX1(FIX(op, 0x5f)),
  864. OP3(ORREG1, ORXREG1, OWREG1),
  865. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  866. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  867. INSNE(cmpltu, l_u4_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  868. FIX2(FIX(op, 0x5e), RAN(src1, 0, 15)),
  869. OP3(OACST, ORXREG1, OWREG1),
  870. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
  871. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  872. INSNE(cmpltu, l_u5_xui_ui, l, 1_or_2_src, 1cycle, C64X, 0,
  873. FIX2(FIX(op, 0x5e), RAN(src1, 16, 31)),
  874. OP3(OACST, ORXREG1, OWREG1),
  875. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, ucst, 0),
  876. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  877. INSNE(cmpltu, l_xui_ul_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  878. FIX1(FIX(op, 0x5d)),
  879. OP3(ORXREG1, ORREGL1, OWREG1),
  880. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  881. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  882. INSNE(cmpltu, l_u4_ul_ui, l, 1_or_2_src, 1cycle, C62X,
  883. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  884. FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 0, 15)),
  885. OP3(OACST, ORREGL1, OWREG1),
  886. ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
  887. ENC(dst, reg, 2)))
  888. INSNE(cmpltu, l_u5_ul_ui, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
  889. FIX3(FIX(op, 0x5c), FIX(x, 0), RAN(src1, 16, 31)),
  890. OP3(OACST, ORREGL1, OWREG1),
  891. ENC4(ENC(s, fu, 0), ENC(src1, ucst, 0), ENC(src2, reg, 1),
  892. ENC(dst, reg, 2)))
  893. /* 16 bits insn */
  894. INSN(cmpltu, l, lx1c, 1cycle, C64XP, 0,
  895. FIX1(FIX(op, 2)),
  896. OP3(OACST, ORREG1, OWREG1),
  897. ENC4(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(src2, reg, 1),
  898. ENC(dst, reg, 2)))
  899. INSN(cmpltu, l, l2c, 1cycle, C64XP, 0,
  900. FIX1(FIX(op, 6)),
  901. OP3(ORREG1, ORXREG1, OWREG1NORS),
  902. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  903. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  904. /**/
  905. INSN(cmpltu4, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
  906. FIX1(FIX(op, 0x15)),
  907. OP3(ORXREG1, ORREG1, OWREG1),
  908. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  909. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  910. INSN(cmpy, m, 1_or_2_src, 4cycle, C64XP, 0,
  911. FIX1(FIX(op, 0xa)),
  912. OP3(ORREG1, ORXREG1, OWREGD4),
  913. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  914. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  915. INSN(cmpyr, m, 1_or_2_src, 4cycle, C64XP, 0,
  916. FIX1(FIX(op, 0xb)),
  917. OP3(ORREG1, ORXREG1, OWREG4),
  918. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  919. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  920. INSN(cmpyr1, m, 1_or_2_src, 4cycle, C64XP, 0,
  921. FIX1(FIX(op, 0xc)),
  922. OP3(ORREG1, ORXREG1, OWREG4),
  923. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  924. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  925. INSN(cmtl, d, 1_or_2_src, load, C64XP,
  926. TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
  927. FIX3(FIX(s, 1), FIX(op, 0xe), FIX(src1, 0)),
  928. OP2(ORMEMDW, OWDREG5),
  929. ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
  930. INSN(ddotp4, m, 1_or_2_src, 4cycle, C64XP, 0,
  931. FIX1(FIX(op, 0x18)),
  932. OP3(ORREG1, ORXREG1, OWREGD4),
  933. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  934. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  935. INSN(ddotph2, m, 1_or_2_src, 4cycle, C64XP, 0,
  936. FIX1(FIX(op, 0x17)),
  937. OP3(ORREGD1, ORXREG1, OWREGD4),
  938. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  939. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  940. INSN(ddotph2r, m, 1_or_2_src, 4cycle, C64XP, 0,
  941. FIX1(FIX(op, 0x15)),
  942. OP3(ORREGD1, ORXREG1, OWREG4),
  943. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  944. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  945. INSN(ddotpl2, m, 1_or_2_src, 4cycle, C64XP, 0,
  946. FIX1(FIX(op, 0x16)),
  947. OP3(ORREGD1, ORXREG1, OWREGD4),
  948. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  949. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  950. INSN(ddotpl2r, m, 1_or_2_src, 4cycle, C64XP, 0,
  951. FIX1(FIX(op, 0x14)),
  952. OP3(ORREGD1, ORXREG1, OWREG4),
  953. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  954. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  955. INSN(deal, m, unary, 1616_m, C64X, 0,
  956. FIX1(FIX(op, 0x1d)),
  957. OP2(ORXREG1, OWREG2),
  958. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  959. ENC(dst, reg, 1)))
  960. INSN(dint, nfu, dint, 1cycle, C64XP, 0,
  961. FIX1(FIX(s, 0)),
  962. OP0(),
  963. ENC0())
  964. INSN(dmv, s, ext_1_or_2_src, 1cycle, C64XP, 0,
  965. FIX1(FIX(op, 0xb)),
  966. OP3(ORREG1, ORXREG1, OWREGD1),
  967. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  968. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  969. INSNE(dotp2, m_s2_xs2_si, m, compound, 4cycle, C64X, 0,
  970. FIX1(FIX(op, 0xc)),
  971. OP3(ORREG1, ORXREG1, OWREG4),
  972. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  973. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  974. INSNE(dotp2, m_s2_xs2_sll, m, compound, 4cycle, C64X, 0,
  975. FIX1(FIX(op, 0xb)),
  976. OP3(ORREG1, ORXREG1, OWREGD4),
  977. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  978. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  979. INSN(dotpn2, m, compound, 4cycle, C64X, 0,
  980. FIX1(FIX(op, 0x9)),
  981. OP3(ORREG1, ORXREG1, OWREG4),
  982. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  983. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  984. INSN(dotpnrsu2, m, compound, 4cycle, C64X, 0,
  985. FIX1(FIX(op, 0x7)),
  986. OP3(ORREG1, ORXREG1, OWREG4),
  987. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  988. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  989. INSN(dotpnrus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  990. FIX1(FIX(op, 0x7)),
  991. OP3(ORXREG1, ORREG1, OWREG4),
  992. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  993. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  994. INSN(dotprsu2, m, compound, 4cycle, C64X, 0,
  995. FIX1(FIX(op, 0xd)),
  996. OP3(ORREG1, ORXREG1, OWREG4),
  997. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  998. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  999. INSN(dotprus2, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  1000. FIX1(FIX(op, 0xd)),
  1001. OP3(ORXREG1, ORREG1, OWREG4),
  1002. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1003. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1004. INSN(dotpsu4, m, compound, 4cycle, C64X, 0,
  1005. FIX1(FIX(op, 0x2)),
  1006. OP3(ORREG1, ORXREG1, OWREG4),
  1007. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1008. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1009. INSN(dotpus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  1010. FIX1(FIX(op, 0x2)),
  1011. OP3(ORXREG1, ORREG1, OWREG4),
  1012. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1013. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1014. INSN(dotpu4, m, compound, 4cycle, C64X, 0,
  1015. FIX1(FIX(op, 0x6)),
  1016. OP3(ORREG1, ORXREG1, OWREG4),
  1017. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1018. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1019. INSN(dpack2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
  1020. FIX1(FIX(op, 0x34)),
  1021. OP3(ORREG1, ORXREG1, OWREGD1),
  1022. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1023. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1024. INSN(dpackx2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
  1025. FIX1(FIX(op, 0x33)),
  1026. OP3(ORREG1, ORXREG1, OWREGD1),
  1027. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1028. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1029. INSN(dpint, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
  1030. FIX2(FIX(op, 0x8), FIX(x, 0)),
  1031. OP2(ORREGD1, OWREG4),
  1032. ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
  1033. ENC(dst, reg, 1)))
  1034. INSN(dpsp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
  1035. FIX2(FIX(op, 0x9), FIX(x, 0)),
  1036. OP2(ORREGD1, OWREG4),
  1037. ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
  1038. ENC(dst, reg, 1)))
  1039. INSN(dptrunc, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_NO_CROSS,
  1040. FIX2(FIX(op, 0x1), FIX(x, 0)),
  1041. OP2(ORREGD1, OWREG4),
  1042. ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
  1043. ENC(dst, reg, 1)))
  1044. INSN(ext, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  1045. FIX1(FIX(op, 0x1)),
  1046. OP4(ORREG1, OACST, OACST, OWREG1),
  1047. ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
  1048. ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
  1049. INSN(ext, s, 1_or_2_src, 1cycle, C62X, 0,
  1050. FIX1(FIX(op, 0x2f)),
  1051. OP3(ORXREG1, ORREG1, OWREG1),
  1052. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1053. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1054. /* 16 bits insn */
  1055. INSNE(ext, hwcst16, s, s2ext, 1cycle, C64XP, 0,
  1056. FIX1(FIX(op, 0x0)),
  1057. OP4(ORREG1, OHWCST16, OHWCST16, OWREG1),
  1058. ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
  1059. INSNE(ext, hwcst24, s, s2ext, 1cycle, C64XP, 0,
  1060. FIX1(FIX(op, 0x1)),
  1061. OP4(ORREG1, OHWCST24, OHWCST24, OWREG1),
  1062. ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
  1063. /**/
  1064. INSN(extu, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  1065. FIX1(FIX(op, 0x0)),
  1066. OP4(ORREG1, OACST, OACST, OWREG1),
  1067. ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
  1068. ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
  1069. INSN(extu, s, 1_or_2_src, 1cycle, C62X, 0,
  1070. FIX1(FIX(op, 0x2b)),
  1071. OP3(ORXREG1, ORREG1, OWREG1),
  1072. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1073. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1074. /* 16 bits insn */
  1075. INSNE(extu, hwcst16, s, s2ext, 1cycle, C64XP, 0,
  1076. FIX1(FIX(op, 0x2)),
  1077. OP4(ORREG1, OHWCST16, OHWCST16, OWREG1),
  1078. ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
  1079. INSNE(extu, hwcst24, s, s2ext, 1cycle, C64XP, 0,
  1080. FIX1(FIX(op, 0x3)),
  1081. OP4(ORREG1, OHWCST24, OHWCST24, OWREG1),
  1082. ENC3(ENC(s, fu, 0), ENC(src, reg, 0), ENC(dst, reg, 3)))
  1083. INSN(extu, s, sc5, 1cycle, C64XP, 0,
  1084. FIX1(FIX(op, 0)),
  1085. OP4(ORREG1, OACST, OHWCST31, OWREG1Z),
  1086. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1)))
  1087. /**/
  1088. INSN(gmpy, m, 1_or_2_src, 4cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1089. FIX2(FIX(op, 0x1f), FIX(x, 0)),
  1090. OP3(ORREG1, ORREG1, OWREG4),
  1091. ENC4(ENC(s, fu, 0), ENC(src1, reg, 0), ENC(src2, reg, 1),
  1092. ENC(dst, reg, 2)))
  1093. /* This instruction can be predicated as usual; SPRUFE8 is incorrect
  1094. where it shows the "z" field as fixed to 1. */
  1095. INSN(gmpy4, m, compound, 4cycle, C64X, 0,
  1096. FIX1(FIX(op, 0x11)),
  1097. OP3(ORREG1, ORXREG1, OWREG4),
  1098. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1099. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1100. INSN(idle, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MCNOP,
  1101. FIX2(FIX(s, 0), FIX(op, 0xf)),
  1102. OP0(),
  1103. ENC0())
  1104. INSN(intdp, l, 1_or_2_src, intdp, C67X, 0,
  1105. FIX2(FIX(op, 0x39), FIX(src1, 0)),
  1106. OP2(ORXREG1, OWREGD45),
  1107. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1108. ENC(dst, reg, 1)))
  1109. INSN(intdpu, l, 1_or_2_src, intdp, C67X, 0,
  1110. FIX2(FIX(op, 0x3b), FIX(src1, 0)),
  1111. OP2(ORXREG1, OWREGD45),
  1112. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1113. ENC(dst, reg, 1)))
  1114. INSN(intsp, l, 1_or_2_src, 4cycle, C67X, 0,
  1115. FIX2(FIX(op, 0x4a), FIX(src1, 0)),
  1116. OP2(ORXREG1, OWREG4),
  1117. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1118. ENC(dst, reg, 1)))
  1119. INSN(intspu, l, 1_or_2_src, 4cycle, C67X, 0,
  1120. FIX2(FIX(op, 0x49), FIX(src1, 0)),
  1121. OP2(ORXREG1, OWREG4),
  1122. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1123. ENC(dst, reg, 1)))
  1124. INSN(ldb, d, load_store, load, C62X,
  1125. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  1126. FIX2(FIX(op, 2), FIX(r, 0)),
  1127. OP2(ORMEMSB, OWDREG5),
  1128. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1129. ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
  1130. ENC(srcdst, reg, 1)))
  1131. INSN(ldb, d, load_store_long, load, C62X,
  1132. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  1133. FIX1(FIX(op, 2)),
  1134. OP2(ORMEMLB, OWDREG5),
  1135. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
  1136. ENC(dst, reg, 1)))
  1137. /* 16 bits insn */
  1138. INSN(ldb, d, doff4_dsz_x01, load, C64XP,
  1139. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1140. FIX2(FIX(op, 1), FIX(sz, 1)),
  1141. OP2(ORMEMSB, OWTREG5),
  1142. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1143. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
  1144. INSN(ldb, d, dind_dsz_x01, load, C64XP,
  1145. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1146. FIX2(FIX(op, 1), FIX(sz, 1)),
  1147. OP2(ORMEMSB, OWTREG5),
  1148. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1149. ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
  1150. INSN(ldb, d, dinc_dsz_x01, load, C64XP,
  1151. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1152. FIX2(FIX(op, 1), FIX(sz, 1)),
  1153. OP2(ORMEMSB, OWTREG5),
  1154. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1155. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1156. INSN(ldb, d, ddec_dsz_x01, load, C64XP,
  1157. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1158. FIX2(FIX(op, 1), FIX(sz, 1)),
  1159. OP2(ORMEMSB, OWTREG5),
  1160. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1161. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1162. /**/
  1163. INSN(ldbu, d, load_store, load, C62X,
  1164. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  1165. FIX2(FIX(op, 1), FIX(r, 0)),
  1166. OP2(ORMEMSB, OWDREG5),
  1167. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1168. ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
  1169. ENC(srcdst, reg, 1)))
  1170. INSN(ldbu, d, load_store_long, load, C62X,
  1171. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  1172. FIX1(FIX(op, 1)),
  1173. OP2(ORMEMLB, OWDREG5),
  1174. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_byte, 0),
  1175. ENC(dst, reg, 1)))
  1176. /* 16 bits insn */
  1177. INSN(ldbu, d, dinc_dsz_000, load, C64XP,
  1178. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1179. FIX2(FIX(op, 1), FIX(sz, 1)),
  1180. OP2(ORMEMSB, OWTREG5),
  1181. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_minus_one, 0),
  1182. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
  1183. INSN(ldbu, d, dind_dsz_000, load, C64XP,
  1184. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1185. FIX2(FIX(op, 1), FIX(sz, 1)),
  1186. OP2(ORMEMSB, OWTREG5),
  1187. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 0),
  1188. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
  1189. INSN(ldbu, d, doff4_dsz_000, load, C64XP,
  1190. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1191. FIX2(FIX(op, 1), FIX(sz, 1)),
  1192. OP2(ORMEMSB, OWTREG5),
  1193. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
  1194. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
  1195. INSN(ldbu, d, ddec_dsz_000, load, C64XP,
  1196. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1197. FIX2(FIX(op, 1), FIX(sz, 1)),
  1198. OP2(ORMEMSB, OWTREG5),
  1199. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_minus_one, 0),
  1200. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
  1201. /**/
  1202. INSN(lddw, d, load_store, load, C64X_AND_C67X,
  1203. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS,
  1204. FIX2(FIX(op, 6), FIX(r, 1)),
  1205. OP2(ORMEMSD, OWDREGD5),
  1206. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1207. ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
  1208. ENC(srcdst, reg, 1)))
  1209. /* 16 bits insn */
  1210. INSN(lddw, d, dpp, load, C64XP,
  1211. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREINCR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
  1212. FIX2(FIX(op, 1), FIX(dw, 1)),
  1213. OP2(ORMEMSD, OWDREGD5),
  1214. ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1215. ENC(cst, mem_offset_minus_one, 0)))
  1216. INSN(lddw, d, ddecdw, load, C64XP,
  1217. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1218. FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
  1219. OP2(ORMEMSD, OWTREGD5),
  1220. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
  1221. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1222. INSN(lddw, d, dincdw, load, C64XP,
  1223. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1224. FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
  1225. OP2(ORMEMSD, OWTREGD5),
  1226. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
  1227. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1228. INSN(lddw, d, dinddw, load, C64XP,
  1229. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1230. FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
  1231. OP2(ORMEMSD, OWTREGD5),
  1232. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 0),
  1233. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
  1234. INSN(lddw, d, doff4dw, load, C64XP,
  1235. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1236. FIX3(FIX(op, 1), FIX(na, 0), FIX(sz, 0)),
  1237. OP2(ORMEMSD, OWTREGD5),
  1238. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
  1239. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
  1240. /**/
  1241. INSN(ldh, d, load_store, load, C62X,
  1242. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  1243. FIX2(FIX(op, 4), FIX(r, 0)),
  1244. OP2(ORMEMSH, OWDREG5),
  1245. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1246. ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
  1247. ENC(srcdst, reg, 1)))
  1248. INSN(ldh, d, load_store_long, load, C62X,
  1249. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  1250. FIX1(FIX(op, 4)),
  1251. OP2(ORMEMLH, OWDREG5),
  1252. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
  1253. ENC(dst, reg, 1)))
  1254. /* 16 bits insn */
  1255. INSN(ldh, d, doff4_dsz_x11, load, C64XP,
  1256. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1257. FIX2(FIX(op, 1), FIX(sz, 1)),
  1258. OP2(ORMEMSH, OWTREG5),
  1259. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
  1260. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
  1261. INSN(ldh, d, dind_dsz_x11, load, C64XP,
  1262. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1263. FIX2(FIX(op, 1), FIX(sz, 1)),
  1264. OP2(ORMEMSH, OWTREG5),
  1265. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1266. ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
  1267. INSN(ldh, d, dinc_dsz_x11, load, C64XP,
  1268. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1269. FIX2(FIX(op, 1), FIX(sz, 1)),
  1270. OP2(ORMEMSH, OWTREG5),
  1271. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1272. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1273. INSN(ldh, d, ddec_dsz_x11, load, C64XP,
  1274. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1275. FIX2(FIX(op, 1), FIX(sz, 1)),
  1276. OP2(ORMEMSH, OWTREG5),
  1277. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1278. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1279. /**/
  1280. INSN(ldhu, d, load_store, load, C62X,
  1281. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  1282. FIX2(FIX(op, 0), FIX(r, 0)),
  1283. OP2(ORMEMSH, OWDREG5),
  1284. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1285. ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
  1286. ENC(srcdst, reg, 1)))
  1287. INSN(ldhu, d, load_store_long, load, C62X,
  1288. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  1289. FIX1(FIX(op, 0)),
  1290. OP2(ORMEMLH, OWDREG5),
  1291. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_half, 0),
  1292. ENC(dst, reg, 1)))
  1293. /* 16 bits insn */
  1294. INSN(ldhu, d, doff4_dsz_010, load, C64XP,
  1295. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1296. FIX2(FIX(op, 1), FIX(sz, 1)),
  1297. OP2(ORMEMSH, OWTREG5),
  1298. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 0),
  1299. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg, 1)))
  1300. INSN(ldhu, d, dind_dsz_010, load, C64XP,
  1301. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1302. FIX2(FIX(op, 1), FIX(sz, 1)),
  1303. OP2(ORMEMSH, OWTREG5),
  1304. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1305. ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
  1306. INSN(ldhu, d, dinc_dsz_010, load, C64XP,
  1307. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1308. FIX2(FIX(op, 1), FIX(sz, 1)),
  1309. OP2(ORMEMSH, OWTREG5),
  1310. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1311. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1312. INSN(ldhu, d, ddec_dsz_010, load, C64XP,
  1313. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1314. FIX2(FIX(op, 1), FIX(sz, 1)),
  1315. OP2(ORMEMSH, OWTREG5),
  1316. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1317. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1318. /**/
  1319. INSN(ldndw, d, load_nonaligned, load, C64X,
  1320. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
  1321. FIX0(),
  1322. OP2(ORMEMND, OWDREGD5),
  1323. ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1324. ENC(offsetR, mem_offset_noscale, 0), ENC(baseR, reg, 0),
  1325. ENC(sc, scaled, 0), ENC(dst, reg_shift, 1)))
  1326. /* 16 bits insn */
  1327. INSN(ldndw, d, ddecdw, load, C64XP,
  1328. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1329. FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
  1330. OP2(ORMEMND, OWTREGD5),
  1331. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
  1332. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one_noscale, 0)))
  1333. INSN(ldndw, d, dincdw, load, C64XP,
  1334. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1335. FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
  1336. OP2(ORMEMND, OWTREGD5),
  1337. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 1),
  1338. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one_noscale, 0)))
  1339. INSN(ldndw, d, dinddw, load, C64XP,
  1340. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1341. FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
  1342. OP2(ORMEMND, OWTREGD5),
  1343. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset_noscale, 0),
  1344. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
  1345. INSN(ldndw, d, doff4dw, load, C64XP,
  1346. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1347. FIX3(FIX(op, 1), FIX(na, 1), FIX(sz, 0)),
  1348. OP2(ORMEMND, OWTREGD5),
  1349. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_noscale, 0),
  1350. ENC(ptr, reg_ptr, 0), ENC(srcdst, reg_shift, 1)))
  1351. /**/
  1352. INSN(ldnw, d, load_store, load, C64X,
  1353. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
  1354. FIX2(FIX(op, 3), FIX(r, 1)),
  1355. OP2(ORMEMSW, OWDREG5),
  1356. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1357. ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
  1358. ENC(srcdst, reg, 1)))
  1359. /* 16 bits insn */
  1360. INSN(ldnw, d, doff4_dsz_110, load, C64XP,
  1361. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1362. FIX2(FIX(op, 1), FIX(sz, 1)),
  1363. OP2(ORMEMSW, OWTREG5),
  1364. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1365. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
  1366. INSN(ldnw, d, dind_dsz_110, load, C64XP,
  1367. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1368. FIX2(FIX(op, 1), FIX(sz, 1)),
  1369. OP2(ORMEMSW, OWTREG5),
  1370. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1371. ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
  1372. INSN(ldnw, d, dinc_dsz_110, load, C64XP,
  1373. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1374. FIX2(FIX(op, 1), FIX(sz, 1)),
  1375. OP2(ORMEMSW, OWTREG5),
  1376. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1377. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1378. INSN(ldnw, d, ddec_dsz_110, load, C64XP,
  1379. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1380. FIX2(FIX(op, 1), FIX(sz, 1)),
  1381. OP2(ORMEMSW, OWTREG5),
  1382. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1383. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1384. /**/
  1385. INSN(ldw, d, load_store, load, C62X,
  1386. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  1387. FIX2(FIX(op, 6), FIX(r, 0)),
  1388. OP2(ORMEMSW, OWDREG5),
  1389. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 0),
  1390. ENC(offsetR, mem_offset, 0), ENC(baseR, reg, 0),
  1391. ENC(srcdst, reg, 1)))
  1392. INSN(ldw, d, load_store_long, load, C62X,
  1393. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  1394. FIX1(FIX(op, 6)),
  1395. OP2(ORMEMLW, OWDREG5),
  1396. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 0), ENC(offsetR, ulcst_dpr_word, 0),
  1397. ENC(dst, reg, 1)))
  1398. /* 16 bits insn */
  1399. INSN(ldw, d, doff4_dsz_0xx, load, C64XP,
  1400. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1401. FIX2(FIX(op, 1), FIX(sz, 0)),
  1402. OP2(ORMEMSW, OWTREG5),
  1403. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1404. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
  1405. INSN(ldw, d, doff4_dsz_100, load, C64XP,
  1406. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  1407. FIX2(FIX(op, 1), FIX(sz, 1)),
  1408. OP2(ORMEMSW, OWTREG5),
  1409. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1410. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset, 0)))
  1411. INSN(ldw, d, dind_dsz_0xx, load, C64XP,
  1412. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1413. FIX2(FIX(op, 1), FIX(sz, 0)),
  1414. OP2(ORMEMSW, OWTREG5),
  1415. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1416. ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
  1417. INSN(ldw, d, dind_dsz_100, load, C64XP,
  1418. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  1419. FIX2(FIX(op, 1), FIX(sz, 1)),
  1420. OP2(ORMEMSW, OWTREG5),
  1421. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1422. ENC(ptr, reg_ptr, 0), ENC(src1, mem_offset, 0)))
  1423. INSN(ldw, d, dinc_dsz_0xx, load, C64XP,
  1424. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1425. FIX2(FIX(op, 1), FIX(sz, 0)),
  1426. OP2(ORMEMSW, OWTREG5),
  1427. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1428. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1429. INSN(ldw, d, dinc_dsz_100, load, C64XP,
  1430. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  1431. FIX2(FIX(op, 1), FIX(sz, 1)),
  1432. OP2(ORMEMSW, OWTREG5),
  1433. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1434. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1435. INSN(ldw, d, ddec_dsz_0xx, load, C64XP,
  1436. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1437. FIX2(FIX(op, 1), FIX(sz, 0)),
  1438. OP2(ORMEMSW, OWTREG5),
  1439. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1440. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1441. INSN(ldw, d, ddec_dsz_100, load, C64XP,
  1442. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  1443. FIX2(FIX(op, 1), FIX(sz, 1)),
  1444. OP2(ORMEMSW, OWTREG5),
  1445. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1446. ENC(ptr, reg_ptr, 0), ENC(cst, mem_offset_minus_one, 0)))
  1447. INSN(ldw, d, dpp, load, C64XP,
  1448. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREINCR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
  1449. FIX2(FIX(op, 1), FIX(dw, 0)),
  1450. OP2(ORMEMSW, OWTREG5),
  1451. ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1452. ENC(cst, mem_offset_minus_one, 0)))
  1453. INSN(ldw, d, dstk, load, C64XP,
  1454. TIC6X_FLAG_LOAD|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE)|TIC6X_FLAG_INSN16_B15PTR,
  1455. FIX2(FIX(op, 0x1), FIX(s, 1)),
  1456. OP2(ORMEMSW, OWTREG5),
  1457. ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 1),
  1458. ENC(cst, mem_offset, 0)))
  1459. /**/
  1460. INSN(ll, d, 1_or_2_src, load, C64XP,
  1461. TIC6X_FLAG_LOAD|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
  1462. FIX3(FIX(s, 1), FIX(op, 0xc), FIX(src1, 0)),
  1463. OP2(ORMEMDW, OWDREG5),
  1464. ENC2(ENC(src2, reg, 0), ENC(dst, reg, 1)))
  1465. INSNE(lmbd, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  1466. FIX1(FIX(op, 0x6b)),
  1467. OP3(ORREG1, ORXREG1, OWREG1),
  1468. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1469. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1470. INSNE(lmbd, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  1471. FIX1(FIX(op, 0x6a)),
  1472. OP3(OACST, ORXREG1, OWREG1),
  1473. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1474. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1475. INSN(max2, l, 1_or_2_src, 1cycle, C64X, 0,
  1476. FIX1(FIX(op, 0x42)),
  1477. OP3(ORREG1, ORXREG1, OWREG1),
  1478. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1479. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1480. INSN(max2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
  1481. FIX1(FIX(op, 0xd)),
  1482. OP3(ORREG1, ORXREG1, OWREG1),
  1483. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1484. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1485. INSN(maxu4, l, 1_or_2_src, 1cycle, C64X, 0,
  1486. FIX1(FIX(op, 0x43)),
  1487. OP3(ORREG1, ORXREG1, OWREG1),
  1488. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1489. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1490. INSN(min2, l, 1_or_2_src, 1cycle, C64X, 0,
  1491. FIX1(FIX(op, 0x41)),
  1492. OP3(ORREG1, ORXREG1, OWREG1),
  1493. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1494. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1495. INSN(min2, s, ext_1_or_2_src, 1cycle, C64XP, 0,
  1496. FIX1(FIX(op, 0xc)),
  1497. OP3(ORREG1, ORXREG1, OWREG1),
  1498. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1499. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1500. INSN(minu4, l, 1_or_2_src, 1cycle, C64X, 0,
  1501. FIX1(FIX(op, 0x48)),
  1502. OP3(ORREG1, ORXREG1, OWREG1),
  1503. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1504. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1505. INSNE(mpy, m_sl16_xsl16_si, m, mpy, 1616_m, C62X, 0,
  1506. FIX1(FIX(op, 0x19)),
  1507. OP3(ORREG1, ORXREG1, OWREG2),
  1508. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1509. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1510. INSNE(mpy, m_s5_xsl16_si, m, mpy, 1616_m, C62X, 0,
  1511. FIX1(FIX(op, 0x18)),
  1512. OP3(OACST, ORXREG1, OWREG2),
  1513. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1514. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1515. /* 16-bit insn. */
  1516. INSN(mpy, m, m3_sat_0, 1616_m, C67X, 0,
  1517. FIX1(FIX(op, 0x0)),
  1518. OP3(ORREG1, ORXREG1, OWREG2),
  1519. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1520. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  1521. INSN(mpydp, m, mpy, mpydp, C67X, 0,
  1522. FIX1(FIX(op, 0x0e)),
  1523. OP3(ORREGD1234, ORXREGD1324, OWREGD910),
  1524. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1525. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1526. INSN(mpyh, m, mpy, 1616_m, C62X, 0,
  1527. FIX1(FIX(op, 0x01)),
  1528. OP3(ORREG1, ORXREG1, OWREG2),
  1529. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1530. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1531. /* 16 bits insn */
  1532. INSN(mpyh, m, m3_sat_0, 1616_m, C67X, 0,
  1533. FIX1(FIX(op, 0x1)),
  1534. OP3(ORREG1, ORXREG1, OWREG2),
  1535. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1536. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  1537. /**/
  1538. INSN(mpyhi, m, compound, 4cycle, C64X, 0,
  1539. FIX1(FIX(op, 0x14)),
  1540. OP3(ORREG1, ORXREG1, OWREGD4),
  1541. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1542. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1543. INSN(mpyhir, m, compound, 4cycle, C64X, 0,
  1544. FIX1(FIX(op, 0x10)),
  1545. OP3(ORREG1, ORXREG1, OWREG4),
  1546. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1547. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1548. INSN(mpyhl, m, mpy, 1616_m, C62X, 0,
  1549. FIX1(FIX(op, 0x09)),
  1550. OP3(ORREG1, ORXREG1, OWREG2),
  1551. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1552. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1553. /* 16 bits insn */
  1554. INSN(mpyhl, m, m3_sat_0, 1616_m, C67X, 0,
  1555. FIX1(FIX(op, 0x3)),
  1556. OP3(ORREG1, ORXREG1, OWREG2),
  1557. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1558. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  1559. /**/
  1560. INSN(mpyhlu, m, mpy, 1616_m, C62X, 0,
  1561. FIX1(FIX(op, 0x0f)),
  1562. OP3(ORREG1, ORXREG1, OWREG2),
  1563. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1564. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1565. INSN(mpyhslu, m, mpy, 1616_m, C62X, 0,
  1566. FIX1(FIX(op, 0x0b)),
  1567. OP3(ORREG1, ORXREG1, OWREG2),
  1568. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1569. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1570. INSN(mpyhsu, m, mpy, 1616_m, C62X, 0,
  1571. FIX1(FIX(op, 0x03)),
  1572. OP3(ORREG1, ORXREG1, OWREG2),
  1573. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1574. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1575. INSN(mpyhu, m, mpy, 1616_m, C62X, 0,
  1576. FIX1(FIX(op, 0x07)),
  1577. OP3(ORREG1, ORXREG1, OWREG2),
  1578. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1579. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1580. INSN(mpyhuls, m, mpy, 1616_m, C62X, 0,
  1581. FIX1(FIX(op, 0x0d)),
  1582. OP3(ORREG1, ORXREG1, OWREG2),
  1583. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1584. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1585. INSN(mpyhus, m, mpy, 1616_m, C62X, 0,
  1586. FIX1(FIX(op, 0x05)),
  1587. OP3(ORREG1, ORXREG1, OWREG2),
  1588. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1589. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1590. INSNE(mpyi, m_si_xsi_si, m, mpy, mpyi, C67X, 0,
  1591. FIX1(FIX(op, 0x04)),
  1592. OP3(ORREG14, ORXREG14, OWREG9),
  1593. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1594. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1595. INSNE(mpyi, m_s5_xsi_si, m, mpy, mpyi, C67X, 0,
  1596. FIX1(FIX(op, 0x06)),
  1597. OP3(OACST, ORXREG14, OWREG9),
  1598. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1599. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1600. INSNE(mpyid, m_si_xsi_sll, m, mpy, mpyid, C67X, 0,
  1601. FIX1(FIX(op, 0x08)),
  1602. OP3(ORREG14, ORXREG14, OWREGD910),
  1603. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1604. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1605. INSNE(mpyid, m_s5_xsi_sll, m, mpy, mpyid, C67X, 0,
  1606. FIX1(FIX(op, 0x0c)),
  1607. OP3(OACST, ORXREG14, OWREGD910),
  1608. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1609. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1610. INSN(mpyih, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  1611. FIX1(FIX(op, 0x14)),
  1612. OP3(ORXREG1, ORREG1, OWREGD4),
  1613. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1614. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1615. INSN(mpyihr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  1616. FIX1(FIX(op, 0x10)),
  1617. OP3(ORXREG1, ORREG1, OWREG4),
  1618. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1619. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1620. INSN(mpyil, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  1621. FIX1(FIX(op, 0x15)),
  1622. OP3(ORXREG1, ORREG1, OWREGD4),
  1623. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1624. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1625. INSN(mpyilr, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  1626. FIX1(FIX(op, 0x0e)),
  1627. OP3(ORXREG1, ORREG1, OWREG4),
  1628. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1629. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1630. INSN(mpylh, m, mpy, 1616_m, C62X, 0,
  1631. FIX1(FIX(op, 0x11)),
  1632. OP3(ORREG1, ORXREG1, OWREG2),
  1633. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1634. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1635. /* 16 bits insn */
  1636. INSN(mpylh, m, m3_sat_0, 1616_m, C67X, 0,
  1637. FIX1(FIX(op, 0x2)),
  1638. OP3(ORREG1, ORXREG1, OWREG2),
  1639. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1640. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  1641. /**/
  1642. INSN(mpylhu, m, mpy, 1616_m, C62X, 0,
  1643. FIX1(FIX(op, 0x17)),
  1644. OP3(ORREG1, ORXREG1, OWREG2),
  1645. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1646. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1647. INSN(mpyli, m, compound, 4cycle, C64X, 0,
  1648. FIX1(FIX(op, 0x15)),
  1649. OP3(ORREG1, ORXREG1, OWREGD4),
  1650. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1651. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1652. INSN(mpylir, m, compound, 4cycle, C64X, 0,
  1653. FIX1(FIX(op, 0x0e)),
  1654. OP3(ORREG1, ORXREG1, OWREG4),
  1655. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1656. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1657. INSN(mpylshu, m, mpy, 1616_m, C62X, 0,
  1658. FIX1(FIX(op, 0x13)),
  1659. OP3(ORREG1, ORXREG1, OWREG2),
  1660. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1661. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1662. INSN(mpyluhs, m, mpy, 1616_m, C62X, 0,
  1663. FIX1(FIX(op, 0x15)),
  1664. OP3(ORREG1, ORXREG1, OWREG2),
  1665. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1666. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1667. INSN(mpysp, m, mpy, 4cycle, C67X, 0,
  1668. FIX1(FIX(op, 0x1c)),
  1669. OP3(ORREG1, ORXREG1, OWREG4),
  1670. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1671. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1672. /* Contrary to SPRU733A, MPYSPDP and MPYSP2DP are on both C67X and
  1673. C67X+. */
  1674. INSN(mpyspdp, m, compound, mpyspdp, C67X, 0,
  1675. FIX1(FIX(op, 0x16)),
  1676. OP3(ORREG12, ORXREGD12, OWREGD67),
  1677. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1678. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1679. INSN(mpysp2dp, m, compound, mpyspdp, C67X, 0,
  1680. FIX1(FIX(op, 0x17)),
  1681. OP3(ORREG1, ORXREG1, OWREGD45),
  1682. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1683. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1684. INSNE(mpysu, m_sl16_xul16_si, m, mpy, 1616_m, C62X, 0,
  1685. FIX1(FIX(op, 0x1b)),
  1686. OP3(ORREG1, ORXREG1, OWREG2),
  1687. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1688. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1689. INSNE(mpysu, m_s5_xul16_si, m, mpy, 1616_m, C62X, 0,
  1690. FIX1(FIX(op, 0x1e)),
  1691. OP3(OACST, ORXREG1, OWREG2),
  1692. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1693. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1694. INSN(mpysu4, m, compound, 4cycle, C64X, 0,
  1695. FIX1(FIX(op, 0x05)),
  1696. OP3(ORREG1, ORXREG1, OWREGD4),
  1697. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1698. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1699. INSN(mpyu, m, mpy, 1616_m, C62X, 0,
  1700. FIX1(FIX(op, 0x1f)),
  1701. OP3(ORREG1, ORXREG1, OWREG2),
  1702. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1703. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1704. INSN(mpyu4, m, compound, 4cycle, C64X, 0,
  1705. FIX1(FIX(op, 0x04)),
  1706. OP3(ORREG1, ORXREG1, OWREGD4),
  1707. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1708. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1709. INSN(mpyus, m, mpy, 1616_m, C62X, 0,
  1710. FIX1(FIX(op, 0x1d)),
  1711. OP3(ORREG1, ORXREG1, OWREG2),
  1712. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1713. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1714. INSN(mpyus4, m, compound, 4cycle, C64X, TIC6X_FLAG_MACRO,
  1715. FIX1(FIX(op, 0x05)),
  1716. OP3(ORXREG1, ORREG1, OWREGD4),
  1717. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1718. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  1719. INSN(mpy2, m, compound, 4cycle, C64X, 0,
  1720. FIX1(FIX(op, 0x00)),
  1721. OP3(ORREG1, ORXREG1, OWREGD4),
  1722. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1723. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1724. INSN(mpy2ir, m, 1_or_2_src, 4cycle, C64XP, 0,
  1725. FIX1(FIX(op, 0x0f)),
  1726. OP3(ORREG1, ORXREG1, OWREGD4),
  1727. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1728. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1729. INSNE(mpy32, 32_32_32, m, mpy, 4cycle, C64XP, 0,
  1730. FIX1(FIX(op, 0x10)),
  1731. OP3(ORREG1, ORXREG1, OWREG4),
  1732. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1733. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1734. INSNE(mpy32, 32_32_64, m, mpy, 4cycle, C64XP, 0,
  1735. FIX1(FIX(op, 0x14)),
  1736. OP3(ORREG1, ORXREG1, OWREGD4),
  1737. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1738. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1739. INSN(mpy32su, m, mpy, 4cycle, C64XP, 0,
  1740. FIX1(FIX(op, 0x16)),
  1741. OP3(ORREG1, ORXREG1, OWREGD4),
  1742. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1743. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1744. INSN(mpy32u, m, compound, 4cycle, C64XP, 0,
  1745. FIX1(FIX(op, 0x18)),
  1746. OP3(ORREG1, ORXREG1, OWREGD4),
  1747. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1748. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1749. INSN(mpy32us, m, compound, 4cycle, C64XP, 0,
  1750. FIX1(FIX(op, 0x19)),
  1751. OP3(ORREG1, ORXREG1, OWREGD4),
  1752. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1753. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1754. /* "or" forms of "mv" are preferred over "add" forms when available
  1755. because "or" uses less power. However, 40-bit moves are only
  1756. available through "add", and before C64X D-unit moves are only
  1757. available through "add" (without cross paths being available). */
  1758. INSNE(mv, l_xui_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  1759. FIX2(FIX(op, 0x7e), FIX(src1, 0)),
  1760. OP2(ORXREG1, OWREG1),
  1761. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1762. ENC(dst, reg, 1)))
  1763. INSNE(mv, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
  1764. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
  1765. FIX3(FIX(op, 0x20), FIX(x, 0), FIX(src1, 0)),
  1766. OP2(ORREGL1, OWREGL1),
  1767. ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
  1768. INSNE(mv, s_xui_ui, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  1769. FIX2(FIX(op, 0x1a), FIX(src1, 0)),
  1770. OP2(ORXREG1, OWREG1),
  1771. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1772. ENC(dst, reg, 1)))
  1773. INSNE(mv, d_si_si, d, 1_or_2_src, 1cycle, C62X,
  1774. TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(0),
  1775. FIX2(FIX(op, 0x12), FIX(src1, 0)),
  1776. OP2(ORREG1, OWREG1),
  1777. ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
  1778. INSNE(mv, d_xui_ui, d, ext_1_or_2_src, 1cycle, C64X,
  1779. TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
  1780. FIX2(FIX(op, 0x3), FIX(src1, 0)),
  1781. OP2(ORXREG1, OWREG1),
  1782. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1783. ENC(dst, reg, 1)))
  1784. /* 16 bits insn */
  1785. INSNU(mv, l, lsdmvto, 1cycle, C64X, 0,
  1786. FIX1(FIX(unit, 0x0)),
  1787. OP2(ORXREG1, OWREG1),
  1788. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
  1789. INSNU(mv, s, lsdmvto, 1cycle, C64X, 0,
  1790. FIX1(FIX(unit, 0x1)),
  1791. OP2(ORXREG1, OWREG1),
  1792. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
  1793. INSNU(mv, d, lsdmvto, 1cycle, C64X, 0,
  1794. FIX1(FIX(unit, 0x2)),
  1795. OP2(ORXREG1, OWREG1),
  1796. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
  1797. INSNU(mv, l, lsdmvfr, 1cycle, C64X, 0,
  1798. FIX1(FIX(unit, 0x0)),
  1799. OP2(ORXREG1, OWREG1),
  1800. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
  1801. INSNU(mv, s, lsdmvfr, 1cycle, C64X, 0,
  1802. FIX1(FIX(unit, 0x1)),
  1803. OP2(ORXREG1, OWREG1),
  1804. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
  1805. INSNU(mv, d, lsdmvfr, 1cycle, C64X, 0,
  1806. FIX1(FIX(unit, 0x2)),
  1807. OP2(ORXREG1, OWREG1),
  1808. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(x, xpath, 0), ENC(dst, reg, 1)))
  1809. /**/
  1810. INSNE(mvc, from_cr, s, 1_or_2_src, 1cycle, C62X,
  1811. TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_NO_CROSS,
  1812. FIX3(FIX(s, 1), FIX(op, 0x0f), FIX(x, 0)),
  1813. OP2(ORCREG1, OWREG1),
  1814. ENC3(ENC(src1, crhi, 0), ENC(src2, crlo, 0), ENC(dst, reg, 1)))
  1815. INSNE(mvc, to_cr, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_SIDE_B_ONLY,
  1816. FIX2(FIX(s, 1), FIX(op, 0x0e)),
  1817. OP2(ORXREG1, OWCREG1),
  1818. ENC4(ENC(x, xpath, 0), ENC(src2, reg, 0), ENC(src1, crhi, 1),
  1819. ENC(dst, crlo, 1)))
  1820. /* 16 bits insn */
  1821. INSN(mvc, s, sx1, 1cycle, C64XP,
  1822. TIC6X_FLAG_NO_CROSS,
  1823. FIX1(FIX(op, 0x6)),
  1824. OP2(ORREG1B, OWILC1),
  1825. ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 0)))
  1826. /**/
  1827. INSN(mvd, m, unary, 4cycle, C64X, 0,
  1828. FIX1(FIX(op, 0x1a)),
  1829. OP2(ORXREG1, OWREG4),
  1830. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1831. ENC(dst, reg, 1)))
  1832. INSN(mvk, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  1833. FIX1(FIX(h, 0)),
  1834. OP2(OLCST, OWREG1),
  1835. ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
  1836. INSN(mvk, l, unary, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
  1837. FIX2(FIX(x, 0), FIX(op, 0x05)),
  1838. OP2(OACST, OWREG1),
  1839. ENC3(ENC(s, fu, 0), ENC(src2, scst, 0), ENC(dst, reg, 1)))
  1840. INSN(mvk, d, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_NO_CROSS,
  1841. FIX2(FIX(op, 0x00), FIX(src2, 0)),
  1842. OP2(OACST, OWREG1),
  1843. ENC3(ENC(s, fu, 0), ENC(src1, scst, 0), ENC(dst, reg, 1)))
  1844. /* 16 bits insn */
  1845. INSN(mvk, l, lx5, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1846. FIX0(),
  1847. OP2(OLCST, OWREG1),
  1848. ENC3(ENC(s, fu, 0), ENC(cst, scst, 0), ENC(dst, reg, 1)))
  1849. INSN(mvk, s, smvk8, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1850. FIX0(),
  1851. OP2(OLCST, OWREG1),
  1852. ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
  1853. INSNU(mvk, l, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
  1854. FIX1(FIX(unit, 0x0)),
  1855. OP2(OACST, OWREG1),
  1856. ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
  1857. INSNU(mvk, s, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
  1858. FIX1(FIX(unit, 0x1)),
  1859. OP2(OACST, OWREG1),
  1860. ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
  1861. INSNU(mvk, d, lsdx1c, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_SPRED,
  1862. FIX1(FIX(unit, 0x2)),
  1863. OP2(OACST, OWREG1),
  1864. ENC3(ENC(s, fu, 0), ENC(cst, ucst, 0), ENC(dst, reg, 1)))
  1865. INSNUE(mvk, zero, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1866. FIX2(FIX(op, 0), FIX(unit, 0x0)),
  1867. OP2(OHWCST0, OWREG1),
  1868. ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
  1869. INSNUE(mvk, zero, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1870. FIX2(FIX(op, 0), FIX(unit, 0x1)),
  1871. OP2(OHWCST0, OWREG1),
  1872. ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
  1873. INSNUE(mvk, zero, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1874. FIX2(FIX(op, 0), FIX(unit, 0x2)),
  1875. OP2(OHWCST0, OWREG1),
  1876. ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
  1877. INSNUE(mvk, one, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1878. FIX2(FIX(op, 1), FIX(unit, 0x0)),
  1879. OP2(OHWCST1, OWREG1),
  1880. ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
  1881. INSNUE(mvk, one, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1882. FIX2(FIX(op, 1), FIX(unit, 0x1)),
  1883. OP2(OHWCST1, OWREG1),
  1884. ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
  1885. INSNUE(mvk, one, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  1886. FIX2(FIX(op, 1), FIX(unit, 0x2)),
  1887. OP2(OHWCST1, OWREG1),
  1888. ENC2(ENC(s, fu, 0), ENC(srcdst, reg, 1)))
  1889. /**/
  1890. INSN(mvkh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  1891. FIX1(FIX(h, 1)),
  1892. OP2(OLCST, OWREG1),
  1893. ENC3(ENC(s, fu, 0), ENC(cst, lcst_high16, 0), ENC(dst, reg, 1)))
  1894. INSN(mvklh, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
  1895. FIX1(FIX(h, 1)),
  1896. OP2(OLCST, OWREG1),
  1897. ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
  1898. INSN(mvkl, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
  1899. FIX1(FIX(h, 0)),
  1900. OP2(OLCST, OWREG1),
  1901. ENC3(ENC(s, fu, 0), ENC(cst, lcst_low16, 0), ENC(dst, reg, 1)))
  1902. INSNE(neg, s_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  1903. FIX2(FIX(op, 0x16), FIX(src1, 0)),
  1904. OP2(ORXREG1, OWREG1),
  1905. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1906. ENC(dst, reg, 1)))
  1907. INSNE(neg, l_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  1908. FIX2(FIX(op, 0x06), FIX(src1, 0)),
  1909. OP2(ORXREG1, OWREG1),
  1910. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1911. ENC(dst, reg, 1)))
  1912. INSNE(neg, l_sl_sl, l, 1_or_2_src, 1cycle, C62X,
  1913. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
  1914. FIX2(FIX(op, 0x24), FIX(src1, 0)),
  1915. OP2(ORREGL1, OWREGL1),
  1916. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1917. ENC(dst, reg, 1)))
  1918. INSN(nop, nfu, nop_idle, nop, C62X, 0,
  1919. FIX2(FIX(s, 0), RAN(op, 0, 8)),
  1920. OP1(OACST),
  1921. ENC1(ENC(op, ucst_minus_one, 0)))
  1922. INSNE(nop, 1, nfu, nop_idle, nop, C62X, TIC6X_FLAG_MACRO,
  1923. FIX2(FIX(s, 0), FIX(op, 0)),
  1924. OP0(),
  1925. ENC0())
  1926. /* 16 bits insn */
  1927. /* contrary to sprufe8b.pdf p767, and accordingly to
  1928. * dis6x.exe output, unop3 opcode is decoded as NOP N3 + 1 */
  1929. INSN(nop, nfu, unop, nop, C64XP, 0,
  1930. FIX0(),
  1931. OP1(OACST),
  1932. ENC1(ENC(n, ucst_minus_one, 0)))
  1933. /**/
  1934. INSNE(norm, l_xsi_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  1935. FIX2(FIX(op, 0x63), FIX(src1, 0)),
  1936. OP2(ORXREG1, OWREG1),
  1937. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1938. ENC(dst, reg, 1)))
  1939. INSNE(norm, l_sl_ui, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  1940. FIX3(FIX(op, 0x60), FIX(x, 0), FIX(src1, 0)),
  1941. OP2(ORREGL1, OWREG1),
  1942. ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
  1943. INSN(not, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  1944. FIX2(FIX(op, 0x6e), FIX(src1, 0x1f)),
  1945. OP2(ORXREG1, OWREG1),
  1946. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1947. ENC(dst, reg, 1)))
  1948. INSN(not, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  1949. FIX2(FIX(op, 0x0a), FIX(src1, 0x1f)),
  1950. OP2(ORXREG1, OWREG1),
  1951. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1952. ENC(dst, reg, 1)))
  1953. INSN(not, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
  1954. FIX2(FIX(op, 0xf), FIX(src1, 0x1f)),
  1955. OP2(ORXREG1, OWREG1),
  1956. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  1957. ENC(dst, reg, 1)))
  1958. INSNE(or, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
  1959. FIX1(FIX(op, 0x2)),
  1960. OP3(ORREG1, ORXREG1, OWREG1),
  1961. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1962. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1963. INSNE(or, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
  1964. FIX1(FIX(op, 0x3)),
  1965. OP3(OACST, ORXREG1, OWREG1),
  1966. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1967. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1968. INSNE(or, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  1969. FIX1(FIX(op, 0x7f)),
  1970. OP3(ORREG1, ORXREG1, OWREG1),
  1971. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1972. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1973. INSNE(or, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  1974. FIX1(FIX(op, 0x7e)),
  1975. OP3(OACST, ORXREG1, OWREG1),
  1976. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1977. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1978. INSNE(or, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  1979. FIX1(FIX(op, 0x1b)),
  1980. OP3(ORREG1, ORXREG1, OWREG1),
  1981. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1982. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1983. INSNE(or, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  1984. FIX1(FIX(op, 0x1a)),
  1985. OP3(OACST, ORXREG1, OWREG1),
  1986. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  1987. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1988. /* 16 bits insn */
  1989. INSN(or, l, l2c, 1cycle, C64XP, 0,
  1990. FIX1(FIX(op, 1)),
  1991. OP3(ORREG1, ORXREG1, OWREG1NORS),
  1992. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1993. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  1994. /**/
  1995. INSN(pack2, l, 1_or_2_src, 1cycle, C64X, 0,
  1996. FIX1(FIX(op, 0x0)),
  1997. OP3(ORREG1, ORXREG1, OWREG1),
  1998. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  1999. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2000. INSN(pack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2001. FIX1(FIX(op, 0xf)),
  2002. OP3(ORREG1, ORXREG1, OWREG1),
  2003. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2004. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2005. INSN(packh2, l, 1_or_2_src, 1cycle, C64X, 0,
  2006. FIX1(FIX(op, 0x1e)),
  2007. OP3(ORREG1, ORXREG1, OWREG1),
  2008. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2009. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2010. INSN(packh2, s, 1_or_2_src, 1cycle, C64X, 0,
  2011. FIX1(FIX(op, 0x9)),
  2012. OP3(ORREG1, ORXREG1, OWREG1),
  2013. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2014. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2015. INSN(packh4, l, 1_or_2_src, 1cycle, C64X, 0,
  2016. FIX1(FIX(op, 0x69)),
  2017. OP3(ORREG1, ORXREG1, OWREG1),
  2018. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2019. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2020. INSN(packhl2, l, 1_or_2_src, 1cycle, C64X, 0,
  2021. FIX1(FIX(op, 0x1c)),
  2022. OP3(ORREG1, ORXREG1, OWREG1),
  2023. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2024. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2025. INSN(packhl2, s, 1_or_2_src, 1cycle, C64X, 0,
  2026. FIX1(FIX(op, 0x8)),
  2027. OP3(ORREG1, ORXREG1, OWREG1),
  2028. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2029. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2030. INSN(packlh2, l, 1_or_2_src, 1cycle, C64X, 0,
  2031. FIX1(FIX(op, 0x1b)),
  2032. OP3(ORREG1, ORXREG1, OWREG1),
  2033. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2034. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2035. INSN(packlh2, s, 1_or_2_src, 1cycle, C64X, 0,
  2036. FIX1(FIX(op, 0x10)),
  2037. OP3(ORREG1, ORXREG1, OWREG1),
  2038. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2039. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2040. INSN(packl4, l, 1_or_2_src, 1cycle, C64X, 0,
  2041. FIX1(FIX(op, 0x68)),
  2042. OP3(ORREG1, ORXREG1, OWREG1),
  2043. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2044. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2045. INSN(rcpdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
  2046. FIX2(FIX(op, 0x2d), FIX(x, 0)),
  2047. OP2(ORREGD1, OWREGD12),
  2048. ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
  2049. ENC(dst, reg, 1)))
  2050. INSN(rcpsp, s, 1_or_2_src, 1cycle, C67X, 0,
  2051. FIX2(FIX(op, 0x3d), FIX(src1, 0)),
  2052. OP2(ORXREG1, OWREG1),
  2053. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2054. ENC(dst, reg, 1)))
  2055. INSN(ret, s, ext_branch_cond_imm, branch, C62X,
  2056. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
  2057. FIX0(),
  2058. OP1(OLCST),
  2059. ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
  2060. INSN(ret, s, branch, branch, C62X,
  2061. TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
  2062. FIX1(FIX(s, 1)),
  2063. OP1(ORXREG1),
  2064. ENC2(ENC(x, xpath, 0), ENC(src2, reg, 0)))
  2065. INSN(ret, s, b_irp, branch, C62X,
  2066. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
  2067. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  2068. OP1(ORIRP1),
  2069. ENC0())
  2070. INSN(ret, s, b_nrp, branch, C62X,
  2071. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
  2072. FIX3(FIX(s, 1), FIX(x, 0), FIX(dst, 0)),
  2073. OP1(ORNRP1),
  2074. ENC0())
  2075. INSN(retp, s, call_imm_nop, branch, C64XP,
  2076. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MCNOP|TIC6X_FLAG_MACRO|TIC6X_FLAG_RETURN,
  2077. FIX1(FIX(z, 1)),
  2078. OP2(OLCST, OWRETREG1),
  2079. ENC2(ENC(s, fu, 0), ENC(cst, pcrel, 0)))
  2080. INSN(rint, nfu, rint, 1cycle, C64XP, 0,
  2081. FIX1(FIX(s, 0)),
  2082. OP0(),
  2083. ENC0())
  2084. INSNE(rotl, m_ui_xui_ui, m, compound, 1616_m, C64X, 0,
  2085. FIX1(FIX(op, 0x1d)),
  2086. OP3(ORXREG1, ORREG1, OWREG2),
  2087. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2088. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2089. INSNE(rotl, m_u5_xui_ui, m, compound, 1616_m, C64X, 0,
  2090. FIX1(FIX(op, 0x1e)),
  2091. OP3(ORXREG1, OACST, OWREG2),
  2092. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2093. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2094. INSN(rpack2, s, ext_1_or_2_src_noncond, 1cycle, C64XP, 0,
  2095. FIX2(FIX(op, 0xb), FIX(z, 1)),
  2096. OP3(ORREG1, ORXREG1, OWREG1),
  2097. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2098. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2099. INSN(rsqrdp, s, 1_or_2_src, 2cycle_dp, C67X, TIC6X_FLAG_NO_CROSS,
  2100. FIX2(FIX(op, 0x2e), FIX(x, 0)),
  2101. OP2(ORREGD1, OWREGD12),
  2102. ENC4(ENC(s, fu, 0), ENC(src2, regpair_msb, 0), ENC(src1, regpair_lsb, 0),
  2103. ENC(dst, reg, 1)))
  2104. INSN(rsqrsp, s, 1_or_2_src, 1cycle, C67X, 0,
  2105. FIX2(FIX(op, 0x3e), FIX(src1, 0)),
  2106. OP2(ORXREG1, OWREG1),
  2107. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2108. ENC(dst, reg, 1)))
  2109. INSNE(sadd, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
  2110. FIX1(FIX(op, 0x13)),
  2111. OP3(ORREG1, ORXREG1, OWREG1),
  2112. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2113. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2114. INSNE(sadd, l_xsi_sl_sl, l, 1_or_2_src, 1cycle, C62X, 0,
  2115. FIX1(FIX(op, 0x31)),
  2116. OP3(ORXREG1, ORREGL1, OWREGL1),
  2117. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2118. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2119. INSNE(sadd, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
  2120. FIX1(FIX(op, 0x12)),
  2121. OP3(OACST, ORXREG1, OWREG1),
  2122. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  2123. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2124. INSNE(sadd, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2125. FIX1(FIX(op, 0x30)),
  2126. OP3(OACST, ORREGL1, OWREGL1),
  2127. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  2128. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2129. INSNE(sadd, s_si_xsi_si, s, 1_or_2_src, 1cycle, C64X, 0,
  2130. FIX1(FIX(op, 0x20)),
  2131. OP3(ORREG1, ORXREG1, OWREG1),
  2132. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2133. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2134. /* 16 bits insn */
  2135. INSN(sadd, l, l3_sat_1, 1cycle, C64XP, 0,
  2136. FIX1(FIX(op, 0)),
  2137. OP3(ORREG1, ORXREG1, OWREG1),
  2138. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2139. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2140. INSN(sadd, s, s3_sat_1, 1cycle, C64XP,0,
  2141. FIX1(FIX(op, 0x0)),
  2142. OP3(ORREG1, ORXREG1, OWREG1),
  2143. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2144. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2145. /**/
  2146. INSN(sadd2, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2147. FIX1(FIX(op, 0x0)),
  2148. OP3(ORREG1, ORXREG1, OWREG1),
  2149. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2150. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2151. INSN(saddsub, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
  2152. FIX1(FIX(op, 0x0e)),
  2153. OP3(ORREG1, ORXREG1, OWREGD1),
  2154. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2155. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2156. INSN(saddsub2, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
  2157. FIX1(FIX(op, 0x0f)),
  2158. OP3(ORREG1, ORXREG1, OWREGD1),
  2159. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2160. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2161. INSN(saddsu2, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO,
  2162. FIX1(FIX(op, 0x1)),
  2163. OP3(ORXREG1, ORREG1, OWREG1),
  2164. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2165. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2166. INSN(saddus2, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2167. FIX1(FIX(op, 0x1)),
  2168. OP3(ORREG1, ORXREG1, OWREG1),
  2169. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2170. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2171. INSN(saddu4, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2172. FIX1(FIX(op, 0x3)),
  2173. OP3(ORREG1, ORXREG1, OWREG1),
  2174. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2175. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2176. INSN(sat, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2177. FIX3(FIX(op, 0x40), FIX(x, 0), FIX(src1, 0)),
  2178. OP2(ORREGL1, OWREG1),
  2179. ENC3(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(dst, reg, 1)))
  2180. INSN(set, s, field, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2181. FIX1(FIX(op, 0x2)),
  2182. OP4(ORREG1, OACST, OACST, OWREG1),
  2183. ENC5(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(csta, ucst, 1),
  2184. ENC(cstb, ucst, 2), ENC(dst, reg, 3)))
  2185. INSN(set, s, 1_or_2_src, 1cycle, C62X, 0,
  2186. FIX1(FIX(op, 0x3b)),
  2187. OP3(ORXREG1, ORREG1, OWREG1),
  2188. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2189. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2190. /* 16 bits insn */
  2191. INSN(set, s, sc5, 1cycle, C64XP, 0,
  2192. FIX1(FIX(op, 1)),
  2193. OP4(ORREG1, OACST, OACST, OWREG1),
  2194. ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(cst, ucst, 1),
  2195. ENC(cst, ucst, 2), ENC(srcdst, reg, 3)))
  2196. /**/
  2197. INSN(shfl, m, unary, 1616_m, C64X, 0,
  2198. FIX1(FIX(op, 0x1c)),
  2199. OP2(ORXREG1, OWREG2),
  2200. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2201. ENC(dst, reg, 1)))
  2202. INSN(shfl3, l, 1_or_2_src_noncond, 1cycle, C64XP, 0,
  2203. FIX1(FIX(op, 0x36)),
  2204. OP3(ORREG1, ORXREG1, OWREGD1),
  2205. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2206. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2207. INSNE(shl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
  2208. FIX1(FIX(op, 0x33)),
  2209. OP3(ORXREG1, ORREG1, OWREG1),
  2210. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2211. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2212. INSNE(shl, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2213. FIX2(FIX(op, 0x31), FIX(x, 0)),
  2214. OP3(ORREGL1, ORREG1, OWREGL1),
  2215. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  2216. ENC(dst, reg, 2)))
  2217. INSNE(shl, s_xui_ui_ul, s, 1_or_2_src, 1cycle, C62X, 0,
  2218. FIX1(FIX(op, 0x13)),
  2219. OP3(ORXREG1, ORREG1, OWREGL1),
  2220. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2221. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2222. INSNE(shl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
  2223. FIX1(FIX(op, 0x32)),
  2224. OP3(ORXREG1, OACST, OWREG1),
  2225. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2226. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2227. INSNE(shl, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2228. FIX2(FIX(op, 0x30), FIX(x, 0)),
  2229. OP3(ORREGL1, OACST, OWREGL1),
  2230. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  2231. ENC(dst, reg, 2)))
  2232. INSNE(shl, s_xui_u5_ul, s, 1_or_2_src, 1cycle, C62X, 0,
  2233. FIX1(FIX(op, 0x12)),
  2234. OP3(ORXREG1, OACST, OWREGL1),
  2235. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2236. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2237. /* 16bit insn */
  2238. INSN(shl, s, s3i, 1cycle, C64XP, 0,
  2239. FIX1(FIX(op, 0x0)),
  2240. OP3(ORXREG1, OACST, OWREG1),
  2241. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2242. ENC(cst, cst_s3i, 1), ENC(dst, reg, 2)))
  2243. INSN(shl, s, ssh5_sat_x, 1cycle, C64XP,
  2244. TIC6X_FLAG_NO_CROSS,
  2245. FIX1(FIX(op, 0x0)),
  2246. OP3(ORREG1, OACST, OWREG1),
  2247. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
  2248. ENC(cst, ucst, 1), ENC(srcdst, reg, 2)))
  2249. INSN(shl, s, s2sh, 1cycle, C64XP, 0,
  2250. FIX1(FIX(op, 0x0)),
  2251. OP3(ORREG1, ORREG1, OWREG1),
  2252. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
  2253. ENC(srcdst, reg, 2)))
  2254. /**/
  2255. INSN(shlmb, l, 1_or_2_src, 1cycle, C64X, 0,
  2256. FIX1(FIX(op, 0x61)),
  2257. OP3(ORREG1, ORXREG1, OWREG1),
  2258. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2259. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2260. INSN(shlmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2261. FIX1(FIX(op, 0x9)),
  2262. OP3(ORREG1, ORXREG1, OWREG1),
  2263. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2264. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2265. INSNE(shr, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
  2266. FIX1(FIX(op, 0x37)),
  2267. OP3(ORXREG1, ORREG1, OWREG1),
  2268. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2269. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2270. INSNE(shr, s_sl_ui_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2271. FIX2(FIX(op, 0x35), FIX(x, 0)),
  2272. OP3(ORREGL1, ORREG1, OWREGL1),
  2273. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  2274. ENC(dst, reg, 2)))
  2275. INSNE(shr, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
  2276. FIX1(FIX(op, 0x36)),
  2277. OP3(ORXREG1, OACST, OWREG1),
  2278. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2279. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2280. INSNE(shr, s_sl_u5_sl, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2281. FIX2(FIX(op, 0x34), FIX(x, 0)),
  2282. OP3(ORREGL1, OACST, OWREGL1),
  2283. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  2284. ENC(dst, reg, 2)))
  2285. /* 16bit insn */
  2286. INSN(shr, s, s3i, 1cycle, C64XP, 0,
  2287. FIX1(FIX(op, 0x1)),
  2288. OP3(ORXREG1, OACST, OWREG1),
  2289. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2290. ENC(cst, cst_s3i, 1), ENC(dst, reg, 2)))
  2291. INSN(shr, s, ssh5_sat_x, 1cycle, C64XP,
  2292. TIC6X_FLAG_NO_CROSS,
  2293. FIX1(FIX(op, 0x1)),
  2294. OP3(ORREG1, OACST, OWREG1),
  2295. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
  2296. ENC(cst, ucst, 1), ENC(srcdst, reg, 2)))
  2297. INSN(shr, s, s2sh, 1cycle, C64XP, 0,
  2298. FIX1(FIX(op, 0x1)),
  2299. OP3(ORREG1, ORREG1, OWREG1),
  2300. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
  2301. ENC(srcdst, reg, 2)))
  2302. /**/
  2303. INSNE(shr2, s_xs2_ui_s2, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2304. FIX1(FIX(op, 0x7)),
  2305. OP3(ORXREG1, ORREG1, OWREG1),
  2306. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2307. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2308. INSNE(shr2, s_xs2_u5_s2, s, 1_or_2_src, 1cycle, C64X, 0,
  2309. FIX1(FIX(op, 0x18)),
  2310. OP3(ORXREG1, OACST, OWREG1),
  2311. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2312. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2313. INSN(shrmb, l, 1_or_2_src, 1cycle, C64X, 0,
  2314. FIX1(FIX(op, 0x62)),
  2315. OP3(ORREG1, ORXREG1, OWREG1),
  2316. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2317. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2318. INSN(shrmb, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2319. FIX1(FIX(op, 0xa)),
  2320. OP3(ORREG1, ORXREG1, OWREG1),
  2321. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2322. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2323. INSNE(shru, s_xui_ui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  2324. FIX1(FIX(op, 0x27)),
  2325. OP3(ORXREG1, ORREG1, OWREG1),
  2326. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2327. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2328. INSNE(shru, s_ul_ui_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2329. FIX2(FIX(op, 0x25), FIX(x, 0)),
  2330. OP3(ORREGL1, ORREG1, OWREGL1),
  2331. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  2332. ENC(dst, reg, 2)))
  2333. INSNE(shru, s_xui_u5_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  2334. FIX1(FIX(op, 0x26)),
  2335. OP3(ORXREG1, OACST, OWREG1),
  2336. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2337. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2338. INSNE(shru, s_ul_u5_ul, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2339. FIX2(FIX(op, 0x24), FIX(x, 0)),
  2340. OP3(ORREGL1, OACST, OWREGL1),
  2341. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  2342. ENC(dst, reg, 2)))
  2343. /* 16 bits insn */
  2344. INSN(shru, s, ssh5_sat_0, 1cycle, C64XP,
  2345. TIC6X_FLAG_NO_CROSS,
  2346. FIX1(FIX(op, 0x2)),
  2347. OP3(ORREG1, OACST, OWREG1),
  2348. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
  2349. ENC(cst, ucst, 1), ENC(srcdst, reg, 2)))
  2350. INSN(shru, s, s2sh, 1cycle, C64XP, 0,
  2351. FIX1(FIX(op, 0x2)),
  2352. OP3(ORREG1, ORREG1, OWREG1),
  2353. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
  2354. ENC(srcdst, reg, 2)))
  2355. /**/
  2356. INSNE(shru2, s_xu2_ui_u2, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2357. FIX1(FIX(op, 0x8)),
  2358. OP3(ORXREG1, ORREG1, OWREG1),
  2359. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2360. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2361. INSNE(shru2, s_xu2_u5_u2, s, 1_or_2_src, 1cycle, C64X, 0,
  2362. FIX1(FIX(op, 0x19)),
  2363. OP3(ORXREG1, OACST, OWREG1),
  2364. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2365. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2366. INSN(sl, d, 1_or_2_src, store, C64XP,
  2367. TIC6X_FLAG_STORE|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_SIDE_T2_ONLY|TIC6X_FLAG_NO_CROSS,
  2368. FIX3(FIX(s, 1), FIX(op, 0xd), FIX(src1, 0)),
  2369. OP2(ORDREG1, OWMEMDW),
  2370. ENC2(ENC(dst, reg, 0), ENC(src2, reg, 1)))
  2371. INSN(smpy, m, mpy, 1616_m, C62X, 0,
  2372. FIX1(FIX(op, 0x1a)),
  2373. OP3(ORREG1, ORXREG1, OWREG2),
  2374. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2375. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2376. /* 16 bits insn */
  2377. INSN(smpy, m, m3_sat_1, 1616_m, C67X, 0,
  2378. FIX1(FIX(op, 0x0)),
  2379. OP3(ORREG1, ORXREG1, OWREG2),
  2380. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2381. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  2382. /**/
  2383. INSN(smpyh, m, mpy, 1616_m, C62X, 0,
  2384. FIX1(FIX(op, 0x02)),
  2385. OP3(ORREG1, ORXREG1, OWREG2),
  2386. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2387. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2388. /* 16 bits insn */
  2389. INSN(smpyh, m, m3_sat_1, 1616_m, C67X, 0,
  2390. FIX1(FIX(op, 0x1)),
  2391. OP3(ORREG1, ORXREG1, OWREG2),
  2392. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2393. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  2394. /**/
  2395. INSN(smpyhl, m, mpy, 1616_m, C62X, 0,
  2396. FIX1(FIX(op, 0x0a)),
  2397. OP3(ORREG1, ORXREG1, OWREG2),
  2398. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2399. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2400. /* 16 bits insn */
  2401. INSN(smpyhl, m, m3_sat_1, 1616_m, C67X, 0,
  2402. FIX1(FIX(op, 0x3)),
  2403. OP3(ORREG1, ORXREG1, OWREG2),
  2404. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2405. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  2406. /**/
  2407. INSN(smpylh, m, mpy, 1616_m, C62X, 0,
  2408. FIX1(FIX(op, 0x12)),
  2409. OP3(ORREG1, ORXREG1, OWREG2),
  2410. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2411. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2412. /* 16 bits insn */
  2413. INSN(smpylh, m, m3_sat_1, 1616_m, C67X, 0,
  2414. FIX1(FIX(op, 0x2)),
  2415. OP3(ORREG1, ORXREG1, OWREG2),
  2416. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2417. ENC(src2, reg, 1), ENC(dst, reg_shift, 2)))
  2418. /**/
  2419. INSN(smpy2, m, compound, 4cycle, C64X, 0,
  2420. FIX1(FIX(op, 0x01)),
  2421. OP3(ORREG1, ORXREG1, OWREGD4),
  2422. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2423. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2424. /* Contrary to SPRUFE8, this is the correct operand order for this
  2425. instruction. */
  2426. INSN(smpy32, m, 1_or_2_src, 4cycle, C64XP, 0,
  2427. FIX1(FIX(op, 0x19)),
  2428. OP3(ORREG1, ORXREG1, OWREG4),
  2429. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2430. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2431. INSN(spack2, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2432. FIX1(FIX(op, 0x2)),
  2433. OP3(ORREG1, ORXREG1, OWREG1),
  2434. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2435. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2436. INSN(spacku4, s, ext_1_or_2_src, 1cycle, C64X, 0,
  2437. FIX1(FIX(op, 0x4)),
  2438. OP3(ORREG1, ORXREG1, OWREG1),
  2439. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2440. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2441. INSN(spdp, s, 1_or_2_src, 2cycle_dp, C67X, 0,
  2442. FIX2(FIX(op, 0x02), FIX(src1, 0)),
  2443. OP2(ORXREG1, OWREGD12),
  2444. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2445. ENC(dst, reg, 1)))
  2446. INSN(spint, l, 1_or_2_src, 4cycle, C67X, 0,
  2447. FIX2(FIX(op, 0x0a), FIX(src1, 0)),
  2448. OP2(ORXREG1, OWREG4),
  2449. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2450. ENC(dst, reg, 1)))
  2451. INSNE(spkernel, nfu_2, nfu, spkernel, 1cycle, C64XP,
  2452. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
  2453. FIX1(FIX(s, 0)),
  2454. OP2(OACST, OACST),
  2455. ENC2(ENC(fstgfcyc, fstg, 0), ENC(fstgfcyc, fcyc, 1)))
  2456. INSNE(spkernel, nfu_0, nfu, spkernel, 1cycle, C64XP,
  2457. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL|TIC6X_FLAG_MACRO,
  2458. FIX2(FIX(s, 0), FIX(fstgfcyc, 0)),
  2459. OP0(),
  2460. ENC0())
  2461. /* 16 bits insn */
  2462. INSN(spkernel, nfu, uspk, 1cycle, C64XP,
  2463. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
  2464. FIX0(),
  2465. OP2(OACST, OACST),
  2466. ENC2(ENC(fstgfcyc, fstg, 0), ENC(fstgfcyc, fcyc, 1)))
  2467. /**/
  2468. INSN(spkernelr, nfu, spkernelr, 1cycle, C64XP,
  2469. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPKERNEL,
  2470. FIX1(FIX(s, 0)),
  2471. OP0(),
  2472. ENC0())
  2473. INSN(sploop, nfu, loop_buffer, 1cycle, C64XP,
  2474. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
  2475. FIX4(FIX(s, 0), FIX(op, 0xc), FIX(csta, 0), RAN(cstb, 0, 13)),
  2476. OP1(OACST),
  2477. ENC1(ENC(cstb, ucst_minus_one, 0)))
  2478. INSN(sploopd, nfu, loop_buffer, 1cycle, C64XP,
  2479. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
  2480. FIX4(FIX(s, 0), FIX(op, 0xd), FIX(csta, 0), RAN(cstb, 0, 13)),
  2481. OP1(OACST),
  2482. ENC1(ENC(cstb, ucst_minus_one, 0)))
  2483. INSN(sploopw, nfu, loop_buffer, 1cycle, C64XP,
  2484. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
  2485. FIX4(FIX(s, 0), FIX(op, 0xf), FIX(csta, 0), RAN(cstb, 0, 13)),
  2486. OP1(OACST),
  2487. ENC1(ENC(cstb, ucst_minus_one, 0)))
  2488. /* 16 bits insn */
  2489. INSN(sploop, nfu, uspl, 1cycle, C64XP,
  2490. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
  2491. FIX1(FIX(op, 0)),
  2492. OP1(OACST),
  2493. ENC1(ENC(ii, ucst_minus_one, 0)))
  2494. INSN(sploopd, nfu, uspl, 1cycle, C64XP,
  2495. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP,
  2496. FIX1(FIX(op, 1)),
  2497. OP1(OACST),
  2498. ENC1(ENC(ii, ucst_minus_one, 0)))
  2499. INSN(sploopd, nfu, uspldr, 1cycle, C64XP,
  2500. TIC6X_FLAG_FIRST|TIC6X_FLAG_NO_MCNOP|TIC6X_FLAG_SPLOOP|TIC6X_FLAG_INSN16_SPRED,
  2501. FIX0(),
  2502. OP1(OACST),
  2503. ENC1(ENC(ii, ucst_minus_one, 0)))
  2504. /**/
  2505. /* Contrary to SPRUFE8, this is the correct encoding for this
  2506. instruction. */
  2507. INSN(spmask, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
  2508. FIX2(FIX(s, 0), FIX(op, 0x8)),
  2509. OP1(OFULIST),
  2510. ENC1(ENC(mask, spmask, 0)))
  2511. /* 16 bits insn */
  2512. INSN(spmask, nfu, uspma, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
  2513. FIX0(),
  2514. OP1(OFULIST),
  2515. ENC1(ENC(mask, spmask, 0)))
  2516. /**/
  2517. INSN(spmaskr, nfu, spmask, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
  2518. FIX2(FIX(s, 0), FIX(op, 0x9)),
  2519. OP1(OFULIST),
  2520. ENC1(ENC(mask, spmask, 0)))
  2521. /* 16 bits insn */
  2522. INSN(spmaskr, nfu, uspmb, 1cycle, C64XP, TIC6X_FLAG_FIRST|TIC6X_FLAG_SPMASK,
  2523. FIX0(),
  2524. OP1(OFULIST),
  2525. ENC1(ENC(mask, spmask, 0)))
  2526. /**/
  2527. INSN(sptrunc, l, 1_or_2_src, 4cycle, C67X, 0,
  2528. FIX2(FIX(op, 0x0b), FIX(src1, 0)),
  2529. OP2(ORXREG1, OWREG4),
  2530. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2531. ENC(dst, reg, 1)))
  2532. INSNE(sshl, s_xsi_ui_si, s, 1_or_2_src, 1cycle, C62X, 0,
  2533. FIX1(FIX(op, 0x23)),
  2534. OP3(ORXREG1, ORREG1, OWREG1),
  2535. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2536. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2537. INSNE(sshl, s_xsi_u5_si, s, 1_or_2_src, 1cycle, C62X, 0,
  2538. FIX1(FIX(op, 0x22)),
  2539. OP3(ORXREG1, OACST, OWREG1),
  2540. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2541. ENC(src1, ucst, 1), ENC(dst, reg, 2)))
  2542. /* 16 bits insn */
  2543. INSN(sshl, s, ssh5_sat_1, 1cycle, C64XP,
  2544. TIC6X_FLAG_NO_CROSS,
  2545. FIX1(FIX(op, 0x2)),
  2546. OP3(ORREG1, OACST, OWREG1),
  2547. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0),
  2548. ENC(cst, ucst, 1), ENC(srcdst, reg, 2)))
  2549. INSN(sshl, s, s2sh, 1cycle, C64XP, 0,
  2550. FIX1(FIX(op, 0x3)),
  2551. OP3(ORREG1, ORREG1, OWREG1),
  2552. ENC4(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(src1, reg, 1),
  2553. ENC(srcdst, reg, 2)))
  2554. /**/
  2555. INSN(sshvl, m, compound, 1616_m, C64X, 0,
  2556. FIX1(FIX(op, 0x1c)),
  2557. OP3(ORXREG1, ORREG1, OWREG2),
  2558. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2559. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2560. /* Contrary to SPRUFE8, this is the correct encoding for this
  2561. instruction. */
  2562. INSN(sshvr, m, compound, 1616_m, C64X, 0,
  2563. FIX1(FIX(op, 0x1a)),
  2564. OP3(ORXREG1, ORREG1, OWREG2),
  2565. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2566. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2567. INSNE(ssub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  2568. FIX1(FIX(op, 0x0f)),
  2569. OP3(ORREG1, ORXREG1, OWREG1),
  2570. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2571. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2572. INSNE(ssub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
  2573. FIX1(FIX(op, 0x1f)),
  2574. OP3(ORXREG1, ORREG1, OWREG1),
  2575. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2576. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2577. INSNE(ssub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
  2578. FIX1(FIX(op, 0x0e)),
  2579. OP3(OACST, ORXREG1, OWREG1),
  2580. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  2581. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2582. INSNE(ssub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2583. FIX1(FIX(op, 0x2c)),
  2584. OP3(OACST, ORREGL1, OWREGL1),
  2585. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  2586. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2587. /* 16 bits insn */
  2588. INSN(ssub, l, l3_sat_1, 1cycle, C64XP, 0,
  2589. FIX1(FIX(op, 1)),
  2590. OP3(ORREG1, ORXREG1, OWREG1),
  2591. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2592. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2593. /**/
  2594. INSN(ssub2, l, 1_or_2_src, 1cycle, C64XP, 0,
  2595. FIX1(FIX(op, 0x64)),
  2596. OP3(ORREG1, ORXREG1, OWREG1),
  2597. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2598. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2599. INSN(stb, d, load_store, store, C62X,
  2600. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  2601. FIX2(FIX(op, 3), FIX(r, 0)),
  2602. OP2(ORDREG1, OWMEMSB),
  2603. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
  2604. ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
  2605. ENC(srcdst, reg, 0)))
  2606. INSN(stb, d, load_store_long, store, C62X,
  2607. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  2608. FIX1(FIX(op, 3)),
  2609. OP2(ORDREG1, OWMEMLB),
  2610. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_byte, 1),
  2611. ENC(dst, reg, 0)))
  2612. /* 16 bits insn */
  2613. INSN(stb, d, doff4_dsz_000, store, C64XP,
  2614. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2615. FIX2(FIX(op, 0), FIX(sz, 1)),
  2616. OP2(ORTREG1, OWMEMSB),
  2617. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2618. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
  2619. INSN(stb, d, doff4_dsz_x01, store, C64XP,
  2620. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2621. FIX2(FIX(op, 0), FIX(sz, 1)),
  2622. OP2(ORTREG1, OWMEMSB),
  2623. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2624. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
  2625. INSN(stb, d, dind_dsz_000, store, C64XP,
  2626. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2627. FIX2(FIX(op, 0), FIX(sz, 1)),
  2628. OP2(ORTREG1, OWMEMSB),
  2629. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
  2630. ENC(ptr, reg_ptr, 1), ENC(srcdst, reg, 0)))
  2631. INSN(stb, d, dind_dsz_x01, store, C64XP,
  2632. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2633. FIX2(FIX(op, 0), FIX(sz, 1)),
  2634. OP2(ORTREG1, OWMEMSB),
  2635. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
  2636. ENC(ptr, reg_ptr, 1), ENC(srcdst, reg, 0)))
  2637. INSN(stb, d, dinc_dsz_000, store, C64XP,
  2638. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2639. FIX2(FIX(op, 0), FIX(sz, 1)),
  2640. OP2(ORTREG1, OWMEMSB),
  2641. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2642. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2643. INSN(stb, d, dinc_dsz_x01, store, C64XP,
  2644. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2645. FIX2(FIX(op, 0), FIX(sz, 1)),
  2646. OP2(ORTREG1, OWMEMSB),
  2647. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2648. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2649. INSN(stb, d, ddec_dsz_000, store, C64XP,
  2650. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2651. FIX2(FIX(op, 0), FIX(sz, 1)),
  2652. OP2(ORTREG1, OWMEMSB),
  2653. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2654. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2655. INSN(stb, d, ddec_dsz_x01, store, C64XP,
  2656. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2657. FIX2(FIX(op, 0), FIX(sz, 1)),
  2658. OP2(ORTREG1, OWMEMSB),
  2659. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2660. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2661. /**/
  2662. INSN(stdw, d, load_store, store, C64X, TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS,
  2663. FIX2(FIX(op, 4), FIX(r, 1)),
  2664. OP2(ORDREGD1, OWMEMSD),
  2665. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
  2666. ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
  2667. ENC(srcdst, reg, 0)))
  2668. /* 16 bits insn */
  2669. INSN(stdw, d, dpp, store, C64XP,
  2670. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTDECR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
  2671. FIX3(FIX(op, 0), FIX(dw, 1), FIX(s, 1)),
  2672. OP2(ORTREGD1, OWMEMSD),
  2673. ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2674. ENC(cst, mem_offset_minus_one, 1)))
  2675. INSN(stdw, d, ddecdw, store, C64XP,
  2676. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2677. FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
  2678. OP2(ORTREGD1, OWMEMSD),
  2679. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
  2680. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2681. INSN(stdw, d, dincdw, store, C64XP,
  2682. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2683. FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
  2684. OP2(ORTREGD1, OWMEMSD),
  2685. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
  2686. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2687. INSN(stdw, d, dinddw, store, C64XP,
  2688. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2689. FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
  2690. OP2(ORTREGD1, OWMEMSD),
  2691. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset, 1),
  2692. ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
  2693. INSN(stdw, d, doff4dw, store, C64XP,
  2694. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2695. FIX3(FIX(op, 0), FIX(na, 0), FIX(sz, 0)),
  2696. OP2(ORTREGD1, OWMEMSD),
  2697. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset, 1),
  2698. ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
  2699. /**/
  2700. INSN(sth, d, load_store, store, C62X,
  2701. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  2702. FIX2(FIX(op, 5), FIX(r, 0)),
  2703. OP2(ORDREG1, OWMEMSH),
  2704. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
  2705. ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
  2706. ENC(srcdst, reg, 0)))
  2707. INSN(sth, d, load_store_long, store, C62X,
  2708. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  2709. FIX1(FIX(op, 5)),
  2710. OP2(ORDREG1, OWMEMLH),
  2711. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_half, 1),
  2712. ENC(dst, reg, 0)))
  2713. /* 16 bits insn */
  2714. INSN(sth, d, doff4_dsz_01x, store, C64XP,
  2715. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2716. FIX2(FIX(op, 0), FIX(sz, 1)),
  2717. OP2(ORTREG1, OWMEMSH),
  2718. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2719. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
  2720. INSN(sth, d, doff4_dsz_111, store, C64XP,
  2721. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2722. FIX2(FIX(op, 0), FIX(sz, 1)),
  2723. OP2(ORTREG1, OWMEMSH),
  2724. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2725. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
  2726. INSN(sth, d, dind_dsz_01x, store, C64XP,
  2727. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2728. FIX2(FIX(op, 0), FIX(sz, 1)),
  2729. OP2(ORTREG1, OWMEMSH),
  2730. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2731. ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
  2732. INSN(sth, d, dind_dsz_111, store, C64XP,
  2733. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2734. FIX2(FIX(op, 0), FIX(sz, 1)),
  2735. OP2(ORTREG1, OWMEMSH),
  2736. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2737. ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
  2738. INSN(sth, d, dinc_dsz_01x, store, C64XP,
  2739. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2740. FIX2(FIX(op, 0), FIX(sz, 1)),
  2741. OP2(ORTREG1, OWMEMSH),
  2742. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2743. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2744. INSN(sth, d, dinc_dsz_111, store, C64XP,
  2745. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2746. FIX2(FIX(op, 0), FIX(sz, 1)),
  2747. OP2(ORTREG1, OWMEMSH),
  2748. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2749. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2750. INSN(sth, d, ddec_dsz_01x, store, C64XP,
  2751. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2752. FIX2(FIX(op, 0), FIX(sz, 1)),
  2753. OP2(ORTREG1, OWMEMSH),
  2754. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2755. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2756. INSN(sth, d, ddec_dsz_111, store, C64XP,
  2757. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2758. FIX2(FIX(op, 0), FIX(sz, 1)),
  2759. OP2(ORTREG1, OWMEMSH),
  2760. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2761. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2762. /**/
  2763. INSN(stndw, d, store_nonaligned, store, C64X,
  2764. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
  2765. FIX0(),
  2766. OP2(ORDREGD1, OWMEMND),
  2767. ENC7(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
  2768. ENC(offsetR, mem_offset_noscale, 1), ENC(baseR, reg, 1),
  2769. ENC(sc, scaled, 1), ENC(src, reg_shift, 0)))
  2770. /* 16 bits insn */
  2771. INSN(stndw, d, ddecdw, store, C64XP,
  2772. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2773. FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
  2774. OP2(ORTREGD1, OWMEMND),
  2775. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
  2776. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one_noscale, 1)))
  2777. INSN(stndw, d, dincdw, store, C64XP,
  2778. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2779. FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
  2780. OP2(ORTREGD1, OWMEMND),
  2781. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg_shift, 0),
  2782. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one_noscale, 1)))
  2783. INSN(stndw, d, dinddw, store, C64XP,
  2784. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2785. FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
  2786. OP2(ORTREGD1, OWMEMND),
  2787. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(src1, mem_offset_noscale, 1),
  2788. ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
  2789. INSN(stndw, d, doff4dw, store, C64XP,
  2790. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2791. FIX3(FIX(op, 0), FIX(na, 1), FIX(sz, 0)),
  2792. OP2(ORTREGD1, OWMEMND),
  2793. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(cst, mem_offset_noscale, 1),
  2794. ENC(ptr, reg_ptr, 1), ENC(srcdst, reg_shift, 0)))
  2795. /**/
  2796. INSN(stnw, d, load_store, store, C64X,
  2797. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_UNALIGNED,
  2798. FIX2(FIX(op, 5), FIX(r, 1)),
  2799. OP2(ORDREG1, OWMEMSW),
  2800. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
  2801. ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
  2802. ENC(srcdst, reg, 0)))
  2803. /* 16 bits insn */
  2804. INSN(stnw, d, doff4_dsz_110, store, C64XP,
  2805. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2806. FIX2(FIX(op, 0), FIX(sz, 1)),
  2807. OP2(ORTREG1, OWMEMSW),
  2808. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2809. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
  2810. INSN(stnw, d, dind_dsz_110, store, C64XP,
  2811. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2812. FIX2(FIX(op, 0), FIX(sz, 1)),
  2813. OP2(ORTREG1, OWMEMSW),
  2814. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2815. ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
  2816. INSN(stnw, d, dinc_dsz_110, store, C64XP,
  2817. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2818. FIX2(FIX(op, 0), FIX(sz, 1)),
  2819. OP2(ORTREG1, OWMEMSW),
  2820. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2821. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2822. INSN(stnw, d, ddec_dsz_110, store, C64XP,
  2823. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2824. FIX2(FIX(op, 0), FIX(sz, 1)),
  2825. OP2(ORTREG1, OWMEMSW),
  2826. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2827. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2828. /**/
  2829. INSN(stw, d, load_store, store, C62X,
  2830. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  2831. FIX2(FIX(op, 7), FIX(r, 0)),
  2832. OP2(ORDREG1, OWMEMSW),
  2833. ENC6(ENC(s, data_fu, 0), ENC(y, fu, 0), ENC(mode, mem_mode, 1),
  2834. ENC(offsetR, mem_offset, 1), ENC(baseR, reg, 1),
  2835. ENC(srcdst, reg, 0)))
  2836. INSN(stw, d, load_store_long, store, C62X,
  2837. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_SIDE_B_ONLY|TIC6X_FLAG_PREFER(0),
  2838. FIX1(FIX(op, 7)),
  2839. OP2(ORDREG1, OWMEMLW),
  2840. ENC4(ENC(s, data_fu, 0), ENC(y, areg, 1), ENC(offsetR, ulcst_dpr_word, 1),
  2841. ENC(dst, reg, 0)))
  2842. /* 16 bits insn */
  2843. INSN(stw, d, doff4_dsz_0xx, store, C64XP,
  2844. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2845. FIX2(FIX(op, 0), FIX(sz, 0)),
  2846. OP2(ORTREG1, OWMEMSW),
  2847. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2848. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
  2849. INSN(stw, d, doff4_dsz_100, store, C64XP,
  2850. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE),
  2851. FIX2(FIX(op, 0), FIX(sz, 1)),
  2852. OP2(ORTREG1, OWMEMSW),
  2853. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2854. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset, 1)))
  2855. INSN(stw, d, dind_dsz_0xx, store, C64XP,
  2856. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2857. FIX2(FIX(op, 0), FIX(sz, 0)),
  2858. OP2(ORTREG1, OWMEMSW),
  2859. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2860. ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
  2861. INSN(stw, d, dind_dsz_100, store, C64XP,
  2862. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(REG_POSITIVE),
  2863. FIX2(FIX(op, 0), FIX(sz, 1)),
  2864. OP2(ORTREG1, OWMEMSW),
  2865. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2866. ENC(ptr, reg_ptr, 1), ENC(src1, mem_offset, 1)))
  2867. INSN(stw, d, dinc_dsz_0xx, store, C64XP,
  2868. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2869. FIX2(FIX(op, 0), FIX(sz, 0)),
  2870. OP2(ORTREG1, OWMEMSW),
  2871. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2872. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2873. INSN(stw, d, dinc_dsz_100, store, C64XP,
  2874. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTINCR),
  2875. FIX2(FIX(op, 0), FIX(sz, 1)),
  2876. OP2(ORTREG1, OWMEMSW),
  2877. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2878. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2879. INSN(stw, d, ddec_dsz_0xx, store, C64XP,
  2880. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2881. FIX2(FIX(op, 0), FIX(sz, 0)),
  2882. OP2(ORTREG1, OWMEMSW),
  2883. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2884. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2885. INSN(stw, d, ddec_dsz_100, store, C64XP,
  2886. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(PREDECR),
  2887. FIX2(FIX(op, 0), FIX(sz, 1)),
  2888. OP2(ORTREG1, OWMEMSW),
  2889. ENC5(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2890. ENC(ptr, reg_ptr, 1), ENC(cst, mem_offset_minus_one, 1)))
  2891. INSN(stw, d, dpp, store, C64XP,
  2892. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSTDECR)|TIC6X_FLAG_INSN16_B15PTR|TIC6X_FLAG_INSN16_NORS,
  2893. FIX2(FIX(op, 0), FIX(dw, 0)),
  2894. OP2(ORTREG1, OWMEMSW),
  2895. ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2896. ENC(cst, mem_offset_minus_one, 1)))
  2897. INSN(stw, d, dstk, store, C64XP,
  2898. TIC6X_FLAG_STORE|TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_INSN16_MEM_MODE(POSITIVE)|TIC6X_FLAG_INSN16_B15PTR,
  2899. FIX2(FIX(op, 0x0), FIX(s, 1)),
  2900. OP2(ORTREG1, OWMEMSW),
  2901. ENC4(ENC(s, fu, 0), ENC(t, rside, 0), ENC(srcdst, reg, 0),
  2902. ENC(cst, mem_offset, 1)))
  2903. /**/
  2904. INSNE(sub, l_si_xsi_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  2905. FIX1(FIX(op, 0x07)),
  2906. OP3(ORREG1, ORXREG1, OWREG1),
  2907. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2908. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2909. INSNE(sub, l_xsi_si_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
  2910. FIX1(FIX(op, 0x17)),
  2911. OP3(ORXREG1, ORREG1, OWREG1),
  2912. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2913. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2914. INSNE(sub, l_si_xsi_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  2915. FIX1(FIX(op, 0x27)),
  2916. OP3(ORREG1, ORXREG1, OWREGL1),
  2917. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2918. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2919. INSNE(sub, l_xsi_si_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
  2920. FIX1(FIX(op, 0x37)),
  2921. OP3(ORXREG1, ORREG1, OWREGL1),
  2922. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2923. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2924. INSNE(sub, l_s5_xsi_si, l, 1_or_2_src, 1cycle, C62X, 0,
  2925. FIX1(FIX(op, 0x06)),
  2926. OP3(OACST, ORXREG1, OWREG1),
  2927. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  2928. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2929. INSNE(sub, l_s5_sl_sl, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2930. FIX1(FIX(op, 0x24)),
  2931. OP3(OACST, ORREGL1, OWREGL1),
  2932. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  2933. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2934. INSNE(sub, l_xsi_s5_si, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  2935. FIX1(FIX(op, 0x2)),
  2936. OP3(ORXREG1, OACST, OWREG1),
  2937. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
  2938. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  2939. INSNE(sub, l_sl_s5_sl, l, 1_or_2_src, 1cycle, C62X,
  2940. TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
  2941. FIX2(FIX(op, 0x20), FIX(x, 0)),
  2942. OP3(ORREGL1, OACST, OWREGL1),
  2943. ENC4(ENC(s, fu, 0), ENC(src1, scst_negate, 1), ENC(src2, reg, 0),
  2944. ENC(dst, reg, 2)))
  2945. INSNE(sub, s_si_xsi_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  2946. FIX1(FIX(op, 0x17)),
  2947. OP3(ORREG1, ORXREG1, OWREG1),
  2948. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2949. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2950. INSNE(sub, s_s5_xsi_si, s, 1_or_2_src, 1cycle, C62X, 0,
  2951. FIX1(FIX(op, 0x16)),
  2952. OP3(OACST, ORXREG1, OWREG1),
  2953. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  2954. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2955. /* Contrary to SPRUFE8, this is the correct encoding for this
  2956. instruction; this instruction can be predicated. */
  2957. INSNE(sub, s_xsi_si_si, s, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
  2958. FIX1(FIX(op, 0x5)),
  2959. OP3(ORXREG1, ORREG1, OWREG1),
  2960. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  2961. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  2962. INSNE(sub, s_xsi_s5_si, s, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_MACRO,
  2963. FIX1(FIX(op, 0x6)),
  2964. OP3(ORXREG1, OACST, OWREG1),
  2965. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst_negate, 1),
  2966. ENC(src2, reg, 0), ENC(dst, reg, 2)))
  2967. INSNE(sub, d_si_si_si, d, 1_or_2_src, 1cycle, C62X,
  2968. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_PREFER(1),
  2969. FIX1(FIX(op, 0x11)),
  2970. OP3(ORREG1, ORREG1, OWREG1),
  2971. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  2972. ENC(dst, reg, 2)))
  2973. INSNE(sub, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  2974. FIX1(FIX(op, 0x13)),
  2975. OP3(ORREG1, OACST, OWREG1),
  2976. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  2977. ENC(dst, reg, 2)))
  2978. INSNE(sub, d_si_xsi_si, d, ext_1_or_2_src, 1cycle, C64X, TIC6X_FLAG_PREFER(0),
  2979. FIX1(FIX(op, 0xc)),
  2980. OP3(ORREG1, ORXREG1, OWREG1),
  2981. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2982. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2983. /* 16 bits insn */
  2984. INSN(sub, l, l3_sat_0, 1cycle, C64XP, 0,
  2985. FIX1(FIX(op, 0x1)),
  2986. OP3(ORREG1, ORXREG1, OWREG1),
  2987. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  2988. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  2989. INSN(sub, l, lx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  2990. FIX1(FIX(op, 0x2)),
  2991. OP3(OHWCST0, ORREG1, OWREG1),
  2992. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
  2993. INSN(sub, s, sx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  2994. FIX1(FIX(op, 0x2)),
  2995. OP3(OHWCST0, ORREG1, OWREG1),
  2996. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 1), ENC(srcdst, reg, 2)))
  2997. INSN(sub, s, sx2op, 1cycle, C64XP, 0,
  2998. FIX1(FIX(op, 0x1)),
  2999. OP3(ORREG1, ORXREG1, OWREG1),
  3000. ENC5(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2),
  3001. ENC(src2, reg, 1), ENC(x, xpath, 1)))
  3002. INSN(sub, s, s3_sat_x, 1cycle, C64XP, 0,
  3003. FIX1(FIX(op, 0x1)),
  3004. OP3(ORREG1, ORXREG1, OWREG1),
  3005. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3006. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3007. INSN(sub, d, dx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  3008. FIX1(FIX(op, 0x3)),
  3009. OP3(ORREG1, OHWCST1, OWREG1),
  3010. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
  3011. INSN(sub, d, dx2op, 1cycle, C64XP, 0,
  3012. FIX1(FIX(op, 0x1)),
  3013. OP3(ORREG1, ORXREG1, OWREG1),
  3014. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(srcdst, reg, 0),
  3015. ENC(src2, reg, 1), ENC(srcdst, reg, 2)))
  3016. /**/
  3017. INSNE(subab, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  3018. FIX1(FIX(op, 0x31)),
  3019. OP3(ORREG1, ORREG1, OWREG1),
  3020. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  3021. ENC(dst, reg, 2)))
  3022. INSNE(subab, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  3023. FIX1(FIX(op, 0x33)),
  3024. OP3(ORREG1, OACST, OWREG1),
  3025. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  3026. ENC(dst, reg, 2)))
  3027. INSN(subabs4, l, 1_or_2_src, 1cycle, C64X, 0,
  3028. FIX1(FIX(op, 0x5a)),
  3029. OP3(ORREG1, ORXREG1, OWREG1),
  3030. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3031. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3032. INSNE(subah, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  3033. FIX1(FIX(op, 0x35)),
  3034. OP3(ORREG1, ORREG1, OWREG1),
  3035. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  3036. ENC(dst, reg, 2)))
  3037. INSNE(subah, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  3038. FIX1(FIX(op, 0x37)),
  3039. OP3(ORREG1, OACST, OWREG1),
  3040. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  3041. ENC(dst, reg, 2)))
  3042. INSNE(subaw, d_si_si_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  3043. FIX1(FIX(op, 0x39)),
  3044. OP3(ORREG1, ORREG1, OWREG1),
  3045. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, reg, 1),
  3046. ENC(dst, reg, 2)))
  3047. INSNE(subaw, d_si_u5_si, d, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_NO_CROSS,
  3048. FIX1(FIX(op, 0x3b)),
  3049. OP3(ORREG1, OACST, OWREG1),
  3050. ENC4(ENC(s, fu, 0), ENC(src2, reg, 0), ENC(src1, ucst, 1),
  3051. ENC(dst, reg, 2)))
  3052. /* 16 bits insn */
  3053. INSN(subaw, d, dx5p, 1cycle, C64XP, 0,
  3054. FIX1(FIX(op, 1)),
  3055. OP3(ORB15REG1, OACST, OWB15REG1),
  3056. ENC2(ENC(s, fu, 0), ENC(cst, ucst, 1)))
  3057. /**/
  3058. INSN(subc, l, 1_or_2_src, 1cycle, C62X, 0,
  3059. FIX1(FIX(op, 0x4b)),
  3060. OP3(ORREG1, ORXREG1, OWREG1),
  3061. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3062. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3063. INSNE(subdp, l_dp_xdp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(1),
  3064. FIX1(FIX(op, 0x19)),
  3065. OP3(ORREGD12, ORXREGD12, OWREGD67),
  3066. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3067. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3068. INSNE(subdp, l_xdp_dp_dp, l, 1_or_2_src, addsubdp, C67X, TIC6X_FLAG_PREFER(0),
  3069. FIX1(FIX(op, 0x1d)),
  3070. OP3(ORXREGD12, ORREGD12, OWREGD67),
  3071. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3072. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3073. INSNE(subdp, s_dp_xdp_dp, s, l_1_or_2_src, addsubdp, C67XP,
  3074. TIC6X_FLAG_PREFER(1),
  3075. FIX1(FIX(op, 0x73)),
  3076. OP3(ORREGD12, ORXREGD12, OWREGD67),
  3077. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3078. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3079. INSNE(subdp, s_xdp_dp_dp, s, l_1_or_2_src, addsubdp, C67XP,
  3080. TIC6X_FLAG_PREFER(0),
  3081. FIX1(FIX(op, 0x77)),
  3082. OP3(ORXREGD12, ORREGD12, OWREGD67),
  3083. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3084. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  3085. INSNE(subsp, l_sp_xsp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(1),
  3086. FIX1(FIX(op, 0x11)),
  3087. OP3(ORREG1, ORXREG1, OWREG4),
  3088. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3089. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3090. INSNE(subsp, l_xsp_sp_sp, l, 1_or_2_src, 4cycle, C67X, TIC6X_FLAG_PREFER(0),
  3091. FIX1(FIX(op, 0x15)),
  3092. OP3(ORXREG1, ORREG1, OWREG4),
  3093. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3094. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3095. INSNE(subsp, s_sp_xsp_sp, s, l_1_or_2_src, 4cycle, C67XP,
  3096. TIC6X_FLAG_PREFER(1),
  3097. FIX1(FIX(op, 0x71)),
  3098. OP3(ORREG1, ORXREG1, OWREG4),
  3099. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3100. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3101. INSNE(subsp, s_xsp_sp_sp, s, l_1_or_2_src, 4cycle, C67XP,
  3102. TIC6X_FLAG_PREFER(0),
  3103. FIX1(FIX(op, 0x75)),
  3104. OP3(ORXREG1, ORREG1, OWREG4),
  3105. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3106. ENC(src1, reg, 1), ENC(dst, reg, 2)))
  3107. INSNE(subu, l_ui_xui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(1),
  3108. FIX1(FIX(op, 0x2f)),
  3109. OP3(ORREG1, ORXREG1, OWREGL1),
  3110. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3111. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3112. INSNE(subu, l_xui_ui_ul, l, 1_or_2_src, 1cycle, C62X, TIC6X_FLAG_PREFER(0),
  3113. FIX1(FIX(op, 0x3f)),
  3114. OP3(ORXREG1, ORREG1, OWREGL1),
  3115. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3116. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3117. INSN(sub2, l, 1_or_2_src, 1cycle, C64X, 0,
  3118. FIX1(FIX(op, 0x04)),
  3119. OP3(ORREG1, ORXREG1, OWREG1),
  3120. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3121. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3122. INSN(sub2, s, 1_or_2_src, 1cycle, C62X, 0,
  3123. FIX1(FIX(op, 0x11)),
  3124. OP3(ORREG1, ORXREG1, OWREG1),
  3125. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3126. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3127. INSN(sub2, d, ext_1_or_2_src, 1cycle, C64X, 0,
  3128. FIX1(FIX(op, 0x5)),
  3129. OP3(ORREG1, ORXREG1, OWREG1),
  3130. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3131. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3132. INSN(sub4, l, 1_or_2_src, 1cycle, C64X, 0,
  3133. FIX1(FIX(op, 0x66)),
  3134. OP3(ORREG1, ORXREG1, OWREG1),
  3135. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3136. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3137. INSN(swap2, l, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
  3138. FIX2(FIX(op, 0x1b), FIX(x, 0)),
  3139. OP2(ORREG1, OWREG1),
  3140. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3141. ENC(src2, reg, 0), ENC(dst, reg, 1)))
  3142. INSN(swap2, s, 1_or_2_src, 1cycle, C64X, TIC6X_FLAG_MACRO|TIC6X_FLAG_NO_CROSS,
  3143. FIX2(FIX(op, 0x10), FIX(x, 0)),
  3144. OP2(ORREG1, OWREG1),
  3145. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3146. ENC(src2, reg, 0), ENC(dst, reg, 1)))
  3147. /* Contrary to SPRUFE8, this is the correct encoding for this
  3148. instruction. */
  3149. INSN(swap4, l, unary, 1cycle, C64X, 0,
  3150. FIX1(FIX(op, 0x1)),
  3151. OP2(ORXREG1, OWREG1),
  3152. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3153. ENC(dst, reg, 1)))
  3154. INSN(swe, nfu, swe, 1cycle, C64XP, 0,
  3155. FIX1(FIX(s, 0)),
  3156. OP0(),
  3157. ENC0())
  3158. INSN(swenr, nfu, swenr, 1cycle, C64XP, 0,
  3159. FIX1(FIX(s, 0)),
  3160. OP0(),
  3161. ENC0())
  3162. INSN(unpkhu4, l, unary, 1cycle, C64X, 0,
  3163. FIX1(FIX(op, 0x03)),
  3164. OP2(ORXREG1, OWREG1),
  3165. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3166. ENC(dst, reg, 1)))
  3167. INSN(unpkhu4, s, unary, 1cycle, C64X, 0,
  3168. FIX1(FIX(op, 0x03)),
  3169. OP2(ORXREG1, OWREG1),
  3170. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3171. ENC(dst, reg, 1)))
  3172. INSN(unpklu4, l, unary, 1cycle, C64X, 0,
  3173. FIX1(FIX(op, 0x02)),
  3174. OP2(ORXREG1, OWREG1),
  3175. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3176. ENC(dst, reg, 1)))
  3177. INSN(unpklu4, s, unary, 1cycle, C64X, 0,
  3178. FIX1(FIX(op, 0x02)),
  3179. OP2(ORXREG1, OWREG1),
  3180. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3181. ENC(dst, reg, 1)))
  3182. INSNE(xor, l_ui_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  3183. FIX1(FIX(op, 0x6f)),
  3184. OP3(ORREG1, ORXREG1, OWREG1),
  3185. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3186. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3187. INSNE(xor, l_s5_xui_ui, l, 1_or_2_src, 1cycle, C62X, 0,
  3188. FIX1(FIX(op, 0x6e)),
  3189. OP3(OACST, ORXREG1, OWREG1),
  3190. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  3191. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3192. INSNE(xor, s_ui_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  3193. FIX1(FIX(op, 0x0b)),
  3194. OP3(ORREG1, ORXREG1, OWREG1),
  3195. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3196. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3197. INSNE(xor, s_s5_xui_ui, s, 1_or_2_src, 1cycle, C62X, 0,
  3198. FIX1(FIX(op, 0x0a)),
  3199. OP3(OACST, ORXREG1, OWREG1),
  3200. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  3201. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3202. INSNE(xor, d_ui_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
  3203. FIX1(FIX(op, 0xe)),
  3204. OP3(ORREG1, ORXREG1, OWREG1),
  3205. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3206. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3207. INSNE(xor, d_s5_xui_ui, d, ext_1_or_2_src, 1cycle, C64X, 0,
  3208. FIX1(FIX(op, 0xf)),
  3209. OP3(OACST, ORXREG1, OWREG1),
  3210. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, scst, 0),
  3211. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3212. /* 16 bits insn */
  3213. INSN(xor, l, l2c, 1cycle, C64XP, 0,
  3214. FIX1(FIX(op, 0x2)),
  3215. OP3(ORREG1, ORXREG1, OWREG1NORS),
  3216. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3217. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3218. INSNU(xor, l, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  3219. FIX2(FIX(op, 0x7), FIX(unit, 0x0)),
  3220. OP3(ORREG1, OHWCST1, OWREG1),
  3221. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
  3222. INSNU(xor, s, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  3223. FIX2(FIX(op, 0x7), FIX(unit, 0x1)),
  3224. OP3(ORREG1, OHWCST1, OWREG1),
  3225. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
  3226. INSNU(xor, d, lsdx1, 1cycle, C64XP, TIC6X_FLAG_NO_CROSS,
  3227. FIX2(FIX(op, 0x7), FIX(unit, 0x2)),
  3228. OP3(ORREG1, OHWCST1, OWREG1),
  3229. ENC3(ENC(s, fu, 0), ENC(srcdst, reg, 0), ENC(srcdst, reg, 2)))
  3230. /**/
  3231. INSN(xormpy, m, 1_or_2_src, 4cycle, C64XP, 0,
  3232. FIX1(FIX(op, 0x1b)),
  3233. OP3(ORREG1, ORXREG1, OWREG4),
  3234. ENC5(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src1, reg, 0),
  3235. ENC(src2, reg, 1), ENC(dst, reg, 2)))
  3236. INSN(xpnd2, m, unary, 1616_m, C64X, 0,
  3237. FIX1(FIX(op, 0x19)),
  3238. OP2(ORXREG1, OWREG2),
  3239. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3240. ENC(dst, reg, 1)))
  3241. INSN(xpnd4, m, unary, 1616_m, C64X, 0,
  3242. FIX1(FIX(op, 0x18)),
  3243. OP2(ORXREG1, OWREG2),
  3244. ENC4(ENC(s, fu, 0), ENC(x, xpath, 0), ENC(src2, reg, 0),
  3245. ENC(dst, reg, 1)))
  3246. INSN(zero, s, mvk, 1cycle, C62X, TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
  3247. FIX2(FIX(h, 0), FIX(cst, 0)),
  3248. OP1(OWREG1),
  3249. ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
  3250. INSN(zero, l, unary, 1cycle, C64X,
  3251. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
  3252. FIX3(FIX(x, 0), FIX(op, 0x05), FIX(src2, 0)),
  3253. OP1(OWREG1),
  3254. ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
  3255. INSNE(zero, l_sub, l, 1_or_2_src, 1cycle, C62X,
  3256. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
  3257. FIX2(FIX(op, 0x07), FIX(x, 0)),
  3258. OP1(OWREG1),
  3259. ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
  3260. ENC(dst, reg, 0)))
  3261. INSNE(zero, l_sub_sl, l, 1_or_2_src, 1cycle, C62X,
  3262. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO,
  3263. FIX2(FIX(op, 0x27), FIX(x, 0)),
  3264. OP1(OWREGL1),
  3265. ENC4(ENC(s, fu, 0), ENC(src1, reg_unused, 0), ENC(src2, reg_unused, 0),
  3266. ENC(dst, reg, 0)))
  3267. INSNE(zero, d_mvk, d, 1_or_2_src, 1cycle, C64X,
  3268. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(1),
  3269. FIX3(FIX(op, 0x00), FIX(src1, 0), FIX(src2, 0)),
  3270. OP1(OWREG1),
  3271. ENC2(ENC(s, fu, 0), ENC(dst, reg, 0)))
  3272. INSNE(zero, d_sub, d, 1_or_2_src, 1cycle, C62X,
  3273. TIC6X_FLAG_NO_CROSS|TIC6X_FLAG_MACRO|TIC6X_FLAG_PREFER(0),
  3274. FIX1(FIX(op, 0x11)),
  3275. OP1(OWREG1),
  3276. ENC4(ENC(s, fu, 0), ENC(src2, reg_unused, 0), ENC(src1, reg_unused, 0),
  3277. ENC(dst, reg, 0)))
  3278. #undef TIC6X_INSN_C64X_AND_C67X
  3279. #undef tic6x_insn_format_nfu_s_branch_nop_cst
  3280. #undef tic6x_insn_format_s_l_1_or_2_src
  3281. #undef RAN
  3282. #undef FIX
  3283. #undef FIX0
  3284. #undef FIX1
  3285. #undef FIX2
  3286. #undef FIX3
  3287. #undef FIX4
  3288. #undef OP0
  3289. #undef OP1
  3290. #undef OP2
  3291. #undef OP3
  3292. #undef OP4
  3293. #undef OACST
  3294. #undef OLCST
  3295. #undef OHWCSTM1
  3296. #undef OHWCST0
  3297. #undef OHWCST1
  3298. #undef OHWCST5
  3299. #undef OHWCST16
  3300. #undef OHWCST24
  3301. #undef OHWCST31
  3302. #undef OFULIST
  3303. #undef ORIRP1
  3304. #undef ORNRP1
  3305. #undef OWREG1
  3306. #undef OWRETREG1
  3307. #undef ORREG1
  3308. #undef ORDREG1
  3309. #undef ORWREG1
  3310. #undef ORAREG1
  3311. #undef ORXREG1
  3312. #undef ORREG12
  3313. #undef ORREG14
  3314. #undef ORXREG14
  3315. #undef OWREG2
  3316. #undef OWREG4
  3317. #undef OWREG9
  3318. #undef OWDREG5
  3319. #undef OWREGL1
  3320. #undef ORREGL1
  3321. #undef OWREGD1
  3322. #undef ORTREG1
  3323. #undef ORTREGD1
  3324. #undef OWTREG5
  3325. #undef OWTREGD5
  3326. #undef OWREGD12
  3327. #undef OWREGD4
  3328. #undef ORREGD1
  3329. #undef OWREGD45
  3330. #undef OWREGD67
  3331. #undef ORDREGD1
  3332. #undef OWDREGD5
  3333. #undef ORREGD12
  3334. #undef ORXREGD12
  3335. #undef ORXREGD1234
  3336. #undef ORREGD1324
  3337. #undef OWREGD910
  3338. #undef OWILC1
  3339. #undef ORCREG1
  3340. #undef OWCREG1
  3341. #undef OWREG1Z
  3342. #undef ORB15REG1
  3343. #undef OWB15REG1
  3344. #undef ORMEMDW
  3345. #undef OWMEMDW
  3346. #undef ORMEMSB
  3347. #undef OWMEMSB
  3348. #undef ORMEMLB
  3349. #undef OWMEMLB
  3350. #undef ORMEMSH
  3351. #undef OWMEMSH
  3352. #undef ORMEMLH
  3353. #undef OWMEMLH
  3354. #undef ORMEMSW
  3355. #undef OWMEMSW
  3356. #undef ORMEMLW
  3357. #undef OWMEMLW
  3358. #undef ORMEMSD
  3359. #undef OWMEMSD
  3360. #undef ORMEMND
  3361. #undef OWMEMND
  3362. #undef ENC
  3363. #undef ENC0
  3364. #undef ENC1
  3365. #undef ENC2
  3366. #undef ENC3
  3367. #undef ENC4
  3368. #undef ENC5
  3369. #undef ENC6
  3370. #undef ENC7