/ src / Spv.Generator / Autogenerated / CoreGrammar.cs
CoreGrammar.cs
   1  // AUTOGENERATED: DO NOT EDIT
   2  // Last update date: 2021-01-06 23:02:26.837899
   3  #region Grammar License
   4  // Copyright (c) 2014-2020 The Khronos Group Inc.
   5  //
   6  // Permission is hereby granted, free of charge, to any person obtaining a copy
   7  // of this software and/or associated documentation files (the "Materials"),
   8  // to deal in the Materials without restriction, including without limitation
   9  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10  // and/or sell copies of the Materials, and to permit persons to whom the
  11  // Materials are furnished to do so, subject to the following conditions:
  12  //
  13  // The above copyright notice and this permission notice shall be included in
  14  // all copies or substantial portions of the Materials.
  15  //
  16  // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
  17  // STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
  18  // HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
  19  //
  20  // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  23  // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  24  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  25  // FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
  26  // IN THE MATERIALS.
  27  #endregion
  28  
  29  using static Spv.Specification;
  30  
  31  namespace Spv.Generator
  32  {
  33      public partial class Module
  34      {
  35          // Miscellaneous
  36  
  37          public Instruction Nop()
  38          {
  39              Instruction result = NewInstruction(Op.OpNop);
  40  
  41              AddToFunctionDefinitions(result);
  42  
  43              return result;
  44          }
  45  
  46          public Instruction Undef(Instruction resultType)
  47          {
  48              Instruction result = NewInstruction(Op.OpUndef, GetNewId(), resultType);
  49  
  50              AddToFunctionDefinitions(result);
  51  
  52              return result;
  53          }
  54  
  55          public Instruction SizeOf(Instruction resultType, Instruction pointer)
  56          {
  57              Instruction result = NewInstruction(Op.OpSizeOf, GetNewId(), resultType);
  58  
  59              result.AddOperand(pointer);
  60              AddToFunctionDefinitions(result);
  61  
  62              return result;
  63          }
  64  
  65          // Debug
  66  
  67          public Instruction SourceContinued(string continuedSource)
  68          {
  69              Instruction result = NewInstruction(Op.OpSourceContinued);
  70  
  71              result.AddOperand(continuedSource);
  72              AddDebug(result);
  73  
  74              return result;
  75          }
  76  
  77          public Instruction Source(SourceLanguage sourceLanguage, LiteralInteger version, Instruction file = null, string source = null)
  78          {
  79              Instruction result = NewInstruction(Op.OpSource);
  80  
  81              result.AddOperand(sourceLanguage);
  82              result.AddOperand(version);
  83              if (file != null)
  84              {
  85                  result.AddOperand(file);
  86              }
  87              if (source != null)
  88              {
  89                  result.AddOperand(source);
  90              }
  91              AddDebug(result);
  92  
  93              return result;
  94          }
  95  
  96          public Instruction SourceExtension(string extension)
  97          {
  98              Instruction result = NewInstruction(Op.OpSourceExtension);
  99  
 100              result.AddOperand(extension);
 101              AddDebug(result);
 102  
 103              return result;
 104          }
 105  
 106          public Instruction Name(Instruction target, string name)
 107          {
 108              Instruction result = NewInstruction(Op.OpName);
 109  
 110              result.AddOperand(target);
 111              result.AddOperand(name);
 112              AddDebug(result);
 113  
 114              return result;
 115          }
 116  
 117          public Instruction MemberName(Instruction type, LiteralInteger member, string name)
 118          {
 119              Instruction result = NewInstruction(Op.OpMemberName);
 120  
 121              result.AddOperand(type);
 122              result.AddOperand(member);
 123              result.AddOperand(name);
 124              AddDebug(result);
 125  
 126              return result;
 127          }
 128  
 129          public Instruction String(string str)
 130          {
 131              Instruction result = NewInstruction(Op.OpString, GetNewId());
 132  
 133              result.AddOperand(str);
 134              AddDebug(result);
 135  
 136              return result;
 137          }
 138  
 139          public Instruction Line(Instruction file, LiteralInteger line, LiteralInteger column)
 140          {
 141              Instruction result = NewInstruction(Op.OpLine);
 142  
 143              result.AddOperand(file);
 144              result.AddOperand(line);
 145              result.AddOperand(column);
 146              AddDebug(result);
 147  
 148              return result;
 149          }
 150  
 151          public Instruction NoLine()
 152          {
 153              Instruction result = NewInstruction(Op.OpNoLine);
 154  
 155              AddDebug(result);
 156  
 157              return result;
 158          }
 159  
 160          public Instruction ModuleProcessed(string process)
 161          {
 162              Instruction result = NewInstruction(Op.OpModuleProcessed);
 163  
 164              result.AddOperand(process);
 165              AddDebug(result);
 166  
 167              return result;
 168          }
 169  
 170          // Annotation
 171  
 172          public Instruction Decorate(Instruction target, Decoration decoration)
 173          {
 174              Instruction result = NewInstruction(Op.OpDecorate);
 175  
 176              result.AddOperand(target);
 177              result.AddOperand(decoration);
 178              AddAnnotation(result);
 179  
 180              return result;
 181          }
 182  
 183          public Instruction Decorate(Instruction target, Decoration decoration, IOperand parameter)
 184          {
 185              Instruction result = NewInstruction(Op.OpDecorate);
 186  
 187              result.AddOperand(target);
 188              result.AddOperand(decoration);
 189              result.AddOperand(parameter);
 190              AddAnnotation(result);
 191  
 192              return result;
 193          }
 194  
 195          public Instruction Decorate(Instruction target, Decoration decoration, params IOperand[] parameters)
 196          {
 197              Instruction result = NewInstruction(Op.OpDecorate);
 198  
 199              result.AddOperand(target);
 200              result.AddOperand(decoration);
 201              result.AddOperand(parameters);
 202              AddAnnotation(result);
 203  
 204              return result;
 205          }
 206  
 207          public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration)
 208          {
 209              Instruction result = NewInstruction(Op.OpMemberDecorate);
 210  
 211              result.AddOperand(structureType);
 212              result.AddOperand(member);
 213              result.AddOperand(decoration);
 214              AddAnnotation(result);
 215  
 216              return result;
 217          }
 218  
 219          public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, IOperand parameter)
 220          {
 221              Instruction result = NewInstruction(Op.OpMemberDecorate);
 222  
 223              result.AddOperand(structureType);
 224              result.AddOperand(member);
 225              result.AddOperand(decoration);
 226              result.AddOperand(parameter);
 227              AddAnnotation(result);
 228  
 229              return result;
 230          }
 231  
 232          public Instruction MemberDecorate(Instruction structureType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
 233          {
 234              Instruction result = NewInstruction(Op.OpMemberDecorate);
 235  
 236              result.AddOperand(structureType);
 237              result.AddOperand(member);
 238              result.AddOperand(decoration);
 239              result.AddOperand(parameters);
 240              AddAnnotation(result);
 241  
 242              return result;
 243          }
 244  
 245          public Instruction DecorationGroup()
 246          {
 247              Instruction result = NewInstruction(Op.OpDecorationGroup, GetNewId());
 248  
 249              AddAnnotation(result);
 250  
 251              return result;
 252          }
 253  
 254          public Instruction GroupDecorate(Instruction decorationGroup, params Instruction[] targets)
 255          {
 256              Instruction result = NewInstruction(Op.OpGroupDecorate);
 257  
 258              result.AddOperand(decorationGroup);
 259              result.AddOperand(targets);
 260              AddAnnotation(result);
 261  
 262              return result;
 263          }
 264  
 265          public Instruction GroupMemberDecorate(Instruction decorationGroup, params IOperand[] targets)
 266          {
 267              Instruction result = NewInstruction(Op.OpGroupMemberDecorate);
 268  
 269              result.AddOperand(decorationGroup);
 270              result.AddOperand(targets);
 271              AddAnnotation(result);
 272  
 273              return result;
 274          }
 275  
 276          public Instruction DecorateId(Instruction target, Decoration decoration, params IOperand[] parameters)
 277          {
 278              Instruction result = NewInstruction(Op.OpDecorateId);
 279  
 280              result.AddOperand(target);
 281              result.AddOperand(decoration);
 282              result.AddOperand(parameters);
 283              AddAnnotation(result);
 284  
 285              return result;
 286          }
 287  
 288          public Instruction DecorateString(Instruction target, Decoration decoration, params IOperand[] parameters)
 289          {
 290              Instruction result = NewInstruction(Op.OpDecorateString);
 291  
 292              result.AddOperand(target);
 293              result.AddOperand(decoration);
 294              result.AddOperand(parameters);
 295              AddAnnotation(result);
 296  
 297              return result;
 298          }
 299  
 300          public Instruction DecorateStringGOOGLE(Instruction target, Decoration decoration, params IOperand[] parameters)
 301          {
 302              Instruction result = NewInstruction(Op.OpDecorateStringGOOGLE);
 303  
 304              result.AddOperand(target);
 305              result.AddOperand(decoration);
 306              result.AddOperand(parameters);
 307              AddAnnotation(result);
 308  
 309              return result;
 310          }
 311  
 312          public Instruction MemberDecorateString(Instruction structType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
 313          {
 314              Instruction result = NewInstruction(Op.OpMemberDecorateString);
 315  
 316              result.AddOperand(structType);
 317              result.AddOperand(member);
 318              result.AddOperand(decoration);
 319              result.AddOperand(parameters);
 320              AddAnnotation(result);
 321  
 322              return result;
 323          }
 324  
 325          public Instruction MemberDecorateStringGOOGLE(Instruction structType, LiteralInteger member, Decoration decoration, params IOperand[] parameters)
 326          {
 327              Instruction result = NewInstruction(Op.OpMemberDecorateStringGOOGLE);
 328  
 329              result.AddOperand(structType);
 330              result.AddOperand(member);
 331              result.AddOperand(decoration);
 332              result.AddOperand(parameters);
 333              AddAnnotation(result);
 334  
 335              return result;
 336          }
 337  
 338          // Type-Declaration
 339  
 340          public Instruction TypeVoid(bool forceIdAllocation = false)
 341          {
 342              Instruction result = NewInstruction(Op.OpTypeVoid);
 343  
 344              AddTypeDeclaration(result, forceIdAllocation);
 345  
 346              return result;
 347          }
 348  
 349          public Instruction TypeBool(bool forceIdAllocation = false)
 350          {
 351              Instruction result = NewInstruction(Op.OpTypeBool);
 352  
 353              AddTypeDeclaration(result, forceIdAllocation);
 354  
 355              return result;
 356          }
 357  
 358          public Instruction TypeInt(LiteralInteger width, LiteralInteger signedness, bool forceIdAllocation = false)
 359          {
 360              Instruction result = NewInstruction(Op.OpTypeInt);
 361  
 362              result.AddOperand(width);
 363              result.AddOperand(signedness);
 364              AddTypeDeclaration(result, forceIdAllocation);
 365  
 366              return result;
 367          }
 368  
 369          public Instruction TypeFloat(LiteralInteger width, bool forceIdAllocation = false)
 370          {
 371              Instruction result = NewInstruction(Op.OpTypeFloat);
 372  
 373              result.AddOperand(width);
 374              AddTypeDeclaration(result, forceIdAllocation);
 375  
 376              return result;
 377          }
 378  
 379          public Instruction TypeVector(Instruction componentType, LiteralInteger componentCount, bool forceIdAllocation = false)
 380          {
 381              Instruction result = NewInstruction(Op.OpTypeVector);
 382  
 383              result.AddOperand(componentType);
 384              result.AddOperand(componentCount);
 385              AddTypeDeclaration(result, forceIdAllocation);
 386  
 387              return result;
 388          }
 389  
 390          public Instruction TypeMatrix(Instruction columnType, LiteralInteger columnCount, bool forceIdAllocation = false)
 391          {
 392              Instruction result = NewInstruction(Op.OpTypeMatrix);
 393  
 394              result.AddOperand(columnType);
 395              result.AddOperand(columnCount);
 396              AddTypeDeclaration(result, forceIdAllocation);
 397  
 398              return result;
 399          }
 400  
 401          public Instruction TypeImage(Instruction sampledType, Dim dim, LiteralInteger depth, LiteralInteger arrayed, LiteralInteger mS, LiteralInteger sampled, ImageFormat imageFormat, AccessQualifier accessQualifier = (AccessQualifier)int.MaxValue, bool forceIdAllocation = false)
 402          {
 403              Instruction result = NewInstruction(Op.OpTypeImage);
 404  
 405              result.AddOperand(sampledType);
 406              result.AddOperand(dim);
 407              result.AddOperand(depth);
 408              result.AddOperand(arrayed);
 409              result.AddOperand(mS);
 410              result.AddOperand(sampled);
 411              result.AddOperand(imageFormat);
 412              if (accessQualifier != (AccessQualifier)int.MaxValue)
 413              {
 414                  result.AddOperand(accessQualifier);
 415              }
 416              AddTypeDeclaration(result, forceIdAllocation);
 417  
 418              return result;
 419          }
 420  
 421          public Instruction TypeSampler(bool forceIdAllocation = false)
 422          {
 423              Instruction result = NewInstruction(Op.OpTypeSampler);
 424  
 425              AddTypeDeclaration(result, forceIdAllocation);
 426  
 427              return result;
 428          }
 429  
 430          public Instruction TypeSampledImage(Instruction imageType, bool forceIdAllocation = false)
 431          {
 432              Instruction result = NewInstruction(Op.OpTypeSampledImage);
 433  
 434              result.AddOperand(imageType);
 435              AddTypeDeclaration(result, forceIdAllocation);
 436  
 437              return result;
 438          }
 439  
 440          public Instruction TypeArray(Instruction elementType, Instruction length, bool forceIdAllocation = false)
 441          {
 442              Instruction result = NewInstruction(Op.OpTypeArray);
 443  
 444              result.AddOperand(elementType);
 445              result.AddOperand(length);
 446              AddTypeDeclaration(result, forceIdAllocation);
 447  
 448              return result;
 449          }
 450  
 451          public Instruction TypeRuntimeArray(Instruction elementType, bool forceIdAllocation = false)
 452          {
 453              Instruction result = NewInstruction(Op.OpTypeRuntimeArray);
 454  
 455              result.AddOperand(elementType);
 456              AddTypeDeclaration(result, forceIdAllocation);
 457  
 458              return result;
 459          }
 460  
 461          public Instruction TypeStruct(bool forceIdAllocation, params Instruction[] parameters)
 462          {
 463              Instruction result = NewInstruction(Op.OpTypeStruct);
 464  
 465              result.AddOperand(parameters);
 466              AddTypeDeclaration(result, forceIdAllocation);
 467  
 468              return result;
 469          }
 470  
 471          public Instruction TypeOpaque(string thenameoftheopaquetype, bool forceIdAllocation = false)
 472          {
 473              Instruction result = NewInstruction(Op.OpTypeOpaque);
 474  
 475              result.AddOperand(thenameoftheopaquetype);
 476              AddTypeDeclaration(result, forceIdAllocation);
 477  
 478              return result;
 479          }
 480  
 481          public Instruction TypePointer(StorageClass storageClass, Instruction type, bool forceIdAllocation = false)
 482          {
 483              Instruction result = NewInstruction(Op.OpTypePointer);
 484  
 485              result.AddOperand(storageClass);
 486              result.AddOperand(type);
 487              AddTypeDeclaration(result, forceIdAllocation);
 488  
 489              return result;
 490          }
 491  
 492          public Instruction TypeFunction(Instruction returnType, bool forceIdAllocation, params Instruction[] parameters)
 493          {
 494              Instruction result = NewInstruction(Op.OpTypeFunction);
 495  
 496              result.AddOperand(returnType);
 497              result.AddOperand(parameters);
 498              AddTypeDeclaration(result, forceIdAllocation);
 499  
 500              return result;
 501          }
 502  
 503          public Instruction TypeEvent(bool forceIdAllocation = false)
 504          {
 505              Instruction result = NewInstruction(Op.OpTypeEvent);
 506  
 507              AddTypeDeclaration(result, forceIdAllocation);
 508  
 509              return result;
 510          }
 511  
 512          public Instruction TypeDeviceEvent(bool forceIdAllocation = false)
 513          {
 514              Instruction result = NewInstruction(Op.OpTypeDeviceEvent);
 515  
 516              AddTypeDeclaration(result, forceIdAllocation);
 517  
 518              return result;
 519          }
 520  
 521          public Instruction TypeReserveId(bool forceIdAllocation = false)
 522          {
 523              Instruction result = NewInstruction(Op.OpTypeReserveId);
 524  
 525              AddTypeDeclaration(result, forceIdAllocation);
 526  
 527              return result;
 528          }
 529  
 530          public Instruction TypeQueue(bool forceIdAllocation = false)
 531          {
 532              Instruction result = NewInstruction(Op.OpTypeQueue);
 533  
 534              AddTypeDeclaration(result, forceIdAllocation);
 535  
 536              return result;
 537          }
 538  
 539          public Instruction TypePipe(AccessQualifier qualifier, bool forceIdAllocation = false)
 540          {
 541              Instruction result = NewInstruction(Op.OpTypePipe);
 542  
 543              result.AddOperand(qualifier);
 544              AddTypeDeclaration(result, forceIdAllocation);
 545  
 546              return result;
 547          }
 548  
 549          public Instruction TypeForwardPointer(Instruction pointerType, StorageClass storageClass, bool forceIdAllocation = false)
 550          {
 551              Instruction result = NewInstruction(Op.OpTypeForwardPointer);
 552  
 553              result.AddOperand(pointerType);
 554              result.AddOperand(storageClass);
 555              AddTypeDeclaration(result, forceIdAllocation);
 556  
 557              return result;
 558          }
 559  
 560          public Instruction TypePipeStorage(bool forceIdAllocation = false)
 561          {
 562              Instruction result = NewInstruction(Op.OpTypePipeStorage);
 563  
 564              AddTypeDeclaration(result, forceIdAllocation);
 565  
 566              return result;
 567          }
 568  
 569          public Instruction TypeNamedBarrier(bool forceIdAllocation = false)
 570          {
 571              Instruction result = NewInstruction(Op.OpTypeNamedBarrier);
 572  
 573              AddTypeDeclaration(result, forceIdAllocation);
 574  
 575              return result;
 576          }
 577  
 578          // Constant-Creation
 579  
 580          public Instruction ConstantTrue(Instruction resultType)
 581          {
 582              Instruction result = NewInstruction(Op.OpConstantTrue, Instruction.InvalidId, resultType);
 583  
 584              AddConstant(result);
 585  
 586              return result;
 587          }
 588  
 589          public Instruction ConstantFalse(Instruction resultType)
 590          {
 591              Instruction result = NewInstruction(Op.OpConstantFalse, Instruction.InvalidId, resultType);
 592  
 593              AddConstant(result);
 594  
 595              return result;
 596          }
 597  
 598          public Instruction Constant(Instruction resultType, LiteralInteger value)
 599          {
 600              Instruction result = NewInstruction(Op.OpConstant, Instruction.InvalidId, resultType);
 601  
 602              result.AddOperand(value);
 603              AddConstant(result);
 604  
 605              return result;
 606          }
 607  
 608          public Instruction ConstantComposite(Instruction resultType, params Instruction[] constituents)
 609          {
 610              Instruction result = NewInstruction(Op.OpConstantComposite, Instruction.InvalidId, resultType);
 611  
 612              result.AddOperand(constituents);
 613              AddConstant(result);
 614  
 615              return result;
 616          }
 617  
 618          public Instruction ConstantSampler(Instruction resultType, SamplerAddressingMode samplerAddressingMode, LiteralInteger param, SamplerFilterMode samplerFilterMode)
 619          {
 620              Instruction result = NewInstruction(Op.OpConstantSampler, Instruction.InvalidId, resultType);
 621  
 622              result.AddOperand(samplerAddressingMode);
 623              result.AddOperand(param);
 624              result.AddOperand(samplerFilterMode);
 625              AddConstant(result);
 626  
 627              return result;
 628          }
 629  
 630          public Instruction ConstantNull(Instruction resultType)
 631          {
 632              Instruction result = NewInstruction(Op.OpConstantNull, Instruction.InvalidId, resultType);
 633  
 634              AddConstant(result);
 635  
 636              return result;
 637          }
 638  
 639          public Instruction SpecConstantTrue(Instruction resultType)
 640          {
 641              Instruction result = NewInstruction(Op.OpSpecConstantTrue, GetNewId(), resultType);
 642  
 643              AddToFunctionDefinitions(result);
 644  
 645              return result;
 646          }
 647  
 648          public Instruction SpecConstantFalse(Instruction resultType)
 649          {
 650              Instruction result = NewInstruction(Op.OpSpecConstantFalse, GetNewId(), resultType);
 651  
 652              AddToFunctionDefinitions(result);
 653  
 654              return result;
 655          }
 656  
 657          public Instruction SpecConstant(Instruction resultType, LiteralInteger value)
 658          {
 659              Instruction result = NewInstruction(Op.OpSpecConstant, GetNewId(), resultType);
 660  
 661              result.AddOperand(value);
 662              AddToFunctionDefinitions(result);
 663  
 664              return result;
 665          }
 666  
 667          public Instruction SpecConstantComposite(Instruction resultType, params Instruction[] constituents)
 668          {
 669              Instruction result = NewInstruction(Op.OpSpecConstantComposite, GetNewId(), resultType);
 670  
 671              result.AddOperand(constituents);
 672              AddToFunctionDefinitions(result);
 673  
 674              return result;
 675          }
 676  
 677          public Instruction SpecConstantOp(Instruction resultType, LiteralInteger opcode)
 678          {
 679              Instruction result = NewInstruction(Op.OpSpecConstantOp, GetNewId(), resultType);
 680  
 681              result.AddOperand(opcode);
 682              AddToFunctionDefinitions(result);
 683  
 684              return result;
 685          }
 686  
 687          // Memory
 688  
 689          public Instruction Variable(Instruction resultType, StorageClass storageClass, Instruction initializer = null)
 690          {
 691              Instruction result = NewInstruction(Op.OpVariable, GetNewId(), resultType);
 692  
 693              result.AddOperand(storageClass);
 694              if (initializer != null)
 695              {
 696                  result.AddOperand(initializer);
 697              }
 698              return result;
 699          }
 700  
 701          public Instruction ImageTexelPointer(Instruction resultType, Instruction image, Instruction coordinate, Instruction sample)
 702          {
 703              Instruction result = NewInstruction(Op.OpImageTexelPointer, GetNewId(), resultType);
 704  
 705              result.AddOperand(image);
 706              result.AddOperand(coordinate);
 707              result.AddOperand(sample);
 708              AddToFunctionDefinitions(result);
 709  
 710              return result;
 711          }
 712  
 713          public Instruction Load(Instruction resultType, Instruction pointer, MemoryAccessMask memoryAccess = (MemoryAccessMask)int.MaxValue)
 714          {
 715              Instruction result = NewInstruction(Op.OpLoad, GetNewId(), resultType);
 716  
 717              result.AddOperand(pointer);
 718              if (memoryAccess != (MemoryAccessMask)int.MaxValue)
 719              {
 720                  result.AddOperand(memoryAccess);
 721              }
 722              AddToFunctionDefinitions(result);
 723  
 724              return result;
 725          }
 726  
 727          public Instruction Store(Instruction pointer, Instruction obj, MemoryAccessMask memoryAccess = (MemoryAccessMask)int.MaxValue)
 728          {
 729              Instruction result = NewInstruction(Op.OpStore);
 730  
 731              result.AddOperand(pointer);
 732              result.AddOperand(obj);
 733              if (memoryAccess != (MemoryAccessMask)int.MaxValue)
 734              {
 735                  result.AddOperand(memoryAccess);
 736              }
 737              AddToFunctionDefinitions(result);
 738  
 739              return result;
 740          }
 741  
 742          public Instruction CopyMemory(Instruction target, Instruction source, MemoryAccessMask memoryAccess0 = (MemoryAccessMask)int.MaxValue, MemoryAccessMask memoryAccess1 = (MemoryAccessMask)int.MaxValue)
 743          {
 744              Instruction result = NewInstruction(Op.OpCopyMemory);
 745  
 746              result.AddOperand(target);
 747              result.AddOperand(source);
 748              if (memoryAccess0 != (MemoryAccessMask)int.MaxValue)
 749              {
 750                  result.AddOperand(memoryAccess0);
 751              }
 752              if (memoryAccess1 != (MemoryAccessMask)int.MaxValue)
 753              {
 754                  result.AddOperand(memoryAccess1);
 755              }
 756              AddToFunctionDefinitions(result);
 757  
 758              return result;
 759          }
 760  
 761          public Instruction CopyMemorySized(Instruction target, Instruction source, Instruction size, MemoryAccessMask memoryAccess0 = (MemoryAccessMask)int.MaxValue, MemoryAccessMask memoryAccess1 = (MemoryAccessMask)int.MaxValue)
 762          {
 763              Instruction result = NewInstruction(Op.OpCopyMemorySized);
 764  
 765              result.AddOperand(target);
 766              result.AddOperand(source);
 767              result.AddOperand(size);
 768              if (memoryAccess0 != (MemoryAccessMask)int.MaxValue)
 769              {
 770                  result.AddOperand(memoryAccess0);
 771              }
 772              if (memoryAccess1 != (MemoryAccessMask)int.MaxValue)
 773              {
 774                  result.AddOperand(memoryAccess1);
 775              }
 776              AddToFunctionDefinitions(result);
 777  
 778              return result;
 779          }
 780  
 781          public Instruction AccessChain(Instruction resultType, Instruction baseObj, Instruction index)
 782          {
 783              Instruction result = NewInstruction(Op.OpAccessChain, GetNewId(), resultType);
 784  
 785              result.AddOperand(baseObj);
 786              result.AddOperand(index);
 787              AddToFunctionDefinitions(result);
 788  
 789              return result;
 790          }
 791  
 792          public Instruction AccessChain(Instruction resultType, Instruction baseObj, Instruction index0, Instruction index1)
 793          {
 794              Instruction result = NewInstruction(Op.OpAccessChain, GetNewId(), resultType);
 795  
 796              result.AddOperand(baseObj);
 797              result.AddOperand(index0);
 798              result.AddOperand(index1);
 799              AddToFunctionDefinitions(result);
 800  
 801              return result;
 802          }
 803  
 804          public Instruction AccessChain(Instruction resultType, Instruction baseObj, Instruction index0, Instruction index1, Instruction index2)
 805          {
 806              Instruction result = NewInstruction(Op.OpAccessChain, GetNewId(), resultType);
 807  
 808              result.AddOperand(baseObj);
 809              result.AddOperand(index0);
 810              result.AddOperand(index1);
 811              result.AddOperand(index2);
 812              AddToFunctionDefinitions(result);
 813  
 814              return result;
 815          }
 816  
 817          public Instruction AccessChain(Instruction resultType, Instruction baseObj, params Instruction[] indexes)
 818          {
 819              Instruction result = NewInstruction(Op.OpAccessChain, GetNewId(), resultType);
 820  
 821              result.AddOperand(baseObj);
 822              result.AddOperand(indexes);
 823              AddToFunctionDefinitions(result);
 824  
 825              return result;
 826          }
 827  
 828          public Instruction InBoundsAccessChain(Instruction resultType, Instruction baseObj, params Instruction[] indexes)
 829          {
 830              Instruction result = NewInstruction(Op.OpInBoundsAccessChain, GetNewId(), resultType);
 831  
 832              result.AddOperand(baseObj);
 833              result.AddOperand(indexes);
 834              AddToFunctionDefinitions(result);
 835  
 836              return result;
 837          }
 838  
 839          public Instruction PtrAccessChain(Instruction resultType, Instruction baseObj, Instruction element, params Instruction[] indexes)
 840          {
 841              Instruction result = NewInstruction(Op.OpPtrAccessChain, GetNewId(), resultType);
 842  
 843              result.AddOperand(baseObj);
 844              result.AddOperand(element);
 845              result.AddOperand(indexes);
 846              AddToFunctionDefinitions(result);
 847  
 848              return result;
 849          }
 850  
 851          public Instruction ArrayLength(Instruction resultType, Instruction structure, LiteralInteger arraymember)
 852          {
 853              Instruction result = NewInstruction(Op.OpArrayLength, GetNewId(), resultType);
 854  
 855              result.AddOperand(structure);
 856              result.AddOperand(arraymember);
 857              AddToFunctionDefinitions(result);
 858  
 859              return result;
 860          }
 861  
 862          public Instruction GenericPtrMemSemantics(Instruction resultType, Instruction pointer)
 863          {
 864              Instruction result = NewInstruction(Op.OpGenericPtrMemSemantics, GetNewId(), resultType);
 865  
 866              result.AddOperand(pointer);
 867              AddToFunctionDefinitions(result);
 868  
 869              return result;
 870          }
 871  
 872          public Instruction InBoundsPtrAccessChain(Instruction resultType, Instruction baseObj, Instruction element, params Instruction[] indexes)
 873          {
 874              Instruction result = NewInstruction(Op.OpInBoundsPtrAccessChain, GetNewId(), resultType);
 875  
 876              result.AddOperand(baseObj);
 877              result.AddOperand(element);
 878              result.AddOperand(indexes);
 879              AddToFunctionDefinitions(result);
 880  
 881              return result;
 882          }
 883  
 884          public Instruction PtrEqual(Instruction resultType, Instruction operand1, Instruction operand2)
 885          {
 886              Instruction result = NewInstruction(Op.OpPtrEqual, GetNewId(), resultType);
 887  
 888              result.AddOperand(operand1);
 889              result.AddOperand(operand2);
 890              AddToFunctionDefinitions(result);
 891  
 892              return result;
 893          }
 894  
 895          public Instruction PtrNotEqual(Instruction resultType, Instruction operand1, Instruction operand2)
 896          {
 897              Instruction result = NewInstruction(Op.OpPtrNotEqual, GetNewId(), resultType);
 898  
 899              result.AddOperand(operand1);
 900              result.AddOperand(operand2);
 901              AddToFunctionDefinitions(result);
 902  
 903              return result;
 904          }
 905  
 906          public Instruction PtrDiff(Instruction resultType, Instruction operand1, Instruction operand2)
 907          {
 908              Instruction result = NewInstruction(Op.OpPtrDiff, GetNewId(), resultType);
 909  
 910              result.AddOperand(operand1);
 911              result.AddOperand(operand2);
 912              AddToFunctionDefinitions(result);
 913  
 914              return result;
 915          }
 916  
 917          // Function
 918  
 919          public Instruction Function(Instruction resultType, FunctionControlMask functionControl, Instruction functionType)
 920          {
 921              Instruction result = NewInstruction(Op.OpFunction, GetNewId(), resultType);
 922  
 923              result.AddOperand(functionControl);
 924              result.AddOperand(functionType);
 925  
 926              return result;
 927          }
 928  
 929          public void AddFunction(Instruction function)
 930          {
 931              AddToFunctionDefinitions(function);
 932          }
 933  
 934          public Instruction FunctionParameter(Instruction resultType)
 935          {
 936              Instruction result = NewInstruction(Op.OpFunctionParameter, GetNewId(), resultType);
 937  
 938              AddToFunctionDefinitions(result);
 939  
 940              return result;
 941          }
 942  
 943          public Instruction FunctionEnd()
 944          {
 945              Instruction result = NewInstruction(Op.OpFunctionEnd);
 946  
 947              AddToFunctionDefinitions(result);
 948  
 949              return result;
 950          }
 951  
 952          public Instruction FunctionCall(Instruction resultType, Instruction function, params Instruction[] parameters)
 953          {
 954              Instruction result = NewInstruction(Op.OpFunctionCall, GetNewId(), resultType);
 955  
 956              result.AddOperand(function);
 957              result.AddOperand(parameters);
 958              AddToFunctionDefinitions(result);
 959  
 960              return result;
 961          }
 962  
 963          // Image
 964  
 965          public Instruction SampledImage(Instruction resultType, Instruction image, Instruction sampler)
 966          {
 967              Instruction result = NewInstruction(Op.OpSampledImage, GetNewId(), resultType);
 968  
 969              result.AddOperand(image);
 970              result.AddOperand(sampler);
 971              AddToFunctionDefinitions(result);
 972  
 973              return result;
 974          }
 975  
 976          public Instruction ImageSampleImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
 977          {
 978              Instruction result = NewInstruction(Op.OpImageSampleImplicitLod, GetNewId(), resultType);
 979  
 980              result.AddOperand(sampledImage);
 981              result.AddOperand(coordinate);
 982              if (imageOperands != (ImageOperandsMask)int.MaxValue)
 983              {
 984                  result.AddOperand(imageOperands);
 985              }
 986              if (imageOperands != (ImageOperandsMask)int.MaxValue)
 987              {
 988                  result.AddOperand(imageOperandIds);
 989              }
 990              AddToFunctionDefinitions(result);
 991  
 992              return result;
 993          }
 994  
 995          public Instruction ImageSampleExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
 996          {
 997              Instruction result = NewInstruction(Op.OpImageSampleExplicitLod, GetNewId(), resultType);
 998  
 999              result.AddOperand(sampledImage);
1000              result.AddOperand(coordinate);
1001              result.AddOperand(imageOperands);
1002              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1003              {
1004                  result.AddOperand(imageOperandIds);
1005              }
1006              AddToFunctionDefinitions(result);
1007  
1008              return result;
1009          }
1010  
1011          public Instruction ImageSampleDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1012          {
1013              Instruction result = NewInstruction(Op.OpImageSampleDrefImplicitLod, GetNewId(), resultType);
1014  
1015              result.AddOperand(sampledImage);
1016              result.AddOperand(coordinate);
1017              result.AddOperand(dRef);
1018              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1019              {
1020                  result.AddOperand(imageOperands);
1021              }
1022              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1023              {
1024                  result.AddOperand(imageOperandIds);
1025              }
1026              AddToFunctionDefinitions(result);
1027  
1028              return result;
1029          }
1030  
1031          public Instruction ImageSampleDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1032          {
1033              Instruction result = NewInstruction(Op.OpImageSampleDrefExplicitLod, GetNewId(), resultType);
1034  
1035              result.AddOperand(sampledImage);
1036              result.AddOperand(coordinate);
1037              result.AddOperand(dRef);
1038              result.AddOperand(imageOperands);
1039              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1040              {
1041                  result.AddOperand(imageOperandIds);
1042              }
1043              AddToFunctionDefinitions(result);
1044  
1045              return result;
1046          }
1047  
1048          public Instruction ImageSampleProjImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1049          {
1050              Instruction result = NewInstruction(Op.OpImageSampleProjImplicitLod, GetNewId(), resultType);
1051  
1052              result.AddOperand(sampledImage);
1053              result.AddOperand(coordinate);
1054              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1055              {
1056                  result.AddOperand(imageOperands);
1057              }
1058              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1059              {
1060                  result.AddOperand(imageOperandIds);
1061              }
1062              AddToFunctionDefinitions(result);
1063  
1064              return result;
1065          }
1066  
1067          public Instruction ImageSampleProjExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1068          {
1069              Instruction result = NewInstruction(Op.OpImageSampleProjExplicitLod, GetNewId(), resultType);
1070  
1071              result.AddOperand(sampledImage);
1072              result.AddOperand(coordinate);
1073              result.AddOperand(imageOperands);
1074              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1075              {
1076                  result.AddOperand(imageOperandIds);
1077              }
1078              AddToFunctionDefinitions(result);
1079  
1080              return result;
1081          }
1082  
1083          public Instruction ImageSampleProjDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1084          {
1085              Instruction result = NewInstruction(Op.OpImageSampleProjDrefImplicitLod, GetNewId(), resultType);
1086  
1087              result.AddOperand(sampledImage);
1088              result.AddOperand(coordinate);
1089              result.AddOperand(dRef);
1090              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1091              {
1092                  result.AddOperand(imageOperands);
1093              }
1094              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1095              {
1096                  result.AddOperand(imageOperandIds);
1097              }
1098              AddToFunctionDefinitions(result);
1099  
1100              return result;
1101          }
1102  
1103          public Instruction ImageSampleProjDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1104          {
1105              Instruction result = NewInstruction(Op.OpImageSampleProjDrefExplicitLod, GetNewId(), resultType);
1106  
1107              result.AddOperand(sampledImage);
1108              result.AddOperand(coordinate);
1109              result.AddOperand(dRef);
1110              result.AddOperand(imageOperands);
1111              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1112              {
1113                  result.AddOperand(imageOperandIds);
1114              }
1115              AddToFunctionDefinitions(result);
1116  
1117              return result;
1118          }
1119  
1120          public Instruction ImageFetch(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1121          {
1122              Instruction result = NewInstruction(Op.OpImageFetch, GetNewId(), resultType);
1123  
1124              result.AddOperand(image);
1125              result.AddOperand(coordinate);
1126              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1127              {
1128                  result.AddOperand(imageOperands);
1129              }
1130              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1131              {
1132                  result.AddOperand(imageOperandIds);
1133              }
1134              AddToFunctionDefinitions(result);
1135  
1136              return result;
1137          }
1138  
1139          public Instruction ImageGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction component, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1140          {
1141              Instruction result = NewInstruction(Op.OpImageGather, GetNewId(), resultType);
1142  
1143              result.AddOperand(sampledImage);
1144              result.AddOperand(coordinate);
1145              result.AddOperand(component);
1146              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1147              {
1148                  result.AddOperand(imageOperands);
1149              }
1150              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1151              {
1152                  result.AddOperand(imageOperandIds);
1153              }
1154              AddToFunctionDefinitions(result);
1155  
1156              return result;
1157          }
1158  
1159          public Instruction ImageDrefGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1160          {
1161              Instruction result = NewInstruction(Op.OpImageDrefGather, GetNewId(), resultType);
1162  
1163              result.AddOperand(sampledImage);
1164              result.AddOperand(coordinate);
1165              result.AddOperand(dRef);
1166              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1167              {
1168                  result.AddOperand(imageOperands);
1169              }
1170              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1171              {
1172                  result.AddOperand(imageOperandIds);
1173              }
1174              AddToFunctionDefinitions(result);
1175  
1176              return result;
1177          }
1178  
1179          public Instruction ImageRead(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1180          {
1181              Instruction result = NewInstruction(Op.OpImageRead, GetNewId(), resultType);
1182  
1183              result.AddOperand(image);
1184              result.AddOperand(coordinate);
1185              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1186              {
1187                  result.AddOperand(imageOperands);
1188              }
1189              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1190              {
1191                  result.AddOperand(imageOperandIds);
1192              }
1193              AddToFunctionDefinitions(result);
1194  
1195              return result;
1196          }
1197  
1198          public Instruction ImageWrite(Instruction image, Instruction coordinate, Instruction texel, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1199          {
1200              Instruction result = NewInstruction(Op.OpImageWrite);
1201  
1202              result.AddOperand(image);
1203              result.AddOperand(coordinate);
1204              result.AddOperand(texel);
1205              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1206              {
1207                  result.AddOperand(imageOperands);
1208              }
1209              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1210              {
1211                  result.AddOperand(imageOperandIds);
1212              }
1213              AddToFunctionDefinitions(result);
1214  
1215              return result;
1216          }
1217  
1218          public Instruction Image(Instruction resultType, Instruction sampledImage)
1219          {
1220              Instruction result = NewInstruction(Op.OpImage, GetNewId(), resultType);
1221  
1222              result.AddOperand(sampledImage);
1223              AddToFunctionDefinitions(result);
1224  
1225              return result;
1226          }
1227  
1228          public Instruction ImageQueryFormat(Instruction resultType, Instruction image)
1229          {
1230              Instruction result = NewInstruction(Op.OpImageQueryFormat, GetNewId(), resultType);
1231  
1232              result.AddOperand(image);
1233              AddToFunctionDefinitions(result);
1234  
1235              return result;
1236          }
1237  
1238          public Instruction ImageQueryOrder(Instruction resultType, Instruction image)
1239          {
1240              Instruction result = NewInstruction(Op.OpImageQueryOrder, GetNewId(), resultType);
1241  
1242              result.AddOperand(image);
1243              AddToFunctionDefinitions(result);
1244  
1245              return result;
1246          }
1247  
1248          public Instruction ImageQuerySizeLod(Instruction resultType, Instruction image, Instruction levelofDetail)
1249          {
1250              Instruction result = NewInstruction(Op.OpImageQuerySizeLod, GetNewId(), resultType);
1251  
1252              result.AddOperand(image);
1253              result.AddOperand(levelofDetail);
1254              AddToFunctionDefinitions(result);
1255  
1256              return result;
1257          }
1258  
1259          public Instruction ImageQuerySize(Instruction resultType, Instruction image)
1260          {
1261              Instruction result = NewInstruction(Op.OpImageQuerySize, GetNewId(), resultType);
1262  
1263              result.AddOperand(image);
1264              AddToFunctionDefinitions(result);
1265  
1266              return result;
1267          }
1268  
1269          public Instruction ImageQueryLod(Instruction resultType, Instruction sampledImage, Instruction coordinate)
1270          {
1271              Instruction result = NewInstruction(Op.OpImageQueryLod, GetNewId(), resultType);
1272  
1273              result.AddOperand(sampledImage);
1274              result.AddOperand(coordinate);
1275              AddToFunctionDefinitions(result);
1276  
1277              return result;
1278          }
1279  
1280          public Instruction ImageQueryLevels(Instruction resultType, Instruction image)
1281          {
1282              Instruction result = NewInstruction(Op.OpImageQueryLevels, GetNewId(), resultType);
1283  
1284              result.AddOperand(image);
1285              AddToFunctionDefinitions(result);
1286  
1287              return result;
1288          }
1289  
1290          public Instruction ImageQuerySamples(Instruction resultType, Instruction image)
1291          {
1292              Instruction result = NewInstruction(Op.OpImageQuerySamples, GetNewId(), resultType);
1293  
1294              result.AddOperand(image);
1295              AddToFunctionDefinitions(result);
1296  
1297              return result;
1298          }
1299  
1300          public Instruction ImageSparseSampleImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1301          {
1302              Instruction result = NewInstruction(Op.OpImageSparseSampleImplicitLod, GetNewId(), resultType);
1303  
1304              result.AddOperand(sampledImage);
1305              result.AddOperand(coordinate);
1306              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1307              {
1308                  result.AddOperand(imageOperands);
1309              }
1310              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1311              {
1312                  result.AddOperand(imageOperandIds);
1313              }
1314              AddToFunctionDefinitions(result);
1315  
1316              return result;
1317          }
1318  
1319          public Instruction ImageSparseSampleExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1320          {
1321              Instruction result = NewInstruction(Op.OpImageSparseSampleExplicitLod, GetNewId(), resultType);
1322  
1323              result.AddOperand(sampledImage);
1324              result.AddOperand(coordinate);
1325              result.AddOperand(imageOperands);
1326              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1327              {
1328                  result.AddOperand(imageOperandIds);
1329              }
1330              AddToFunctionDefinitions(result);
1331  
1332              return result;
1333          }
1334  
1335          public Instruction ImageSparseSampleDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1336          {
1337              Instruction result = NewInstruction(Op.OpImageSparseSampleDrefImplicitLod, GetNewId(), resultType);
1338  
1339              result.AddOperand(sampledImage);
1340              result.AddOperand(coordinate);
1341              result.AddOperand(dRef);
1342              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1343              {
1344                  result.AddOperand(imageOperands);
1345              }
1346              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1347              {
1348                  result.AddOperand(imageOperandIds);
1349              }
1350              AddToFunctionDefinitions(result);
1351  
1352              return result;
1353          }
1354  
1355          public Instruction ImageSparseSampleDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1356          {
1357              Instruction result = NewInstruction(Op.OpImageSparseSampleDrefExplicitLod, GetNewId(), resultType);
1358  
1359              result.AddOperand(sampledImage);
1360              result.AddOperand(coordinate);
1361              result.AddOperand(dRef);
1362              result.AddOperand(imageOperands);
1363              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1364              {
1365                  result.AddOperand(imageOperandIds);
1366              }
1367              AddToFunctionDefinitions(result);
1368  
1369              return result;
1370          }
1371  
1372          public Instruction ImageSparseSampleProjImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1373          {
1374              Instruction result = NewInstruction(Op.OpImageSparseSampleProjImplicitLod, GetNewId(), resultType);
1375  
1376              result.AddOperand(sampledImage);
1377              result.AddOperand(coordinate);
1378              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1379              {
1380                  result.AddOperand(imageOperands);
1381              }
1382              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1383              {
1384                  result.AddOperand(imageOperandIds);
1385              }
1386              AddToFunctionDefinitions(result);
1387  
1388              return result;
1389          }
1390  
1391          public Instruction ImageSparseSampleProjExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1392          {
1393              Instruction result = NewInstruction(Op.OpImageSparseSampleProjExplicitLod, GetNewId(), resultType);
1394  
1395              result.AddOperand(sampledImage);
1396              result.AddOperand(coordinate);
1397              result.AddOperand(imageOperands);
1398              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1399              {
1400                  result.AddOperand(imageOperandIds);
1401              }
1402              AddToFunctionDefinitions(result);
1403  
1404              return result;
1405          }
1406  
1407          public Instruction ImageSparseSampleProjDrefImplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1408          {
1409              Instruction result = NewInstruction(Op.OpImageSparseSampleProjDrefImplicitLod, GetNewId(), resultType);
1410  
1411              result.AddOperand(sampledImage);
1412              result.AddOperand(coordinate);
1413              result.AddOperand(dRef);
1414              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1415              {
1416                  result.AddOperand(imageOperands);
1417              }
1418              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1419              {
1420                  result.AddOperand(imageOperandIds);
1421              }
1422              AddToFunctionDefinitions(result);
1423  
1424              return result;
1425          }
1426  
1427          public Instruction ImageSparseSampleProjDrefExplicitLod(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1428          {
1429              Instruction result = NewInstruction(Op.OpImageSparseSampleProjDrefExplicitLod, GetNewId(), resultType);
1430  
1431              result.AddOperand(sampledImage);
1432              result.AddOperand(coordinate);
1433              result.AddOperand(dRef);
1434              result.AddOperand(imageOperands);
1435              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1436              {
1437                  result.AddOperand(imageOperandIds);
1438              }
1439              AddToFunctionDefinitions(result);
1440  
1441              return result;
1442          }
1443  
1444          public Instruction ImageSparseFetch(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1445          {
1446              Instruction result = NewInstruction(Op.OpImageSparseFetch, GetNewId(), resultType);
1447  
1448              result.AddOperand(image);
1449              result.AddOperand(coordinate);
1450              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1451              {
1452                  result.AddOperand(imageOperands);
1453              }
1454              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1455              {
1456                  result.AddOperand(imageOperandIds);
1457              }
1458              AddToFunctionDefinitions(result);
1459  
1460              return result;
1461          }
1462  
1463          public Instruction ImageSparseGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction component, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1464          {
1465              Instruction result = NewInstruction(Op.OpImageSparseGather, GetNewId(), resultType);
1466  
1467              result.AddOperand(sampledImage);
1468              result.AddOperand(coordinate);
1469              result.AddOperand(component);
1470              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1471              {
1472                  result.AddOperand(imageOperands);
1473              }
1474              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1475              {
1476                  result.AddOperand(imageOperandIds);
1477              }
1478              AddToFunctionDefinitions(result);
1479  
1480              return result;
1481          }
1482  
1483          public Instruction ImageSparseDrefGather(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction dRef, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1484          {
1485              Instruction result = NewInstruction(Op.OpImageSparseDrefGather, GetNewId(), resultType);
1486  
1487              result.AddOperand(sampledImage);
1488              result.AddOperand(coordinate);
1489              result.AddOperand(dRef);
1490              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1491              {
1492                  result.AddOperand(imageOperands);
1493              }
1494              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1495              {
1496                  result.AddOperand(imageOperandIds);
1497              }
1498              AddToFunctionDefinitions(result);
1499  
1500              return result;
1501          }
1502  
1503          public Instruction ImageSparseTexelsResident(Instruction resultType, Instruction residentCode)
1504          {
1505              Instruction result = NewInstruction(Op.OpImageSparseTexelsResident, GetNewId(), resultType);
1506  
1507              result.AddOperand(residentCode);
1508              AddToFunctionDefinitions(result);
1509  
1510              return result;
1511          }
1512  
1513          public Instruction ImageSparseRead(Instruction resultType, Instruction image, Instruction coordinate, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1514          {
1515              Instruction result = NewInstruction(Op.OpImageSparseRead, GetNewId(), resultType);
1516  
1517              result.AddOperand(image);
1518              result.AddOperand(coordinate);
1519              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1520              {
1521                  result.AddOperand(imageOperands);
1522              }
1523              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1524              {
1525                  result.AddOperand(imageOperandIds);
1526              }
1527              AddToFunctionDefinitions(result);
1528  
1529              return result;
1530          }
1531  
1532          public Instruction ImageSampleFootprintNV(Instruction resultType, Instruction sampledImage, Instruction coordinate, Instruction granularity, Instruction coarse, ImageOperandsMask imageOperands, params Instruction[] imageOperandIds)
1533          {
1534              Instruction result = NewInstruction(Op.OpImageSampleFootprintNV, GetNewId(), resultType);
1535  
1536              result.AddOperand(sampledImage);
1537              result.AddOperand(coordinate);
1538              result.AddOperand(granularity);
1539              result.AddOperand(coarse);
1540              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1541              {
1542                  result.AddOperand(imageOperands);
1543              }
1544              if (imageOperands != (ImageOperandsMask)int.MaxValue)
1545              {
1546                  result.AddOperand(imageOperandIds);
1547              }
1548              AddToFunctionDefinitions(result);
1549  
1550              return result;
1551          }
1552  
1553          // Conversion
1554  
1555          public Instruction ConvertFToU(Instruction resultType, Instruction floatValue)
1556          {
1557              Instruction result = NewInstruction(Op.OpConvertFToU, GetNewId(), resultType);
1558  
1559              result.AddOperand(floatValue);
1560              AddToFunctionDefinitions(result);
1561  
1562              return result;
1563          }
1564  
1565          public Instruction ConvertFToS(Instruction resultType, Instruction floatValue)
1566          {
1567              Instruction result = NewInstruction(Op.OpConvertFToS, GetNewId(), resultType);
1568  
1569              result.AddOperand(floatValue);
1570              AddToFunctionDefinitions(result);
1571  
1572              return result;
1573          }
1574  
1575          public Instruction ConvertSToF(Instruction resultType, Instruction signedValue)
1576          {
1577              Instruction result = NewInstruction(Op.OpConvertSToF, GetNewId(), resultType);
1578  
1579              result.AddOperand(signedValue);
1580              AddToFunctionDefinitions(result);
1581  
1582              return result;
1583          }
1584  
1585          public Instruction ConvertUToF(Instruction resultType, Instruction unsignedValue)
1586          {
1587              Instruction result = NewInstruction(Op.OpConvertUToF, GetNewId(), resultType);
1588  
1589              result.AddOperand(unsignedValue);
1590              AddToFunctionDefinitions(result);
1591  
1592              return result;
1593          }
1594  
1595          public Instruction UConvert(Instruction resultType, Instruction unsignedValue)
1596          {
1597              Instruction result = NewInstruction(Op.OpUConvert, GetNewId(), resultType);
1598  
1599              result.AddOperand(unsignedValue);
1600              AddToFunctionDefinitions(result);
1601  
1602              return result;
1603          }
1604  
1605          public Instruction SConvert(Instruction resultType, Instruction signedValue)
1606          {
1607              Instruction result = NewInstruction(Op.OpSConvert, GetNewId(), resultType);
1608  
1609              result.AddOperand(signedValue);
1610              AddToFunctionDefinitions(result);
1611  
1612              return result;
1613          }
1614  
1615          public Instruction FConvert(Instruction resultType, Instruction floatValue)
1616          {
1617              Instruction result = NewInstruction(Op.OpFConvert, GetNewId(), resultType);
1618  
1619              result.AddOperand(floatValue);
1620              AddToFunctionDefinitions(result);
1621  
1622              return result;
1623          }
1624  
1625          public Instruction QuantizeToF16(Instruction resultType, Instruction value)
1626          {
1627              Instruction result = NewInstruction(Op.OpQuantizeToF16, GetNewId(), resultType);
1628  
1629              result.AddOperand(value);
1630              AddToFunctionDefinitions(result);
1631  
1632              return result;
1633          }
1634  
1635          public Instruction ConvertPtrToU(Instruction resultType, Instruction pointer)
1636          {
1637              Instruction result = NewInstruction(Op.OpConvertPtrToU, GetNewId(), resultType);
1638  
1639              result.AddOperand(pointer);
1640              AddToFunctionDefinitions(result);
1641  
1642              return result;
1643          }
1644  
1645          public Instruction SatConvertSToU(Instruction resultType, Instruction signedValue)
1646          {
1647              Instruction result = NewInstruction(Op.OpSatConvertSToU, GetNewId(), resultType);
1648  
1649              result.AddOperand(signedValue);
1650              AddToFunctionDefinitions(result);
1651  
1652              return result;
1653          }
1654  
1655          public Instruction SatConvertUToS(Instruction resultType, Instruction unsignedValue)
1656          {
1657              Instruction result = NewInstruction(Op.OpSatConvertUToS, GetNewId(), resultType);
1658  
1659              result.AddOperand(unsignedValue);
1660              AddToFunctionDefinitions(result);
1661  
1662              return result;
1663          }
1664  
1665          public Instruction ConvertUToPtr(Instruction resultType, Instruction integerValue)
1666          {
1667              Instruction result = NewInstruction(Op.OpConvertUToPtr, GetNewId(), resultType);
1668  
1669              result.AddOperand(integerValue);
1670              AddToFunctionDefinitions(result);
1671  
1672              return result;
1673          }
1674  
1675          public Instruction PtrCastToGeneric(Instruction resultType, Instruction pointer)
1676          {
1677              Instruction result = NewInstruction(Op.OpPtrCastToGeneric, GetNewId(), resultType);
1678  
1679              result.AddOperand(pointer);
1680              AddToFunctionDefinitions(result);
1681  
1682              return result;
1683          }
1684  
1685          public Instruction GenericCastToPtr(Instruction resultType, Instruction pointer)
1686          {
1687              Instruction result = NewInstruction(Op.OpGenericCastToPtr, GetNewId(), resultType);
1688  
1689              result.AddOperand(pointer);
1690              AddToFunctionDefinitions(result);
1691  
1692              return result;
1693          }
1694  
1695          public Instruction GenericCastToPtrExplicit(Instruction resultType, Instruction pointer, StorageClass storage)
1696          {
1697              Instruction result = NewInstruction(Op.OpGenericCastToPtrExplicit, GetNewId(), resultType);
1698  
1699              result.AddOperand(pointer);
1700              result.AddOperand(storage);
1701              AddToFunctionDefinitions(result);
1702  
1703              return result;
1704          }
1705  
1706          public Instruction Bitcast(Instruction resultType, Instruction operand)
1707          {
1708              Instruction result = NewInstruction(Op.OpBitcast, GetNewId(), resultType);
1709  
1710              result.AddOperand(operand);
1711              AddToFunctionDefinitions(result);
1712  
1713              return result;
1714          }
1715  
1716          // Composite
1717  
1718          public Instruction VectorExtractDynamic(Instruction resultType, Instruction vector, Instruction index)
1719          {
1720              Instruction result = NewInstruction(Op.OpVectorExtractDynamic, GetNewId(), resultType);
1721  
1722              result.AddOperand(vector);
1723              result.AddOperand(index);
1724              AddToFunctionDefinitions(result);
1725  
1726              return result;
1727          }
1728  
1729          public Instruction VectorInsertDynamic(Instruction resultType, Instruction vector, Instruction component, Instruction index)
1730          {
1731              Instruction result = NewInstruction(Op.OpVectorInsertDynamic, GetNewId(), resultType);
1732  
1733              result.AddOperand(vector);
1734              result.AddOperand(component);
1735              result.AddOperand(index);
1736              AddToFunctionDefinitions(result);
1737  
1738              return result;
1739          }
1740  
1741          public Instruction VectorShuffle(Instruction resultType, Instruction vector1, Instruction vector2, params LiteralInteger[] components)
1742          {
1743              Instruction result = NewInstruction(Op.OpVectorShuffle, GetNewId(), resultType);
1744  
1745              result.AddOperand(vector1);
1746              result.AddOperand(vector2);
1747              result.AddOperand(components);
1748              AddToFunctionDefinitions(result);
1749  
1750              return result;
1751          }
1752  
1753          public Instruction CompositeConstruct(Instruction resultType, params Instruction[] constituents)
1754          {
1755              Instruction result = NewInstruction(Op.OpCompositeConstruct, GetNewId(), resultType);
1756  
1757              result.AddOperand(constituents);
1758              AddToFunctionDefinitions(result);
1759  
1760              return result;
1761          }
1762  
1763          public Instruction CompositeExtract(Instruction resultType, Instruction composite, params LiteralInteger[] indexes)
1764          {
1765              Instruction result = NewInstruction(Op.OpCompositeExtract, GetNewId(), resultType);
1766  
1767              result.AddOperand(composite);
1768              result.AddOperand(indexes);
1769              AddToFunctionDefinitions(result);
1770  
1771              return result;
1772          }
1773  
1774          public Instruction CompositeInsert(Instruction resultType, Instruction obj, Instruction composite, params LiteralInteger[] indexes)
1775          {
1776              Instruction result = NewInstruction(Op.OpCompositeInsert, GetNewId(), resultType);
1777  
1778              result.AddOperand(obj);
1779              result.AddOperand(composite);
1780              result.AddOperand(indexes);
1781              AddToFunctionDefinitions(result);
1782  
1783              return result;
1784          }
1785  
1786          public Instruction CopyObject(Instruction resultType, Instruction operand)
1787          {
1788              Instruction result = NewInstruction(Op.OpCopyObject, GetNewId(), resultType);
1789  
1790              result.AddOperand(operand);
1791              AddToFunctionDefinitions(result);
1792  
1793              return result;
1794          }
1795  
1796          public Instruction Transpose(Instruction resultType, Instruction matrix)
1797          {
1798              Instruction result = NewInstruction(Op.OpTranspose, GetNewId(), resultType);
1799  
1800              result.AddOperand(matrix);
1801              AddToFunctionDefinitions(result);
1802  
1803              return result;
1804          }
1805  
1806          public Instruction CopyLogical(Instruction resultType, Instruction operand)
1807          {
1808              Instruction result = NewInstruction(Op.OpCopyLogical, GetNewId(), resultType);
1809  
1810              result.AddOperand(operand);
1811              AddToFunctionDefinitions(result);
1812  
1813              return result;
1814          }
1815  
1816          // Arithmetic
1817  
1818          public Instruction SNegate(Instruction resultType, Instruction operand)
1819          {
1820              Instruction result = NewInstruction(Op.OpSNegate, GetNewId(), resultType);
1821  
1822              result.AddOperand(operand);
1823              AddToFunctionDefinitions(result);
1824  
1825              return result;
1826          }
1827  
1828          public Instruction FNegate(Instruction resultType, Instruction operand)
1829          {
1830              Instruction result = NewInstruction(Op.OpFNegate, GetNewId(), resultType);
1831  
1832              result.AddOperand(operand);
1833              AddToFunctionDefinitions(result);
1834  
1835              return result;
1836          }
1837  
1838          public Instruction IAdd(Instruction resultType, Instruction operand1, Instruction operand2)
1839          {
1840              Instruction result = NewInstruction(Op.OpIAdd, GetNewId(), resultType);
1841  
1842              result.AddOperand(operand1);
1843              result.AddOperand(operand2);
1844              AddToFunctionDefinitions(result);
1845  
1846              return result;
1847          }
1848  
1849          public Instruction FAdd(Instruction resultType, Instruction operand1, Instruction operand2)
1850          {
1851              Instruction result = NewInstruction(Op.OpFAdd, GetNewId(), resultType);
1852  
1853              result.AddOperand(operand1);
1854              result.AddOperand(operand2);
1855              AddToFunctionDefinitions(result);
1856  
1857              return result;
1858          }
1859  
1860          public Instruction ISub(Instruction resultType, Instruction operand1, Instruction operand2)
1861          {
1862              Instruction result = NewInstruction(Op.OpISub, GetNewId(), resultType);
1863  
1864              result.AddOperand(operand1);
1865              result.AddOperand(operand2);
1866              AddToFunctionDefinitions(result);
1867  
1868              return result;
1869          }
1870  
1871          public Instruction FSub(Instruction resultType, Instruction operand1, Instruction operand2)
1872          {
1873              Instruction result = NewInstruction(Op.OpFSub, GetNewId(), resultType);
1874  
1875              result.AddOperand(operand1);
1876              result.AddOperand(operand2);
1877              AddToFunctionDefinitions(result);
1878  
1879              return result;
1880          }
1881  
1882          public Instruction IMul(Instruction resultType, Instruction operand1, Instruction operand2)
1883          {
1884              Instruction result = NewInstruction(Op.OpIMul, GetNewId(), resultType);
1885  
1886              result.AddOperand(operand1);
1887              result.AddOperand(operand2);
1888              AddToFunctionDefinitions(result);
1889  
1890              return result;
1891          }
1892  
1893          public Instruction FMul(Instruction resultType, Instruction operand1, Instruction operand2)
1894          {
1895              Instruction result = NewInstruction(Op.OpFMul, GetNewId(), resultType);
1896  
1897              result.AddOperand(operand1);
1898              result.AddOperand(operand2);
1899              AddToFunctionDefinitions(result);
1900  
1901              return result;
1902          }
1903  
1904          public Instruction UDiv(Instruction resultType, Instruction operand1, Instruction operand2)
1905          {
1906              Instruction result = NewInstruction(Op.OpUDiv, GetNewId(), resultType);
1907  
1908              result.AddOperand(operand1);
1909              result.AddOperand(operand2);
1910              AddToFunctionDefinitions(result);
1911  
1912              return result;
1913          }
1914  
1915          public Instruction SDiv(Instruction resultType, Instruction operand1, Instruction operand2)
1916          {
1917              Instruction result = NewInstruction(Op.OpSDiv, GetNewId(), resultType);
1918  
1919              result.AddOperand(operand1);
1920              result.AddOperand(operand2);
1921              AddToFunctionDefinitions(result);
1922  
1923              return result;
1924          }
1925  
1926          public Instruction FDiv(Instruction resultType, Instruction operand1, Instruction operand2)
1927          {
1928              Instruction result = NewInstruction(Op.OpFDiv, GetNewId(), resultType);
1929  
1930              result.AddOperand(operand1);
1931              result.AddOperand(operand2);
1932              AddToFunctionDefinitions(result);
1933  
1934              return result;
1935          }
1936  
1937          public Instruction UMod(Instruction resultType, Instruction operand1, Instruction operand2)
1938          {
1939              Instruction result = NewInstruction(Op.OpUMod, GetNewId(), resultType);
1940  
1941              result.AddOperand(operand1);
1942              result.AddOperand(operand2);
1943              AddToFunctionDefinitions(result);
1944  
1945              return result;
1946          }
1947  
1948          public Instruction SRem(Instruction resultType, Instruction operand1, Instruction operand2)
1949          {
1950              Instruction result = NewInstruction(Op.OpSRem, GetNewId(), resultType);
1951  
1952              result.AddOperand(operand1);
1953              result.AddOperand(operand2);
1954              AddToFunctionDefinitions(result);
1955  
1956              return result;
1957          }
1958  
1959          public Instruction SMod(Instruction resultType, Instruction operand1, Instruction operand2)
1960          {
1961              Instruction result = NewInstruction(Op.OpSMod, GetNewId(), resultType);
1962  
1963              result.AddOperand(operand1);
1964              result.AddOperand(operand2);
1965              AddToFunctionDefinitions(result);
1966  
1967              return result;
1968          }
1969  
1970          public Instruction FRem(Instruction resultType, Instruction operand1, Instruction operand2)
1971          {
1972              Instruction result = NewInstruction(Op.OpFRem, GetNewId(), resultType);
1973  
1974              result.AddOperand(operand1);
1975              result.AddOperand(operand2);
1976              AddToFunctionDefinitions(result);
1977  
1978              return result;
1979          }
1980  
1981          public Instruction FMod(Instruction resultType, Instruction operand1, Instruction operand2)
1982          {
1983              Instruction result = NewInstruction(Op.OpFMod, GetNewId(), resultType);
1984  
1985              result.AddOperand(operand1);
1986              result.AddOperand(operand2);
1987              AddToFunctionDefinitions(result);
1988  
1989              return result;
1990          }
1991  
1992          public Instruction VectorTimesScalar(Instruction resultType, Instruction vector, Instruction scalar)
1993          {
1994              Instruction result = NewInstruction(Op.OpVectorTimesScalar, GetNewId(), resultType);
1995  
1996              result.AddOperand(vector);
1997              result.AddOperand(scalar);
1998              AddToFunctionDefinitions(result);
1999  
2000              return result;
2001          }
2002  
2003          public Instruction MatrixTimesScalar(Instruction resultType, Instruction matrix, Instruction scalar)
2004          {
2005              Instruction result = NewInstruction(Op.OpMatrixTimesScalar, GetNewId(), resultType);
2006  
2007              result.AddOperand(matrix);
2008              result.AddOperand(scalar);
2009              AddToFunctionDefinitions(result);
2010  
2011              return result;
2012          }
2013  
2014          public Instruction VectorTimesMatrix(Instruction resultType, Instruction vector, Instruction matrix)
2015          {
2016              Instruction result = NewInstruction(Op.OpVectorTimesMatrix, GetNewId(), resultType);
2017  
2018              result.AddOperand(vector);
2019              result.AddOperand(matrix);
2020              AddToFunctionDefinitions(result);
2021  
2022              return result;
2023          }
2024  
2025          public Instruction MatrixTimesVector(Instruction resultType, Instruction matrix, Instruction vector)
2026          {
2027              Instruction result = NewInstruction(Op.OpMatrixTimesVector, GetNewId(), resultType);
2028  
2029              result.AddOperand(matrix);
2030              result.AddOperand(vector);
2031              AddToFunctionDefinitions(result);
2032  
2033              return result;
2034          }
2035  
2036          public Instruction MatrixTimesMatrix(Instruction resultType, Instruction leftMatrix, Instruction rightMatrix)
2037          {
2038              Instruction result = NewInstruction(Op.OpMatrixTimesMatrix, GetNewId(), resultType);
2039  
2040              result.AddOperand(leftMatrix);
2041              result.AddOperand(rightMatrix);
2042              AddToFunctionDefinitions(result);
2043  
2044              return result;
2045          }
2046  
2047          public Instruction OuterProduct(Instruction resultType, Instruction vector1, Instruction vector2)
2048          {
2049              Instruction result = NewInstruction(Op.OpOuterProduct, GetNewId(), resultType);
2050  
2051              result.AddOperand(vector1);
2052              result.AddOperand(vector2);
2053              AddToFunctionDefinitions(result);
2054  
2055              return result;
2056          }
2057  
2058          public Instruction Dot(Instruction resultType, Instruction vector1, Instruction vector2)
2059          {
2060              Instruction result = NewInstruction(Op.OpDot, GetNewId(), resultType);
2061  
2062              result.AddOperand(vector1);
2063              result.AddOperand(vector2);
2064              AddToFunctionDefinitions(result);
2065  
2066              return result;
2067          }
2068  
2069          public Instruction IAddCarry(Instruction resultType, Instruction operand1, Instruction operand2)
2070          {
2071              Instruction result = NewInstruction(Op.OpIAddCarry, GetNewId(), resultType);
2072  
2073              result.AddOperand(operand1);
2074              result.AddOperand(operand2);
2075              AddToFunctionDefinitions(result);
2076  
2077              return result;
2078          }
2079  
2080          public Instruction ISubBorrow(Instruction resultType, Instruction operand1, Instruction operand2)
2081          {
2082              Instruction result = NewInstruction(Op.OpISubBorrow, GetNewId(), resultType);
2083  
2084              result.AddOperand(operand1);
2085              result.AddOperand(operand2);
2086              AddToFunctionDefinitions(result);
2087  
2088              return result;
2089          }
2090  
2091          public Instruction UMulExtended(Instruction resultType, Instruction operand1, Instruction operand2)
2092          {
2093              Instruction result = NewInstruction(Op.OpUMulExtended, GetNewId(), resultType);
2094  
2095              result.AddOperand(operand1);
2096              result.AddOperand(operand2);
2097              AddToFunctionDefinitions(result);
2098  
2099              return result;
2100          }
2101  
2102          public Instruction SMulExtended(Instruction resultType, Instruction operand1, Instruction operand2)
2103          {
2104              Instruction result = NewInstruction(Op.OpSMulExtended, GetNewId(), resultType);
2105  
2106              result.AddOperand(operand1);
2107              result.AddOperand(operand2);
2108              AddToFunctionDefinitions(result);
2109  
2110              return result;
2111          }
2112  
2113          // Bit
2114  
2115          public Instruction ShiftRightLogical(Instruction resultType, Instruction baseObj, Instruction shift)
2116          {
2117              Instruction result = NewInstruction(Op.OpShiftRightLogical, GetNewId(), resultType);
2118  
2119              result.AddOperand(baseObj);
2120              result.AddOperand(shift);
2121              AddToFunctionDefinitions(result);
2122  
2123              return result;
2124          }
2125  
2126          public Instruction ShiftRightArithmetic(Instruction resultType, Instruction baseObj, Instruction shift)
2127          {
2128              Instruction result = NewInstruction(Op.OpShiftRightArithmetic, GetNewId(), resultType);
2129  
2130              result.AddOperand(baseObj);
2131              result.AddOperand(shift);
2132              AddToFunctionDefinitions(result);
2133  
2134              return result;
2135          }
2136  
2137          public Instruction ShiftLeftLogical(Instruction resultType, Instruction baseObj, Instruction shift)
2138          {
2139              Instruction result = NewInstruction(Op.OpShiftLeftLogical, GetNewId(), resultType);
2140  
2141              result.AddOperand(baseObj);
2142              result.AddOperand(shift);
2143              AddToFunctionDefinitions(result);
2144  
2145              return result;
2146          }
2147  
2148          public Instruction BitwiseOr(Instruction resultType, Instruction operand1, Instruction operand2)
2149          {
2150              Instruction result = NewInstruction(Op.OpBitwiseOr, GetNewId(), resultType);
2151  
2152              result.AddOperand(operand1);
2153              result.AddOperand(operand2);
2154              AddToFunctionDefinitions(result);
2155  
2156              return result;
2157          }
2158  
2159          public Instruction BitwiseXor(Instruction resultType, Instruction operand1, Instruction operand2)
2160          {
2161              Instruction result = NewInstruction(Op.OpBitwiseXor, GetNewId(), resultType);
2162  
2163              result.AddOperand(operand1);
2164              result.AddOperand(operand2);
2165              AddToFunctionDefinitions(result);
2166  
2167              return result;
2168          }
2169  
2170          public Instruction BitwiseAnd(Instruction resultType, Instruction operand1, Instruction operand2)
2171          {
2172              Instruction result = NewInstruction(Op.OpBitwiseAnd, GetNewId(), resultType);
2173  
2174              result.AddOperand(operand1);
2175              result.AddOperand(operand2);
2176              AddToFunctionDefinitions(result);
2177  
2178              return result;
2179          }
2180  
2181          public Instruction Not(Instruction resultType, Instruction operand)
2182          {
2183              Instruction result = NewInstruction(Op.OpNot, GetNewId(), resultType);
2184  
2185              result.AddOperand(operand);
2186              AddToFunctionDefinitions(result);
2187  
2188              return result;
2189          }
2190  
2191          public Instruction BitFieldInsert(Instruction resultType, Instruction baseObj, Instruction insert, Instruction offset, Instruction count)
2192          {
2193              Instruction result = NewInstruction(Op.OpBitFieldInsert, GetNewId(), resultType);
2194  
2195              result.AddOperand(baseObj);
2196              result.AddOperand(insert);
2197              result.AddOperand(offset);
2198              result.AddOperand(count);
2199              AddToFunctionDefinitions(result);
2200  
2201              return result;
2202          }
2203  
2204          public Instruction BitFieldSExtract(Instruction resultType, Instruction baseObj, Instruction offset, Instruction count)
2205          {
2206              Instruction result = NewInstruction(Op.OpBitFieldSExtract, GetNewId(), resultType);
2207  
2208              result.AddOperand(baseObj);
2209              result.AddOperand(offset);
2210              result.AddOperand(count);
2211              AddToFunctionDefinitions(result);
2212  
2213              return result;
2214          }
2215  
2216          public Instruction BitFieldUExtract(Instruction resultType, Instruction baseObj, Instruction offset, Instruction count)
2217          {
2218              Instruction result = NewInstruction(Op.OpBitFieldUExtract, GetNewId(), resultType);
2219  
2220              result.AddOperand(baseObj);
2221              result.AddOperand(offset);
2222              result.AddOperand(count);
2223              AddToFunctionDefinitions(result);
2224  
2225              return result;
2226          }
2227  
2228          public Instruction BitReverse(Instruction resultType, Instruction baseObj)
2229          {
2230              Instruction result = NewInstruction(Op.OpBitReverse, GetNewId(), resultType);
2231  
2232              result.AddOperand(baseObj);
2233              AddToFunctionDefinitions(result);
2234  
2235              return result;
2236          }
2237  
2238          public Instruction BitCount(Instruction resultType, Instruction baseObj)
2239          {
2240              Instruction result = NewInstruction(Op.OpBitCount, GetNewId(), resultType);
2241  
2242              result.AddOperand(baseObj);
2243              AddToFunctionDefinitions(result);
2244  
2245              return result;
2246          }
2247  
2248          // Relational_and_Logical
2249  
2250          public Instruction Any(Instruction resultType, Instruction vector)
2251          {
2252              Instruction result = NewInstruction(Op.OpAny, GetNewId(), resultType);
2253  
2254              result.AddOperand(vector);
2255              AddToFunctionDefinitions(result);
2256  
2257              return result;
2258          }
2259  
2260          public Instruction All(Instruction resultType, Instruction vector)
2261          {
2262              Instruction result = NewInstruction(Op.OpAll, GetNewId(), resultType);
2263  
2264              result.AddOperand(vector);
2265              AddToFunctionDefinitions(result);
2266  
2267              return result;
2268          }
2269  
2270          public Instruction IsNan(Instruction resultType, Instruction x)
2271          {
2272              Instruction result = NewInstruction(Op.OpIsNan, GetNewId(), resultType);
2273  
2274              result.AddOperand(x);
2275              AddToFunctionDefinitions(result);
2276  
2277              return result;
2278          }
2279  
2280          public Instruction IsInf(Instruction resultType, Instruction x)
2281          {
2282              Instruction result = NewInstruction(Op.OpIsInf, GetNewId(), resultType);
2283  
2284              result.AddOperand(x);
2285              AddToFunctionDefinitions(result);
2286  
2287              return result;
2288          }
2289  
2290          public Instruction IsFinite(Instruction resultType, Instruction x)
2291          {
2292              Instruction result = NewInstruction(Op.OpIsFinite, GetNewId(), resultType);
2293  
2294              result.AddOperand(x);
2295              AddToFunctionDefinitions(result);
2296  
2297              return result;
2298          }
2299  
2300          public Instruction IsNormal(Instruction resultType, Instruction x)
2301          {
2302              Instruction result = NewInstruction(Op.OpIsNormal, GetNewId(), resultType);
2303  
2304              result.AddOperand(x);
2305              AddToFunctionDefinitions(result);
2306  
2307              return result;
2308          }
2309  
2310          public Instruction SignBitSet(Instruction resultType, Instruction x)
2311          {
2312              Instruction result = NewInstruction(Op.OpSignBitSet, GetNewId(), resultType);
2313  
2314              result.AddOperand(x);
2315              AddToFunctionDefinitions(result);
2316  
2317              return result;
2318          }
2319  
2320          public Instruction LessOrGreater(Instruction resultType, Instruction x, Instruction y)
2321          {
2322              Instruction result = NewInstruction(Op.OpLessOrGreater, GetNewId(), resultType);
2323  
2324              result.AddOperand(x);
2325              result.AddOperand(y);
2326              AddToFunctionDefinitions(result);
2327  
2328              return result;
2329          }
2330  
2331          public Instruction Ordered(Instruction resultType, Instruction x, Instruction y)
2332          {
2333              Instruction result = NewInstruction(Op.OpOrdered, GetNewId(), resultType);
2334  
2335              result.AddOperand(x);
2336              result.AddOperand(y);
2337              AddToFunctionDefinitions(result);
2338  
2339              return result;
2340          }
2341  
2342          public Instruction Unordered(Instruction resultType, Instruction x, Instruction y)
2343          {
2344              Instruction result = NewInstruction(Op.OpUnordered, GetNewId(), resultType);
2345  
2346              result.AddOperand(x);
2347              result.AddOperand(y);
2348              AddToFunctionDefinitions(result);
2349  
2350              return result;
2351          }
2352  
2353          public Instruction LogicalEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2354          {
2355              Instruction result = NewInstruction(Op.OpLogicalEqual, GetNewId(), resultType);
2356  
2357              result.AddOperand(operand1);
2358              result.AddOperand(operand2);
2359              AddToFunctionDefinitions(result);
2360  
2361              return result;
2362          }
2363  
2364          public Instruction LogicalNotEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2365          {
2366              Instruction result = NewInstruction(Op.OpLogicalNotEqual, GetNewId(), resultType);
2367  
2368              result.AddOperand(operand1);
2369              result.AddOperand(operand2);
2370              AddToFunctionDefinitions(result);
2371  
2372              return result;
2373          }
2374  
2375          public Instruction LogicalOr(Instruction resultType, Instruction operand1, Instruction operand2)
2376          {
2377              Instruction result = NewInstruction(Op.OpLogicalOr, GetNewId(), resultType);
2378  
2379              result.AddOperand(operand1);
2380              result.AddOperand(operand2);
2381              AddToFunctionDefinitions(result);
2382  
2383              return result;
2384          }
2385  
2386          public Instruction LogicalAnd(Instruction resultType, Instruction operand1, Instruction operand2)
2387          {
2388              Instruction result = NewInstruction(Op.OpLogicalAnd, GetNewId(), resultType);
2389  
2390              result.AddOperand(operand1);
2391              result.AddOperand(operand2);
2392              AddToFunctionDefinitions(result);
2393  
2394              return result;
2395          }
2396  
2397          public Instruction LogicalNot(Instruction resultType, Instruction operand)
2398          {
2399              Instruction result = NewInstruction(Op.OpLogicalNot, GetNewId(), resultType);
2400  
2401              result.AddOperand(operand);
2402              AddToFunctionDefinitions(result);
2403  
2404              return result;
2405          }
2406  
2407          public Instruction Select(Instruction resultType, Instruction condition, Instruction object1, Instruction object2)
2408          {
2409              Instruction result = NewInstruction(Op.OpSelect, GetNewId(), resultType);
2410  
2411              result.AddOperand(condition);
2412              result.AddOperand(object1);
2413              result.AddOperand(object2);
2414              AddToFunctionDefinitions(result);
2415  
2416              return result;
2417          }
2418  
2419          public Instruction IEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2420          {
2421              Instruction result = NewInstruction(Op.OpIEqual, GetNewId(), resultType);
2422  
2423              result.AddOperand(operand1);
2424              result.AddOperand(operand2);
2425              AddToFunctionDefinitions(result);
2426  
2427              return result;
2428          }
2429  
2430          public Instruction INotEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2431          {
2432              Instruction result = NewInstruction(Op.OpINotEqual, GetNewId(), resultType);
2433  
2434              result.AddOperand(operand1);
2435              result.AddOperand(operand2);
2436              AddToFunctionDefinitions(result);
2437  
2438              return result;
2439          }
2440  
2441          public Instruction UGreaterThan(Instruction resultType, Instruction operand1, Instruction operand2)
2442          {
2443              Instruction result = NewInstruction(Op.OpUGreaterThan, GetNewId(), resultType);
2444  
2445              result.AddOperand(operand1);
2446              result.AddOperand(operand2);
2447              AddToFunctionDefinitions(result);
2448  
2449              return result;
2450          }
2451  
2452          public Instruction SGreaterThan(Instruction resultType, Instruction operand1, Instruction operand2)
2453          {
2454              Instruction result = NewInstruction(Op.OpSGreaterThan, GetNewId(), resultType);
2455  
2456              result.AddOperand(operand1);
2457              result.AddOperand(operand2);
2458              AddToFunctionDefinitions(result);
2459  
2460              return result;
2461          }
2462  
2463          public Instruction UGreaterThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2464          {
2465              Instruction result = NewInstruction(Op.OpUGreaterThanEqual, GetNewId(), resultType);
2466  
2467              result.AddOperand(operand1);
2468              result.AddOperand(operand2);
2469              AddToFunctionDefinitions(result);
2470  
2471              return result;
2472          }
2473  
2474          public Instruction SGreaterThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2475          {
2476              Instruction result = NewInstruction(Op.OpSGreaterThanEqual, GetNewId(), resultType);
2477  
2478              result.AddOperand(operand1);
2479              result.AddOperand(operand2);
2480              AddToFunctionDefinitions(result);
2481  
2482              return result;
2483          }
2484  
2485          public Instruction ULessThan(Instruction resultType, Instruction operand1, Instruction operand2)
2486          {
2487              Instruction result = NewInstruction(Op.OpULessThan, GetNewId(), resultType);
2488  
2489              result.AddOperand(operand1);
2490              result.AddOperand(operand2);
2491              AddToFunctionDefinitions(result);
2492  
2493              return result;
2494          }
2495  
2496          public Instruction SLessThan(Instruction resultType, Instruction operand1, Instruction operand2)
2497          {
2498              Instruction result = NewInstruction(Op.OpSLessThan, GetNewId(), resultType);
2499  
2500              result.AddOperand(operand1);
2501              result.AddOperand(operand2);
2502              AddToFunctionDefinitions(result);
2503  
2504              return result;
2505          }
2506  
2507          public Instruction ULessThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2508          {
2509              Instruction result = NewInstruction(Op.OpULessThanEqual, GetNewId(), resultType);
2510  
2511              result.AddOperand(operand1);
2512              result.AddOperand(operand2);
2513              AddToFunctionDefinitions(result);
2514  
2515              return result;
2516          }
2517  
2518          public Instruction SLessThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2519          {
2520              Instruction result = NewInstruction(Op.OpSLessThanEqual, GetNewId(), resultType);
2521  
2522              result.AddOperand(operand1);
2523              result.AddOperand(operand2);
2524              AddToFunctionDefinitions(result);
2525  
2526              return result;
2527          }
2528  
2529          public Instruction FOrdEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2530          {
2531              Instruction result = NewInstruction(Op.OpFOrdEqual, GetNewId(), resultType);
2532  
2533              result.AddOperand(operand1);
2534              result.AddOperand(operand2);
2535              AddToFunctionDefinitions(result);
2536  
2537              return result;
2538          }
2539  
2540          public Instruction FUnordEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2541          {
2542              Instruction result = NewInstruction(Op.OpFUnordEqual, GetNewId(), resultType);
2543  
2544              result.AddOperand(operand1);
2545              result.AddOperand(operand2);
2546              AddToFunctionDefinitions(result);
2547  
2548              return result;
2549          }
2550  
2551          public Instruction FOrdNotEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2552          {
2553              Instruction result = NewInstruction(Op.OpFOrdNotEqual, GetNewId(), resultType);
2554  
2555              result.AddOperand(operand1);
2556              result.AddOperand(operand2);
2557              AddToFunctionDefinitions(result);
2558  
2559              return result;
2560          }
2561  
2562          public Instruction FUnordNotEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2563          {
2564              Instruction result = NewInstruction(Op.OpFUnordNotEqual, GetNewId(), resultType);
2565  
2566              result.AddOperand(operand1);
2567              result.AddOperand(operand2);
2568              AddToFunctionDefinitions(result);
2569  
2570              return result;
2571          }
2572  
2573          public Instruction FOrdLessThan(Instruction resultType, Instruction operand1, Instruction operand2)
2574          {
2575              Instruction result = NewInstruction(Op.OpFOrdLessThan, GetNewId(), resultType);
2576  
2577              result.AddOperand(operand1);
2578              result.AddOperand(operand2);
2579              AddToFunctionDefinitions(result);
2580  
2581              return result;
2582          }
2583  
2584          public Instruction FUnordLessThan(Instruction resultType, Instruction operand1, Instruction operand2)
2585          {
2586              Instruction result = NewInstruction(Op.OpFUnordLessThan, GetNewId(), resultType);
2587  
2588              result.AddOperand(operand1);
2589              result.AddOperand(operand2);
2590              AddToFunctionDefinitions(result);
2591  
2592              return result;
2593          }
2594  
2595          public Instruction FOrdGreaterThan(Instruction resultType, Instruction operand1, Instruction operand2)
2596          {
2597              Instruction result = NewInstruction(Op.OpFOrdGreaterThan, GetNewId(), resultType);
2598  
2599              result.AddOperand(operand1);
2600              result.AddOperand(operand2);
2601              AddToFunctionDefinitions(result);
2602  
2603              return result;
2604          }
2605  
2606          public Instruction FUnordGreaterThan(Instruction resultType, Instruction operand1, Instruction operand2)
2607          {
2608              Instruction result = NewInstruction(Op.OpFUnordGreaterThan, GetNewId(), resultType);
2609  
2610              result.AddOperand(operand1);
2611              result.AddOperand(operand2);
2612              AddToFunctionDefinitions(result);
2613  
2614              return result;
2615          }
2616  
2617          public Instruction FOrdLessThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2618          {
2619              Instruction result = NewInstruction(Op.OpFOrdLessThanEqual, GetNewId(), resultType);
2620  
2621              result.AddOperand(operand1);
2622              result.AddOperand(operand2);
2623              AddToFunctionDefinitions(result);
2624  
2625              return result;
2626          }
2627  
2628          public Instruction FUnordLessThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2629          {
2630              Instruction result = NewInstruction(Op.OpFUnordLessThanEqual, GetNewId(), resultType);
2631  
2632              result.AddOperand(operand1);
2633              result.AddOperand(operand2);
2634              AddToFunctionDefinitions(result);
2635  
2636              return result;
2637          }
2638  
2639          public Instruction FOrdGreaterThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2640          {
2641              Instruction result = NewInstruction(Op.OpFOrdGreaterThanEqual, GetNewId(), resultType);
2642  
2643              result.AddOperand(operand1);
2644              result.AddOperand(operand2);
2645              AddToFunctionDefinitions(result);
2646  
2647              return result;
2648          }
2649  
2650          public Instruction FUnordGreaterThanEqual(Instruction resultType, Instruction operand1, Instruction operand2)
2651          {
2652              Instruction result = NewInstruction(Op.OpFUnordGreaterThanEqual, GetNewId(), resultType);
2653  
2654              result.AddOperand(operand1);
2655              result.AddOperand(operand2);
2656              AddToFunctionDefinitions(result);
2657  
2658              return result;
2659          }
2660  
2661          // Derivative
2662  
2663          public Instruction DPdx(Instruction resultType, Instruction p)
2664          {
2665              Instruction result = NewInstruction(Op.OpDPdx, GetNewId(), resultType);
2666  
2667              result.AddOperand(p);
2668              AddToFunctionDefinitions(result);
2669  
2670              return result;
2671          }
2672  
2673          public Instruction DPdy(Instruction resultType, Instruction p)
2674          {
2675              Instruction result = NewInstruction(Op.OpDPdy, GetNewId(), resultType);
2676  
2677              result.AddOperand(p);
2678              AddToFunctionDefinitions(result);
2679  
2680              return result;
2681          }
2682  
2683          public Instruction Fwidth(Instruction resultType, Instruction p)
2684          {
2685              Instruction result = NewInstruction(Op.OpFwidth, GetNewId(), resultType);
2686  
2687              result.AddOperand(p);
2688              AddToFunctionDefinitions(result);
2689  
2690              return result;
2691          }
2692  
2693          public Instruction DPdxFine(Instruction resultType, Instruction p)
2694          {
2695              Instruction result = NewInstruction(Op.OpDPdxFine, GetNewId(), resultType);
2696  
2697              result.AddOperand(p);
2698              AddToFunctionDefinitions(result);
2699  
2700              return result;
2701          }
2702  
2703          public Instruction DPdyFine(Instruction resultType, Instruction p)
2704          {
2705              Instruction result = NewInstruction(Op.OpDPdyFine, GetNewId(), resultType);
2706  
2707              result.AddOperand(p);
2708              AddToFunctionDefinitions(result);
2709  
2710              return result;
2711          }
2712  
2713          public Instruction FwidthFine(Instruction resultType, Instruction p)
2714          {
2715              Instruction result = NewInstruction(Op.OpFwidthFine, GetNewId(), resultType);
2716  
2717              result.AddOperand(p);
2718              AddToFunctionDefinitions(result);
2719  
2720              return result;
2721          }
2722  
2723          public Instruction DPdxCoarse(Instruction resultType, Instruction p)
2724          {
2725              Instruction result = NewInstruction(Op.OpDPdxCoarse, GetNewId(), resultType);
2726  
2727              result.AddOperand(p);
2728              AddToFunctionDefinitions(result);
2729  
2730              return result;
2731          }
2732  
2733          public Instruction DPdyCoarse(Instruction resultType, Instruction p)
2734          {
2735              Instruction result = NewInstruction(Op.OpDPdyCoarse, GetNewId(), resultType);
2736  
2737              result.AddOperand(p);
2738              AddToFunctionDefinitions(result);
2739  
2740              return result;
2741          }
2742  
2743          public Instruction FwidthCoarse(Instruction resultType, Instruction p)
2744          {
2745              Instruction result = NewInstruction(Op.OpFwidthCoarse, GetNewId(), resultType);
2746  
2747              result.AddOperand(p);
2748              AddToFunctionDefinitions(result);
2749  
2750              return result;
2751          }
2752  
2753          // Control-Flow
2754  
2755          public Instruction Phi(Instruction resultType, params Instruction[] parameters)
2756          {
2757              Instruction result = NewInstruction(Op.OpPhi, GetNewId(), resultType);
2758  
2759              result.AddOperand(parameters);
2760              AddToFunctionDefinitions(result);
2761  
2762              return result;
2763          }
2764  
2765          public Instruction LoopMerge(Instruction mergeBlock, Instruction continueTarget, LoopControlMask loopControl)
2766          {
2767              Instruction result = NewInstruction(Op.OpLoopMerge);
2768  
2769              result.AddOperand(mergeBlock);
2770              result.AddOperand(continueTarget);
2771              result.AddOperand(loopControl);
2772              AddToFunctionDefinitions(result);
2773  
2774              return result;
2775          }
2776  
2777          public Instruction SelectionMerge(Instruction mergeBlock, SelectionControlMask selectionControl)
2778          {
2779              Instruction result = NewInstruction(Op.OpSelectionMerge);
2780  
2781              result.AddOperand(mergeBlock);
2782              result.AddOperand(selectionControl);
2783              AddToFunctionDefinitions(result);
2784  
2785              return result;
2786          }
2787  
2788          public Instruction Label()
2789          {
2790              Instruction result = NewInstruction(Op.OpLabel);
2791  
2792              return result;
2793          }
2794  
2795          public Instruction Branch(Instruction targetLabel)
2796          {
2797              Instruction result = NewInstruction(Op.OpBranch);
2798  
2799              result.AddOperand(targetLabel);
2800              AddToFunctionDefinitions(result);
2801  
2802              return result;
2803          }
2804  
2805          public Instruction BranchConditional(Instruction condition, Instruction trueLabel, Instruction falseLabel, params LiteralInteger[] branchweights)
2806          {
2807              Instruction result = NewInstruction(Op.OpBranchConditional);
2808  
2809              result.AddOperand(condition);
2810              result.AddOperand(trueLabel);
2811              result.AddOperand(falseLabel);
2812              result.AddOperand(branchweights);
2813              AddToFunctionDefinitions(result);
2814  
2815              return result;
2816          }
2817  
2818          public Instruction Switch(Instruction selector, Instruction defaultObj, params IOperand[] target)
2819          {
2820              Instruction result = NewInstruction(Op.OpSwitch);
2821  
2822              result.AddOperand(selector);
2823              result.AddOperand(defaultObj);
2824              result.AddOperand(target);
2825              AddToFunctionDefinitions(result);
2826  
2827              return result;
2828          }
2829  
2830          public Instruction Kill()
2831          {
2832              Instruction result = NewInstruction(Op.OpKill);
2833  
2834              AddToFunctionDefinitions(result);
2835  
2836              return result;
2837          }
2838  
2839          public Instruction Return()
2840          {
2841              Instruction result = NewInstruction(Op.OpReturn);
2842  
2843              AddToFunctionDefinitions(result);
2844  
2845              return result;
2846          }
2847  
2848          public Instruction ReturnValue(Instruction value)
2849          {
2850              Instruction result = NewInstruction(Op.OpReturnValue);
2851  
2852              result.AddOperand(value);
2853              AddToFunctionDefinitions(result);
2854  
2855              return result;
2856          }
2857  
2858          public Instruction Unreachable()
2859          {
2860              Instruction result = NewInstruction(Op.OpUnreachable);
2861  
2862              AddToFunctionDefinitions(result);
2863  
2864              return result;
2865          }
2866  
2867          public Instruction LifetimeStart(Instruction pointer, LiteralInteger size)
2868          {
2869              Instruction result = NewInstruction(Op.OpLifetimeStart);
2870  
2871              result.AddOperand(pointer);
2872              result.AddOperand(size);
2873              AddToFunctionDefinitions(result);
2874  
2875              return result;
2876          }
2877  
2878          public Instruction LifetimeStop(Instruction pointer, LiteralInteger size)
2879          {
2880              Instruction result = NewInstruction(Op.OpLifetimeStop);
2881  
2882              result.AddOperand(pointer);
2883              result.AddOperand(size);
2884              AddToFunctionDefinitions(result);
2885  
2886              return result;
2887          }
2888  
2889          public Instruction TerminateInvocation()
2890          {
2891              Instruction result = NewInstruction(Op.OpTerminateInvocation);
2892  
2893              AddToFunctionDefinitions(result);
2894  
2895              return result;
2896          }
2897  
2898          // Atomic
2899  
2900          public Instruction AtomicLoad(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics)
2901          {
2902              Instruction result = NewInstruction(Op.OpAtomicLoad, GetNewId(), resultType);
2903  
2904              result.AddOperand(pointer);
2905              result.AddOperand(memory);
2906              result.AddOperand(semantics);
2907              AddToFunctionDefinitions(result);
2908  
2909              return result;
2910          }
2911  
2912          public Instruction AtomicStore(Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
2913          {
2914              Instruction result = NewInstruction(Op.OpAtomicStore);
2915  
2916              result.AddOperand(pointer);
2917              result.AddOperand(memory);
2918              result.AddOperand(semantics);
2919              result.AddOperand(value);
2920              AddToFunctionDefinitions(result);
2921  
2922              return result;
2923          }
2924  
2925          public Instruction AtomicExchange(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
2926          {
2927              Instruction result = NewInstruction(Op.OpAtomicExchange, GetNewId(), resultType);
2928  
2929              result.AddOperand(pointer);
2930              result.AddOperand(memory);
2931              result.AddOperand(semantics);
2932              result.AddOperand(value);
2933              AddToFunctionDefinitions(result);
2934  
2935              return result;
2936          }
2937  
2938          public Instruction AtomicCompareExchange(Instruction resultType, Instruction pointer, Instruction memory, Instruction equal, Instruction unequal, Instruction value, Instruction comparator)
2939          {
2940              Instruction result = NewInstruction(Op.OpAtomicCompareExchange, GetNewId(), resultType);
2941  
2942              result.AddOperand(pointer);
2943              result.AddOperand(memory);
2944              result.AddOperand(equal);
2945              result.AddOperand(unequal);
2946              result.AddOperand(value);
2947              result.AddOperand(comparator);
2948              AddToFunctionDefinitions(result);
2949  
2950              return result;
2951          }
2952  
2953          public Instruction AtomicCompareExchangeWeak(Instruction resultType, Instruction pointer, Instruction memory, Instruction equal, Instruction unequal, Instruction value, Instruction comparator)
2954          {
2955              Instruction result = NewInstruction(Op.OpAtomicCompareExchangeWeak, GetNewId(), resultType);
2956  
2957              result.AddOperand(pointer);
2958              result.AddOperand(memory);
2959              result.AddOperand(equal);
2960              result.AddOperand(unequal);
2961              result.AddOperand(value);
2962              result.AddOperand(comparator);
2963              AddToFunctionDefinitions(result);
2964  
2965              return result;
2966          }
2967  
2968          public Instruction AtomicIIncrement(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics)
2969          {
2970              Instruction result = NewInstruction(Op.OpAtomicIIncrement, GetNewId(), resultType);
2971  
2972              result.AddOperand(pointer);
2973              result.AddOperand(memory);
2974              result.AddOperand(semantics);
2975              AddToFunctionDefinitions(result);
2976  
2977              return result;
2978          }
2979  
2980          public Instruction AtomicIDecrement(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics)
2981          {
2982              Instruction result = NewInstruction(Op.OpAtomicIDecrement, GetNewId(), resultType);
2983  
2984              result.AddOperand(pointer);
2985              result.AddOperand(memory);
2986              result.AddOperand(semantics);
2987              AddToFunctionDefinitions(result);
2988  
2989              return result;
2990          }
2991  
2992          public Instruction AtomicIAdd(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
2993          {
2994              Instruction result = NewInstruction(Op.OpAtomicIAdd, GetNewId(), resultType);
2995  
2996              result.AddOperand(pointer);
2997              result.AddOperand(memory);
2998              result.AddOperand(semantics);
2999              result.AddOperand(value);
3000              AddToFunctionDefinitions(result);
3001  
3002              return result;
3003          }
3004  
3005          public Instruction AtomicISub(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3006          {
3007              Instruction result = NewInstruction(Op.OpAtomicISub, GetNewId(), resultType);
3008  
3009              result.AddOperand(pointer);
3010              result.AddOperand(memory);
3011              result.AddOperand(semantics);
3012              result.AddOperand(value);
3013              AddToFunctionDefinitions(result);
3014  
3015              return result;
3016          }
3017  
3018          public Instruction AtomicSMin(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3019          {
3020              Instruction result = NewInstruction(Op.OpAtomicSMin, GetNewId(), resultType);
3021  
3022              result.AddOperand(pointer);
3023              result.AddOperand(memory);
3024              result.AddOperand(semantics);
3025              result.AddOperand(value);
3026              AddToFunctionDefinitions(result);
3027  
3028              return result;
3029          }
3030  
3031          public Instruction AtomicUMin(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3032          {
3033              Instruction result = NewInstruction(Op.OpAtomicUMin, GetNewId(), resultType);
3034  
3035              result.AddOperand(pointer);
3036              result.AddOperand(memory);
3037              result.AddOperand(semantics);
3038              result.AddOperand(value);
3039              AddToFunctionDefinitions(result);
3040  
3041              return result;
3042          }
3043  
3044          public Instruction AtomicSMax(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3045          {
3046              Instruction result = NewInstruction(Op.OpAtomicSMax, GetNewId(), resultType);
3047  
3048              result.AddOperand(pointer);
3049              result.AddOperand(memory);
3050              result.AddOperand(semantics);
3051              result.AddOperand(value);
3052              AddToFunctionDefinitions(result);
3053  
3054              return result;
3055          }
3056  
3057          public Instruction AtomicUMax(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3058          {
3059              Instruction result = NewInstruction(Op.OpAtomicUMax, GetNewId(), resultType);
3060  
3061              result.AddOperand(pointer);
3062              result.AddOperand(memory);
3063              result.AddOperand(semantics);
3064              result.AddOperand(value);
3065              AddToFunctionDefinitions(result);
3066  
3067              return result;
3068          }
3069  
3070          public Instruction AtomicAnd(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3071          {
3072              Instruction result = NewInstruction(Op.OpAtomicAnd, GetNewId(), resultType);
3073  
3074              result.AddOperand(pointer);
3075              result.AddOperand(memory);
3076              result.AddOperand(semantics);
3077              result.AddOperand(value);
3078              AddToFunctionDefinitions(result);
3079  
3080              return result;
3081          }
3082  
3083          public Instruction AtomicOr(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3084          {
3085              Instruction result = NewInstruction(Op.OpAtomicOr, GetNewId(), resultType);
3086  
3087              result.AddOperand(pointer);
3088              result.AddOperand(memory);
3089              result.AddOperand(semantics);
3090              result.AddOperand(value);
3091              AddToFunctionDefinitions(result);
3092  
3093              return result;
3094          }
3095  
3096          public Instruction AtomicXor(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3097          {
3098              Instruction result = NewInstruction(Op.OpAtomicXor, GetNewId(), resultType);
3099  
3100              result.AddOperand(pointer);
3101              result.AddOperand(memory);
3102              result.AddOperand(semantics);
3103              result.AddOperand(value);
3104              AddToFunctionDefinitions(result);
3105  
3106              return result;
3107          }
3108  
3109          public Instruction AtomicFlagTestAndSet(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics)
3110          {
3111              Instruction result = NewInstruction(Op.OpAtomicFlagTestAndSet, GetNewId(), resultType);
3112  
3113              result.AddOperand(pointer);
3114              result.AddOperand(memory);
3115              result.AddOperand(semantics);
3116              AddToFunctionDefinitions(result);
3117  
3118              return result;
3119          }
3120  
3121          public Instruction AtomicFlagClear(Instruction pointer, Instruction memory, Instruction semantics)
3122          {
3123              Instruction result = NewInstruction(Op.OpAtomicFlagClear);
3124  
3125              result.AddOperand(pointer);
3126              result.AddOperand(memory);
3127              result.AddOperand(semantics);
3128              AddToFunctionDefinitions(result);
3129  
3130              return result;
3131          }
3132  
3133          public Instruction AtomicFAddEXT(Instruction resultType, Instruction pointer, Instruction memory, Instruction semantics, Instruction value)
3134          {
3135              Instruction result = NewInstruction(Op.OpAtomicFAddEXT, GetNewId(), resultType);
3136  
3137              result.AddOperand(pointer);
3138              result.AddOperand(memory);
3139              result.AddOperand(semantics);
3140              result.AddOperand(value);
3141              AddToFunctionDefinitions(result);
3142  
3143              return result;
3144          }
3145  
3146          // Primitive
3147  
3148          public Instruction EmitVertex()
3149          {
3150              Instruction result = NewInstruction(Op.OpEmitVertex);
3151  
3152              AddToFunctionDefinitions(result);
3153  
3154              return result;
3155          }
3156  
3157          public Instruction EndPrimitive()
3158          {
3159              Instruction result = NewInstruction(Op.OpEndPrimitive);
3160  
3161              AddToFunctionDefinitions(result);
3162  
3163              return result;
3164          }
3165  
3166          public Instruction EmitStreamVertex(Instruction stream)
3167          {
3168              Instruction result = NewInstruction(Op.OpEmitStreamVertex);
3169  
3170              result.AddOperand(stream);
3171              AddToFunctionDefinitions(result);
3172  
3173              return result;
3174          }
3175  
3176          public Instruction EndStreamPrimitive(Instruction stream)
3177          {
3178              Instruction result = NewInstruction(Op.OpEndStreamPrimitive);
3179  
3180              result.AddOperand(stream);
3181              AddToFunctionDefinitions(result);
3182  
3183              return result;
3184          }
3185  
3186          // Barrier
3187  
3188          public Instruction ControlBarrier(Instruction execution, Instruction memory, Instruction semantics)
3189          {
3190              Instruction result = NewInstruction(Op.OpControlBarrier);
3191  
3192              result.AddOperand(execution);
3193              result.AddOperand(memory);
3194              result.AddOperand(semantics);
3195              AddToFunctionDefinitions(result);
3196  
3197              return result;
3198          }
3199  
3200          public Instruction MemoryBarrier(Instruction memory, Instruction semantics)
3201          {
3202              Instruction result = NewInstruction(Op.OpMemoryBarrier);
3203  
3204              result.AddOperand(memory);
3205              result.AddOperand(semantics);
3206              AddToFunctionDefinitions(result);
3207  
3208              return result;
3209          }
3210  
3211          public Instruction NamedBarrierInitialize(Instruction resultType, Instruction subgroupCount)
3212          {
3213              Instruction result = NewInstruction(Op.OpNamedBarrierInitialize, GetNewId(), resultType);
3214  
3215              result.AddOperand(subgroupCount);
3216              AddToFunctionDefinitions(result);
3217  
3218              return result;
3219          }
3220  
3221          public Instruction MemoryNamedBarrier(Instruction namedBarrier, Instruction memory, Instruction semantics)
3222          {
3223              Instruction result = NewInstruction(Op.OpMemoryNamedBarrier);
3224  
3225              result.AddOperand(namedBarrier);
3226              result.AddOperand(memory);
3227              result.AddOperand(semantics);
3228              AddToFunctionDefinitions(result);
3229  
3230              return result;
3231          }
3232  
3233          // Group
3234  
3235          public Instruction GroupAsyncCopy(Instruction resultType, Instruction execution, Instruction destination, Instruction source, Instruction numElements, Instruction stride, Instruction eventObj)
3236          {
3237              Instruction result = NewInstruction(Op.OpGroupAsyncCopy, GetNewId(), resultType);
3238  
3239              result.AddOperand(execution);
3240              result.AddOperand(destination);
3241              result.AddOperand(source);
3242              result.AddOperand(numElements);
3243              result.AddOperand(stride);
3244              result.AddOperand(eventObj);
3245              AddToFunctionDefinitions(result);
3246  
3247              return result;
3248          }
3249  
3250          public Instruction GroupWaitEvents(Instruction execution, Instruction numEvents, Instruction eventsList)
3251          {
3252              Instruction result = NewInstruction(Op.OpGroupWaitEvents);
3253  
3254              result.AddOperand(execution);
3255              result.AddOperand(numEvents);
3256              result.AddOperand(eventsList);
3257              AddToFunctionDefinitions(result);
3258  
3259              return result;
3260          }
3261  
3262          public Instruction GroupAll(Instruction resultType, Instruction execution, Instruction predicate)
3263          {
3264              Instruction result = NewInstruction(Op.OpGroupAll, GetNewId(), resultType);
3265  
3266              result.AddOperand(execution);
3267              result.AddOperand(predicate);
3268              AddToFunctionDefinitions(result);
3269  
3270              return result;
3271          }
3272  
3273          public Instruction GroupAny(Instruction resultType, Instruction execution, Instruction predicate)
3274          {
3275              Instruction result = NewInstruction(Op.OpGroupAny, GetNewId(), resultType);
3276  
3277              result.AddOperand(execution);
3278              result.AddOperand(predicate);
3279              AddToFunctionDefinitions(result);
3280  
3281              return result;
3282          }
3283  
3284          public Instruction GroupBroadcast(Instruction resultType, Instruction execution, Instruction value, Instruction localId)
3285          {
3286              Instruction result = NewInstruction(Op.OpGroupBroadcast, GetNewId(), resultType);
3287  
3288              result.AddOperand(execution);
3289              result.AddOperand(value);
3290              result.AddOperand(localId);
3291              AddToFunctionDefinitions(result);
3292  
3293              return result;
3294          }
3295  
3296          public Instruction GroupIAdd(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3297          {
3298              Instruction result = NewInstruction(Op.OpGroupIAdd, GetNewId(), resultType);
3299  
3300              result.AddOperand(execution);
3301              result.AddOperand(operation);
3302              result.AddOperand(x);
3303              AddToFunctionDefinitions(result);
3304  
3305              return result;
3306          }
3307  
3308          public Instruction GroupFAdd(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3309          {
3310              Instruction result = NewInstruction(Op.OpGroupFAdd, GetNewId(), resultType);
3311  
3312              result.AddOperand(execution);
3313              result.AddOperand(operation);
3314              result.AddOperand(x);
3315              AddToFunctionDefinitions(result);
3316  
3317              return result;
3318          }
3319  
3320          public Instruction GroupFMin(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3321          {
3322              Instruction result = NewInstruction(Op.OpGroupFMin, GetNewId(), resultType);
3323  
3324              result.AddOperand(execution);
3325              result.AddOperand(operation);
3326              result.AddOperand(x);
3327              AddToFunctionDefinitions(result);
3328  
3329              return result;
3330          }
3331  
3332          public Instruction GroupUMin(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3333          {
3334              Instruction result = NewInstruction(Op.OpGroupUMin, GetNewId(), resultType);
3335  
3336              result.AddOperand(execution);
3337              result.AddOperand(operation);
3338              result.AddOperand(x);
3339              AddToFunctionDefinitions(result);
3340  
3341              return result;
3342          }
3343  
3344          public Instruction GroupSMin(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3345          {
3346              Instruction result = NewInstruction(Op.OpGroupSMin, GetNewId(), resultType);
3347  
3348              result.AddOperand(execution);
3349              result.AddOperand(operation);
3350              result.AddOperand(x);
3351              AddToFunctionDefinitions(result);
3352  
3353              return result;
3354          }
3355  
3356          public Instruction GroupFMax(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3357          {
3358              Instruction result = NewInstruction(Op.OpGroupFMax, GetNewId(), resultType);
3359  
3360              result.AddOperand(execution);
3361              result.AddOperand(operation);
3362              result.AddOperand(x);
3363              AddToFunctionDefinitions(result);
3364  
3365              return result;
3366          }
3367  
3368          public Instruction GroupUMax(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3369          {
3370              Instruction result = NewInstruction(Op.OpGroupUMax, GetNewId(), resultType);
3371  
3372              result.AddOperand(execution);
3373              result.AddOperand(operation);
3374              result.AddOperand(x);
3375              AddToFunctionDefinitions(result);
3376  
3377              return result;
3378          }
3379  
3380          public Instruction GroupSMax(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3381          {
3382              Instruction result = NewInstruction(Op.OpGroupSMax, GetNewId(), resultType);
3383  
3384              result.AddOperand(execution);
3385              result.AddOperand(operation);
3386              result.AddOperand(x);
3387              AddToFunctionDefinitions(result);
3388  
3389              return result;
3390          }
3391  
3392          public Instruction SubgroupBallotKHR(Instruction resultType, Instruction predicate)
3393          {
3394              Instruction result = NewInstruction(Op.OpSubgroupBallotKHR, GetNewId(), resultType);
3395  
3396              result.AddOperand(predicate);
3397              AddToFunctionDefinitions(result);
3398  
3399              return result;
3400          }
3401  
3402          public Instruction SubgroupFirstInvocationKHR(Instruction resultType, Instruction value)
3403          {
3404              Instruction result = NewInstruction(Op.OpSubgroupFirstInvocationKHR, GetNewId(), resultType);
3405  
3406              result.AddOperand(value);
3407              AddToFunctionDefinitions(result);
3408  
3409              return result;
3410          }
3411  
3412          public Instruction SubgroupAllKHR(Instruction resultType, Instruction predicate)
3413          {
3414              Instruction result = NewInstruction(Op.OpSubgroupAllKHR, GetNewId(), resultType);
3415  
3416              result.AddOperand(predicate);
3417              AddToFunctionDefinitions(result);
3418  
3419              return result;
3420          }
3421  
3422          public Instruction SubgroupAnyKHR(Instruction resultType, Instruction predicate)
3423          {
3424              Instruction result = NewInstruction(Op.OpSubgroupAnyKHR, GetNewId(), resultType);
3425  
3426              result.AddOperand(predicate);
3427              AddToFunctionDefinitions(result);
3428  
3429              return result;
3430          }
3431  
3432          public Instruction SubgroupAllEqualKHR(Instruction resultType, Instruction predicate)
3433          {
3434              Instruction result = NewInstruction(Op.OpSubgroupAllEqualKHR, GetNewId(), resultType);
3435  
3436              result.AddOperand(predicate);
3437              AddToFunctionDefinitions(result);
3438  
3439              return result;
3440          }
3441  
3442          public Instruction SubgroupReadInvocationKHR(Instruction resultType, Instruction value, Instruction index)
3443          {
3444              Instruction result = NewInstruction(Op.OpSubgroupReadInvocationKHR, GetNewId(), resultType);
3445  
3446              result.AddOperand(value);
3447              result.AddOperand(index);
3448              AddToFunctionDefinitions(result);
3449  
3450              return result;
3451          }
3452  
3453          public Instruction GroupIAddNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3454          {
3455              Instruction result = NewInstruction(Op.OpGroupIAddNonUniformAMD, GetNewId(), resultType);
3456  
3457              result.AddOperand(execution);
3458              result.AddOperand(operation);
3459              result.AddOperand(x);
3460              AddToFunctionDefinitions(result);
3461  
3462              return result;
3463          }
3464  
3465          public Instruction GroupFAddNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3466          {
3467              Instruction result = NewInstruction(Op.OpGroupFAddNonUniformAMD, GetNewId(), resultType);
3468  
3469              result.AddOperand(execution);
3470              result.AddOperand(operation);
3471              result.AddOperand(x);
3472              AddToFunctionDefinitions(result);
3473  
3474              return result;
3475          }
3476  
3477          public Instruction GroupFMinNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3478          {
3479              Instruction result = NewInstruction(Op.OpGroupFMinNonUniformAMD, GetNewId(), resultType);
3480  
3481              result.AddOperand(execution);
3482              result.AddOperand(operation);
3483              result.AddOperand(x);
3484              AddToFunctionDefinitions(result);
3485  
3486              return result;
3487          }
3488  
3489          public Instruction GroupUMinNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3490          {
3491              Instruction result = NewInstruction(Op.OpGroupUMinNonUniformAMD, GetNewId(), resultType);
3492  
3493              result.AddOperand(execution);
3494              result.AddOperand(operation);
3495              result.AddOperand(x);
3496              AddToFunctionDefinitions(result);
3497  
3498              return result;
3499          }
3500  
3501          public Instruction GroupSMinNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3502          {
3503              Instruction result = NewInstruction(Op.OpGroupSMinNonUniformAMD, GetNewId(), resultType);
3504  
3505              result.AddOperand(execution);
3506              result.AddOperand(operation);
3507              result.AddOperand(x);
3508              AddToFunctionDefinitions(result);
3509  
3510              return result;
3511          }
3512  
3513          public Instruction GroupFMaxNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3514          {
3515              Instruction result = NewInstruction(Op.OpGroupFMaxNonUniformAMD, GetNewId(), resultType);
3516  
3517              result.AddOperand(execution);
3518              result.AddOperand(operation);
3519              result.AddOperand(x);
3520              AddToFunctionDefinitions(result);
3521  
3522              return result;
3523          }
3524  
3525          public Instruction GroupUMaxNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3526          {
3527              Instruction result = NewInstruction(Op.OpGroupUMaxNonUniformAMD, GetNewId(), resultType);
3528  
3529              result.AddOperand(execution);
3530              result.AddOperand(operation);
3531              result.AddOperand(x);
3532              AddToFunctionDefinitions(result);
3533  
3534              return result;
3535          }
3536  
3537          public Instruction GroupSMaxNonUniformAMD(Instruction resultType, Instruction execution, GroupOperation operation, Instruction x)
3538          {
3539              Instruction result = NewInstruction(Op.OpGroupSMaxNonUniformAMD, GetNewId(), resultType);
3540  
3541              result.AddOperand(execution);
3542              result.AddOperand(operation);
3543              result.AddOperand(x);
3544              AddToFunctionDefinitions(result);
3545  
3546              return result;
3547          }
3548  
3549          public Instruction SubgroupShuffleINTEL(Instruction resultType, Instruction data, Instruction invocationId)
3550          {
3551              Instruction result = NewInstruction(Op.OpSubgroupShuffleINTEL, GetNewId(), resultType);
3552  
3553              result.AddOperand(data);
3554              result.AddOperand(invocationId);
3555              AddToFunctionDefinitions(result);
3556  
3557              return result;
3558          }
3559  
3560          public Instruction SubgroupShuffleDownINTEL(Instruction resultType, Instruction current, Instruction next, Instruction delta)
3561          {
3562              Instruction result = NewInstruction(Op.OpSubgroupShuffleDownINTEL, GetNewId(), resultType);
3563  
3564              result.AddOperand(current);
3565              result.AddOperand(next);
3566              result.AddOperand(delta);
3567              AddToFunctionDefinitions(result);
3568  
3569              return result;
3570          }
3571  
3572          public Instruction SubgroupShuffleUpINTEL(Instruction resultType, Instruction previous, Instruction current, Instruction delta)
3573          {
3574              Instruction result = NewInstruction(Op.OpSubgroupShuffleUpINTEL, GetNewId(), resultType);
3575  
3576              result.AddOperand(previous);
3577              result.AddOperand(current);
3578              result.AddOperand(delta);
3579              AddToFunctionDefinitions(result);
3580  
3581              return result;
3582          }
3583  
3584          public Instruction SubgroupShuffleXorINTEL(Instruction resultType, Instruction data, Instruction value)
3585          {
3586              Instruction result = NewInstruction(Op.OpSubgroupShuffleXorINTEL, GetNewId(), resultType);
3587  
3588              result.AddOperand(data);
3589              result.AddOperand(value);
3590              AddToFunctionDefinitions(result);
3591  
3592              return result;
3593          }
3594  
3595          public Instruction SubgroupBlockReadINTEL(Instruction resultType, Instruction ptr)
3596          {
3597              Instruction result = NewInstruction(Op.OpSubgroupBlockReadINTEL, GetNewId(), resultType);
3598  
3599              result.AddOperand(ptr);
3600              AddToFunctionDefinitions(result);
3601  
3602              return result;
3603          }
3604  
3605          public Instruction SubgroupBlockWriteINTEL(Instruction ptr, Instruction data)
3606          {
3607              Instruction result = NewInstruction(Op.OpSubgroupBlockWriteINTEL);
3608  
3609              result.AddOperand(ptr);
3610              result.AddOperand(data);
3611              AddToFunctionDefinitions(result);
3612  
3613              return result;
3614          }
3615  
3616          public Instruction SubgroupImageBlockReadINTEL(Instruction resultType, Instruction image, Instruction coordinate)
3617          {
3618              Instruction result = NewInstruction(Op.OpSubgroupImageBlockReadINTEL, GetNewId(), resultType);
3619  
3620              result.AddOperand(image);
3621              result.AddOperand(coordinate);
3622              AddToFunctionDefinitions(result);
3623  
3624              return result;
3625          }
3626  
3627          public Instruction SubgroupImageBlockWriteINTEL(Instruction image, Instruction coordinate, Instruction data)
3628          {
3629              Instruction result = NewInstruction(Op.OpSubgroupImageBlockWriteINTEL);
3630  
3631              result.AddOperand(image);
3632              result.AddOperand(coordinate);
3633              result.AddOperand(data);
3634              AddToFunctionDefinitions(result);
3635  
3636              return result;
3637          }
3638  
3639          public Instruction SubgroupImageMediaBlockReadINTEL(Instruction resultType, Instruction image, Instruction coordinate, Instruction width, Instruction height)
3640          {
3641              Instruction result = NewInstruction(Op.OpSubgroupImageMediaBlockReadINTEL, GetNewId(), resultType);
3642  
3643              result.AddOperand(image);
3644              result.AddOperand(coordinate);
3645              result.AddOperand(width);
3646              result.AddOperand(height);
3647              AddToFunctionDefinitions(result);
3648  
3649              return result;
3650          }
3651  
3652          public Instruction SubgroupImageMediaBlockWriteINTEL(Instruction image, Instruction coordinate, Instruction width, Instruction height, Instruction data)
3653          {
3654              Instruction result = NewInstruction(Op.OpSubgroupImageMediaBlockWriteINTEL);
3655  
3656              result.AddOperand(image);
3657              result.AddOperand(coordinate);
3658              result.AddOperand(width);
3659              result.AddOperand(height);
3660              result.AddOperand(data);
3661              AddToFunctionDefinitions(result);
3662  
3663              return result;
3664          }
3665  
3666          // Device-Side_Enqueue
3667  
3668          public Instruction EnqueueMarker(Instruction resultType, Instruction queue, Instruction numEvents, Instruction waitEvents, Instruction retEvent)
3669          {
3670              Instruction result = NewInstruction(Op.OpEnqueueMarker, GetNewId(), resultType);
3671  
3672              result.AddOperand(queue);
3673              result.AddOperand(numEvents);
3674              result.AddOperand(waitEvents);
3675              result.AddOperand(retEvent);
3676              AddToFunctionDefinitions(result);
3677  
3678              return result;
3679          }
3680  
3681          public Instruction EnqueueKernel(Instruction resultType, Instruction queue, Instruction flags, Instruction nDRange, Instruction numEvents, Instruction waitEvents, Instruction retEvent, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign, params Instruction[] localSize)
3682          {
3683              Instruction result = NewInstruction(Op.OpEnqueueKernel, GetNewId(), resultType);
3684  
3685              result.AddOperand(queue);
3686              result.AddOperand(flags);
3687              result.AddOperand(nDRange);
3688              result.AddOperand(numEvents);
3689              result.AddOperand(waitEvents);
3690              result.AddOperand(retEvent);
3691              result.AddOperand(invoke);
3692              result.AddOperand(param);
3693              result.AddOperand(paramSize);
3694              result.AddOperand(paramAlign);
3695              result.AddOperand(localSize);
3696              AddToFunctionDefinitions(result);
3697  
3698              return result;
3699          }
3700  
3701          public Instruction GetKernelNDrangeSubGroupCount(Instruction resultType, Instruction nDRange, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign)
3702          {
3703              Instruction result = NewInstruction(Op.OpGetKernelNDrangeSubGroupCount, GetNewId(), resultType);
3704  
3705              result.AddOperand(nDRange);
3706              result.AddOperand(invoke);
3707              result.AddOperand(param);
3708              result.AddOperand(paramSize);
3709              result.AddOperand(paramAlign);
3710              AddToFunctionDefinitions(result);
3711  
3712              return result;
3713          }
3714  
3715          public Instruction GetKernelNDrangeMaxSubGroupSize(Instruction resultType, Instruction nDRange, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign)
3716          {
3717              Instruction result = NewInstruction(Op.OpGetKernelNDrangeMaxSubGroupSize, GetNewId(), resultType);
3718  
3719              result.AddOperand(nDRange);
3720              result.AddOperand(invoke);
3721              result.AddOperand(param);
3722              result.AddOperand(paramSize);
3723              result.AddOperand(paramAlign);
3724              AddToFunctionDefinitions(result);
3725  
3726              return result;
3727          }
3728  
3729          public Instruction GetKernelWorkGroupSize(Instruction resultType, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign)
3730          {
3731              Instruction result = NewInstruction(Op.OpGetKernelWorkGroupSize, GetNewId(), resultType);
3732  
3733              result.AddOperand(invoke);
3734              result.AddOperand(param);
3735              result.AddOperand(paramSize);
3736              result.AddOperand(paramAlign);
3737              AddToFunctionDefinitions(result);
3738  
3739              return result;
3740          }
3741  
3742          public Instruction GetKernelPreferredWorkGroupSizeMultiple(Instruction resultType, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign)
3743          {
3744              Instruction result = NewInstruction(Op.OpGetKernelPreferredWorkGroupSizeMultiple, GetNewId(), resultType);
3745  
3746              result.AddOperand(invoke);
3747              result.AddOperand(param);
3748              result.AddOperand(paramSize);
3749              result.AddOperand(paramAlign);
3750              AddToFunctionDefinitions(result);
3751  
3752              return result;
3753          }
3754  
3755          public Instruction RetainEvent(Instruction eventObj)
3756          {
3757              Instruction result = NewInstruction(Op.OpRetainEvent);
3758  
3759              result.AddOperand(eventObj);
3760              AddToFunctionDefinitions(result);
3761  
3762              return result;
3763          }
3764  
3765          public Instruction ReleaseEvent(Instruction eventObj)
3766          {
3767              Instruction result = NewInstruction(Op.OpReleaseEvent);
3768  
3769              result.AddOperand(eventObj);
3770              AddToFunctionDefinitions(result);
3771  
3772              return result;
3773          }
3774  
3775          public Instruction CreateUserEvent(Instruction resultType)
3776          {
3777              Instruction result = NewInstruction(Op.OpCreateUserEvent, GetNewId(), resultType);
3778  
3779              AddToFunctionDefinitions(result);
3780  
3781              return result;
3782          }
3783  
3784          public Instruction IsValidEvent(Instruction resultType, Instruction eventObj)
3785          {
3786              Instruction result = NewInstruction(Op.OpIsValidEvent, GetNewId(), resultType);
3787  
3788              result.AddOperand(eventObj);
3789              AddToFunctionDefinitions(result);
3790  
3791              return result;
3792          }
3793  
3794          public Instruction SetUserEventStatus(Instruction eventObj, Instruction status)
3795          {
3796              Instruction result = NewInstruction(Op.OpSetUserEventStatus);
3797  
3798              result.AddOperand(eventObj);
3799              result.AddOperand(status);
3800              AddToFunctionDefinitions(result);
3801  
3802              return result;
3803          }
3804  
3805          public Instruction CaptureEventProfilingInfo(Instruction eventObj, Instruction profilingInfo, Instruction value)
3806          {
3807              Instruction result = NewInstruction(Op.OpCaptureEventProfilingInfo);
3808  
3809              result.AddOperand(eventObj);
3810              result.AddOperand(profilingInfo);
3811              result.AddOperand(value);
3812              AddToFunctionDefinitions(result);
3813  
3814              return result;
3815          }
3816  
3817          public Instruction GetDefaultQueue(Instruction resultType)
3818          {
3819              Instruction result = NewInstruction(Op.OpGetDefaultQueue, GetNewId(), resultType);
3820  
3821              AddToFunctionDefinitions(result);
3822  
3823              return result;
3824          }
3825  
3826          public Instruction BuildNDRange(Instruction resultType, Instruction globalWorkSize, Instruction localWorkSize, Instruction globalWorkOffset)
3827          {
3828              Instruction result = NewInstruction(Op.OpBuildNDRange, GetNewId(), resultType);
3829  
3830              result.AddOperand(globalWorkSize);
3831              result.AddOperand(localWorkSize);
3832              result.AddOperand(globalWorkOffset);
3833              AddToFunctionDefinitions(result);
3834  
3835              return result;
3836          }
3837  
3838          public Instruction GetKernelLocalSizeForSubgroupCount(Instruction resultType, Instruction subgroupCount, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign)
3839          {
3840              Instruction result = NewInstruction(Op.OpGetKernelLocalSizeForSubgroupCount, GetNewId(), resultType);
3841  
3842              result.AddOperand(subgroupCount);
3843              result.AddOperand(invoke);
3844              result.AddOperand(param);
3845              result.AddOperand(paramSize);
3846              result.AddOperand(paramAlign);
3847              AddToFunctionDefinitions(result);
3848  
3849              return result;
3850          }
3851  
3852          public Instruction GetKernelMaxNumSubgroups(Instruction resultType, Instruction invoke, Instruction param, Instruction paramSize, Instruction paramAlign)
3853          {
3854              Instruction result = NewInstruction(Op.OpGetKernelMaxNumSubgroups, GetNewId(), resultType);
3855  
3856              result.AddOperand(invoke);
3857              result.AddOperand(param);
3858              result.AddOperand(paramSize);
3859              result.AddOperand(paramAlign);
3860              AddToFunctionDefinitions(result);
3861  
3862              return result;
3863          }
3864  
3865          // Pipe
3866  
3867          public Instruction ReadPipe(Instruction resultType, Instruction pipe, Instruction pointer, Instruction packetSize, Instruction packetAlignment)
3868          {
3869              Instruction result = NewInstruction(Op.OpReadPipe, GetNewId(), resultType);
3870  
3871              result.AddOperand(pipe);
3872              result.AddOperand(pointer);
3873              result.AddOperand(packetSize);
3874              result.AddOperand(packetAlignment);
3875              AddToFunctionDefinitions(result);
3876  
3877              return result;
3878          }
3879  
3880          public Instruction WritePipe(Instruction resultType, Instruction pipe, Instruction pointer, Instruction packetSize, Instruction packetAlignment)
3881          {
3882              Instruction result = NewInstruction(Op.OpWritePipe, GetNewId(), resultType);
3883  
3884              result.AddOperand(pipe);
3885              result.AddOperand(pointer);
3886              result.AddOperand(packetSize);
3887              result.AddOperand(packetAlignment);
3888              AddToFunctionDefinitions(result);
3889  
3890              return result;
3891          }
3892  
3893          public Instruction ReservedReadPipe(Instruction resultType, Instruction pipe, Instruction reserveId, Instruction index, Instruction pointer, Instruction packetSize, Instruction packetAlignment)
3894          {
3895              Instruction result = NewInstruction(Op.OpReservedReadPipe, GetNewId(), resultType);
3896  
3897              result.AddOperand(pipe);
3898              result.AddOperand(reserveId);
3899              result.AddOperand(index);
3900              result.AddOperand(pointer);
3901              result.AddOperand(packetSize);
3902              result.AddOperand(packetAlignment);
3903              AddToFunctionDefinitions(result);
3904  
3905              return result;
3906          }
3907  
3908          public Instruction ReservedWritePipe(Instruction resultType, Instruction pipe, Instruction reserveId, Instruction index, Instruction pointer, Instruction packetSize, Instruction packetAlignment)
3909          {
3910              Instruction result = NewInstruction(Op.OpReservedWritePipe, GetNewId(), resultType);
3911  
3912              result.AddOperand(pipe);
3913              result.AddOperand(reserveId);
3914              result.AddOperand(index);
3915              result.AddOperand(pointer);
3916              result.AddOperand(packetSize);
3917              result.AddOperand(packetAlignment);
3918              AddToFunctionDefinitions(result);
3919  
3920              return result;
3921          }
3922  
3923          public Instruction ReserveReadPipePackets(Instruction resultType, Instruction pipe, Instruction numPackets, Instruction packetSize, Instruction packetAlignment)
3924          {
3925              Instruction result = NewInstruction(Op.OpReserveReadPipePackets, GetNewId(), resultType);
3926  
3927              result.AddOperand(pipe);
3928              result.AddOperand(numPackets);
3929              result.AddOperand(packetSize);
3930              result.AddOperand(packetAlignment);
3931              AddToFunctionDefinitions(result);
3932  
3933              return result;
3934          }
3935  
3936          public Instruction ReserveWritePipePackets(Instruction resultType, Instruction pipe, Instruction numPackets, Instruction packetSize, Instruction packetAlignment)
3937          {
3938              Instruction result = NewInstruction(Op.OpReserveWritePipePackets, GetNewId(), resultType);
3939  
3940              result.AddOperand(pipe);
3941              result.AddOperand(numPackets);
3942              result.AddOperand(packetSize);
3943              result.AddOperand(packetAlignment);
3944              AddToFunctionDefinitions(result);
3945  
3946              return result;
3947          }
3948  
3949          public Instruction CommitReadPipe(Instruction pipe, Instruction reserveId, Instruction packetSize, Instruction packetAlignment)
3950          {
3951              Instruction result = NewInstruction(Op.OpCommitReadPipe);
3952  
3953              result.AddOperand(pipe);
3954              result.AddOperand(reserveId);
3955              result.AddOperand(packetSize);
3956              result.AddOperand(packetAlignment);
3957              AddToFunctionDefinitions(result);
3958  
3959              return result;
3960          }
3961  
3962          public Instruction CommitWritePipe(Instruction pipe, Instruction reserveId, Instruction packetSize, Instruction packetAlignment)
3963          {
3964              Instruction result = NewInstruction(Op.OpCommitWritePipe);
3965  
3966              result.AddOperand(pipe);
3967              result.AddOperand(reserveId);
3968              result.AddOperand(packetSize);
3969              result.AddOperand(packetAlignment);
3970              AddToFunctionDefinitions(result);
3971  
3972              return result;
3973          }
3974  
3975          public Instruction IsValidReserveId(Instruction resultType, Instruction reserveId)
3976          {
3977              Instruction result = NewInstruction(Op.OpIsValidReserveId, GetNewId(), resultType);
3978  
3979              result.AddOperand(reserveId);
3980              AddToFunctionDefinitions(result);
3981  
3982              return result;
3983          }
3984  
3985          public Instruction GetNumPipePackets(Instruction resultType, Instruction pipe, Instruction packetSize, Instruction packetAlignment)
3986          {
3987              Instruction result = NewInstruction(Op.OpGetNumPipePackets, GetNewId(), resultType);
3988  
3989              result.AddOperand(pipe);
3990              result.AddOperand(packetSize);
3991              result.AddOperand(packetAlignment);
3992              AddToFunctionDefinitions(result);
3993  
3994              return result;
3995          }
3996  
3997          public Instruction GetMaxPipePackets(Instruction resultType, Instruction pipe, Instruction packetSize, Instruction packetAlignment)
3998          {
3999              Instruction result = NewInstruction(Op.OpGetMaxPipePackets, GetNewId(), resultType);
4000  
4001              result.AddOperand(pipe);
4002              result.AddOperand(packetSize);
4003              result.AddOperand(packetAlignment);
4004              AddToFunctionDefinitions(result);
4005  
4006              return result;
4007          }
4008  
4009          public Instruction GroupReserveReadPipePackets(Instruction resultType, Instruction execution, Instruction pipe, Instruction numPackets, Instruction packetSize, Instruction packetAlignment)
4010          {
4011              Instruction result = NewInstruction(Op.OpGroupReserveReadPipePackets, GetNewId(), resultType);
4012  
4013              result.AddOperand(execution);
4014              result.AddOperand(pipe);
4015              result.AddOperand(numPackets);
4016              result.AddOperand(packetSize);
4017              result.AddOperand(packetAlignment);
4018              AddToFunctionDefinitions(result);
4019  
4020              return result;
4021          }
4022  
4023          public Instruction GroupReserveWritePipePackets(Instruction resultType, Instruction execution, Instruction pipe, Instruction numPackets, Instruction packetSize, Instruction packetAlignment)
4024          {
4025              Instruction result = NewInstruction(Op.OpGroupReserveWritePipePackets, GetNewId(), resultType);
4026  
4027              result.AddOperand(execution);
4028              result.AddOperand(pipe);
4029              result.AddOperand(numPackets);
4030              result.AddOperand(packetSize);
4031              result.AddOperand(packetAlignment);
4032              AddToFunctionDefinitions(result);
4033  
4034              return result;
4035          }
4036  
4037          public Instruction GroupCommitReadPipe(Instruction execution, Instruction pipe, Instruction reserveId, Instruction packetSize, Instruction packetAlignment)
4038          {
4039              Instruction result = NewInstruction(Op.OpGroupCommitReadPipe);
4040  
4041              result.AddOperand(execution);
4042              result.AddOperand(pipe);
4043              result.AddOperand(reserveId);
4044              result.AddOperand(packetSize);
4045              result.AddOperand(packetAlignment);
4046              AddToFunctionDefinitions(result);
4047  
4048              return result;
4049          }
4050  
4051          public Instruction GroupCommitWritePipe(Instruction execution, Instruction pipe, Instruction reserveId, Instruction packetSize, Instruction packetAlignment)
4052          {
4053              Instruction result = NewInstruction(Op.OpGroupCommitWritePipe);
4054  
4055              result.AddOperand(execution);
4056              result.AddOperand(pipe);
4057              result.AddOperand(reserveId);
4058              result.AddOperand(packetSize);
4059              result.AddOperand(packetAlignment);
4060              AddToFunctionDefinitions(result);
4061  
4062              return result;
4063          }
4064  
4065          public Instruction ConstantPipeStorage(Instruction resultType, LiteralInteger packetSize, LiteralInteger packetAlignment, LiteralInteger capacity)
4066          {
4067              Instruction result = NewInstruction(Op.OpConstantPipeStorage, GetNewId(), resultType);
4068  
4069              result.AddOperand(packetSize);
4070              result.AddOperand(packetAlignment);
4071              result.AddOperand(capacity);
4072              AddToFunctionDefinitions(result);
4073  
4074              return result;
4075          }
4076  
4077          public Instruction CreatePipeFromPipeStorage(Instruction resultType, Instruction pipeStorage)
4078          {
4079              Instruction result = NewInstruction(Op.OpCreatePipeFromPipeStorage, GetNewId(), resultType);
4080  
4081              result.AddOperand(pipeStorage);
4082              AddToFunctionDefinitions(result);
4083  
4084              return result;
4085          }
4086  
4087          public Instruction ReadPipeBlockingINTEL(Instruction resultType, Instruction packetSize, Instruction packetAlignment)
4088          {
4089              Instruction result = NewInstruction(Op.OpReadPipeBlockingINTEL, GetNewId(), resultType);
4090  
4091              result.AddOperand(packetSize);
4092              result.AddOperand(packetAlignment);
4093              AddToFunctionDefinitions(result);
4094  
4095              return result;
4096          }
4097  
4098          public Instruction WritePipeBlockingINTEL(Instruction resultType, Instruction packetSize, Instruction packetAlignment)
4099          {
4100              Instruction result = NewInstruction(Op.OpWritePipeBlockingINTEL, GetNewId(), resultType);
4101  
4102              result.AddOperand(packetSize);
4103              result.AddOperand(packetAlignment);
4104              AddToFunctionDefinitions(result);
4105  
4106              return result;
4107          }
4108  
4109          // Non-Uniform
4110  
4111          public Instruction GroupNonUniformElect(Instruction resultType, Instruction execution)
4112          {
4113              Instruction result = NewInstruction(Op.OpGroupNonUniformElect, GetNewId(), resultType);
4114  
4115              result.AddOperand(execution);
4116              AddToFunctionDefinitions(result);
4117  
4118              return result;
4119          }
4120  
4121          public Instruction GroupNonUniformAll(Instruction resultType, Instruction execution, Instruction predicate)
4122          {
4123              Instruction result = NewInstruction(Op.OpGroupNonUniformAll, GetNewId(), resultType);
4124  
4125              result.AddOperand(execution);
4126              result.AddOperand(predicate);
4127              AddToFunctionDefinitions(result);
4128  
4129              return result;
4130          }
4131  
4132          public Instruction GroupNonUniformAny(Instruction resultType, Instruction execution, Instruction predicate)
4133          {
4134              Instruction result = NewInstruction(Op.OpGroupNonUniformAny, GetNewId(), resultType);
4135  
4136              result.AddOperand(execution);
4137              result.AddOperand(predicate);
4138              AddToFunctionDefinitions(result);
4139  
4140              return result;
4141          }
4142  
4143          public Instruction GroupNonUniformAllEqual(Instruction resultType, Instruction execution, Instruction value)
4144          {
4145              Instruction result = NewInstruction(Op.OpGroupNonUniformAllEqual, GetNewId(), resultType);
4146  
4147              result.AddOperand(execution);
4148              result.AddOperand(value);
4149              AddToFunctionDefinitions(result);
4150  
4151              return result;
4152          }
4153  
4154          public Instruction GroupNonUniformBroadcast(Instruction resultType, Instruction execution, Instruction value, Instruction id)
4155          {
4156              Instruction result = NewInstruction(Op.OpGroupNonUniformBroadcast, GetNewId(), resultType);
4157  
4158              result.AddOperand(execution);
4159              result.AddOperand(value);
4160              result.AddOperand(id);
4161              AddToFunctionDefinitions(result);
4162  
4163              return result;
4164          }
4165  
4166          public Instruction GroupNonUniformBroadcastFirst(Instruction resultType, Instruction execution, Instruction value)
4167          {
4168              Instruction result = NewInstruction(Op.OpGroupNonUniformBroadcastFirst, GetNewId(), resultType);
4169  
4170              result.AddOperand(execution);
4171              result.AddOperand(value);
4172              AddToFunctionDefinitions(result);
4173  
4174              return result;
4175          }
4176  
4177          public Instruction GroupNonUniformBallot(Instruction resultType, Instruction execution, Instruction predicate)
4178          {
4179              Instruction result = NewInstruction(Op.OpGroupNonUniformBallot, GetNewId(), resultType);
4180  
4181              result.AddOperand(execution);
4182              result.AddOperand(predicate);
4183              AddToFunctionDefinitions(result);
4184  
4185              return result;
4186          }
4187  
4188          public Instruction GroupNonUniformInverseBallot(Instruction resultType, Instruction execution, Instruction value)
4189          {
4190              Instruction result = NewInstruction(Op.OpGroupNonUniformInverseBallot, GetNewId(), resultType);
4191  
4192              result.AddOperand(execution);
4193              result.AddOperand(value);
4194              AddToFunctionDefinitions(result);
4195  
4196              return result;
4197          }
4198  
4199          public Instruction GroupNonUniformBallotBitExtract(Instruction resultType, Instruction execution, Instruction value, Instruction index)
4200          {
4201              Instruction result = NewInstruction(Op.OpGroupNonUniformBallotBitExtract, GetNewId(), resultType);
4202  
4203              result.AddOperand(execution);
4204              result.AddOperand(value);
4205              result.AddOperand(index);
4206              AddToFunctionDefinitions(result);
4207  
4208              return result;
4209          }
4210  
4211          public Instruction GroupNonUniformBallotBitCount(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value)
4212          {
4213              Instruction result = NewInstruction(Op.OpGroupNonUniformBallotBitCount, GetNewId(), resultType);
4214  
4215              result.AddOperand(execution);
4216              result.AddOperand(operation);
4217              result.AddOperand(value);
4218              AddToFunctionDefinitions(result);
4219  
4220              return result;
4221          }
4222  
4223          public Instruction GroupNonUniformBallotFindLSB(Instruction resultType, Instruction execution, Instruction value)
4224          {
4225              Instruction result = NewInstruction(Op.OpGroupNonUniformBallotFindLSB, GetNewId(), resultType);
4226  
4227              result.AddOperand(execution);
4228              result.AddOperand(value);
4229              AddToFunctionDefinitions(result);
4230  
4231              return result;
4232          }
4233  
4234          public Instruction GroupNonUniformBallotFindMSB(Instruction resultType, Instruction execution, Instruction value)
4235          {
4236              Instruction result = NewInstruction(Op.OpGroupNonUniformBallotFindMSB, GetNewId(), resultType);
4237  
4238              result.AddOperand(execution);
4239              result.AddOperand(value);
4240              AddToFunctionDefinitions(result);
4241  
4242              return result;
4243          }
4244  
4245          public Instruction GroupNonUniformShuffle(Instruction resultType, Instruction execution, Instruction value, Instruction id)
4246          {
4247              Instruction result = NewInstruction(Op.OpGroupNonUniformShuffle, GetNewId(), resultType);
4248  
4249              result.AddOperand(execution);
4250              result.AddOperand(value);
4251              result.AddOperand(id);
4252              AddToFunctionDefinitions(result);
4253  
4254              return result;
4255          }
4256  
4257          public Instruction GroupNonUniformShuffleXor(Instruction resultType, Instruction execution, Instruction value, Instruction mask)
4258          {
4259              Instruction result = NewInstruction(Op.OpGroupNonUniformShuffleXor, GetNewId(), resultType);
4260  
4261              result.AddOperand(execution);
4262              result.AddOperand(value);
4263              result.AddOperand(mask);
4264              AddToFunctionDefinitions(result);
4265  
4266              return result;
4267          }
4268  
4269          public Instruction GroupNonUniformShuffleUp(Instruction resultType, Instruction execution, Instruction value, Instruction delta)
4270          {
4271              Instruction result = NewInstruction(Op.OpGroupNonUniformShuffleUp, GetNewId(), resultType);
4272  
4273              result.AddOperand(execution);
4274              result.AddOperand(value);
4275              result.AddOperand(delta);
4276              AddToFunctionDefinitions(result);
4277  
4278              return result;
4279          }
4280  
4281          public Instruction GroupNonUniformShuffleDown(Instruction resultType, Instruction execution, Instruction value, Instruction delta)
4282          {
4283              Instruction result = NewInstruction(Op.OpGroupNonUniformShuffleDown, GetNewId(), resultType);
4284  
4285              result.AddOperand(execution);
4286              result.AddOperand(value);
4287              result.AddOperand(delta);
4288              AddToFunctionDefinitions(result);
4289  
4290              return result;
4291          }
4292  
4293          public Instruction GroupNonUniformIAdd(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4294          {
4295              Instruction result = NewInstruction(Op.OpGroupNonUniformIAdd, GetNewId(), resultType);
4296  
4297              result.AddOperand(execution);
4298              result.AddOperand(operation);
4299              result.AddOperand(value);
4300              if (clusterSize != null)
4301              {
4302                  result.AddOperand(clusterSize);
4303              }
4304              AddToFunctionDefinitions(result);
4305  
4306              return result;
4307          }
4308  
4309          public Instruction GroupNonUniformFAdd(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4310          {
4311              Instruction result = NewInstruction(Op.OpGroupNonUniformFAdd, GetNewId(), resultType);
4312  
4313              result.AddOperand(execution);
4314              result.AddOperand(operation);
4315              result.AddOperand(value);
4316              if (clusterSize != null)
4317              {
4318                  result.AddOperand(clusterSize);
4319              }
4320              AddToFunctionDefinitions(result);
4321  
4322              return result;
4323          }
4324  
4325          public Instruction GroupNonUniformIMul(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4326          {
4327              Instruction result = NewInstruction(Op.OpGroupNonUniformIMul, GetNewId(), resultType);
4328  
4329              result.AddOperand(execution);
4330              result.AddOperand(operation);
4331              result.AddOperand(value);
4332              if (clusterSize != null)
4333              {
4334                  result.AddOperand(clusterSize);
4335              }
4336              AddToFunctionDefinitions(result);
4337  
4338              return result;
4339          }
4340  
4341          public Instruction GroupNonUniformFMul(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4342          {
4343              Instruction result = NewInstruction(Op.OpGroupNonUniformFMul, GetNewId(), resultType);
4344  
4345              result.AddOperand(execution);
4346              result.AddOperand(operation);
4347              result.AddOperand(value);
4348              if (clusterSize != null)
4349              {
4350                  result.AddOperand(clusterSize);
4351              }
4352              AddToFunctionDefinitions(result);
4353  
4354              return result;
4355          }
4356  
4357          public Instruction GroupNonUniformSMin(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4358          {
4359              Instruction result = NewInstruction(Op.OpGroupNonUniformSMin, GetNewId(), resultType);
4360  
4361              result.AddOperand(execution);
4362              result.AddOperand(operation);
4363              result.AddOperand(value);
4364              if (clusterSize != null)
4365              {
4366                  result.AddOperand(clusterSize);
4367              }
4368              AddToFunctionDefinitions(result);
4369  
4370              return result;
4371          }
4372  
4373          public Instruction GroupNonUniformUMin(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4374          {
4375              Instruction result = NewInstruction(Op.OpGroupNonUniformUMin, GetNewId(), resultType);
4376  
4377              result.AddOperand(execution);
4378              result.AddOperand(operation);
4379              result.AddOperand(value);
4380              if (clusterSize != null)
4381              {
4382                  result.AddOperand(clusterSize);
4383              }
4384              AddToFunctionDefinitions(result);
4385  
4386              return result;
4387          }
4388  
4389          public Instruction GroupNonUniformFMin(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4390          {
4391              Instruction result = NewInstruction(Op.OpGroupNonUniformFMin, GetNewId(), resultType);
4392  
4393              result.AddOperand(execution);
4394              result.AddOperand(operation);
4395              result.AddOperand(value);
4396              if (clusterSize != null)
4397              {
4398                  result.AddOperand(clusterSize);
4399              }
4400              AddToFunctionDefinitions(result);
4401  
4402              return result;
4403          }
4404  
4405          public Instruction GroupNonUniformSMax(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4406          {
4407              Instruction result = NewInstruction(Op.OpGroupNonUniformSMax, GetNewId(), resultType);
4408  
4409              result.AddOperand(execution);
4410              result.AddOperand(operation);
4411              result.AddOperand(value);
4412              if (clusterSize != null)
4413              {
4414                  result.AddOperand(clusterSize);
4415              }
4416              AddToFunctionDefinitions(result);
4417  
4418              return result;
4419          }
4420  
4421          public Instruction GroupNonUniformUMax(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4422          {
4423              Instruction result = NewInstruction(Op.OpGroupNonUniformUMax, GetNewId(), resultType);
4424  
4425              result.AddOperand(execution);
4426              result.AddOperand(operation);
4427              result.AddOperand(value);
4428              if (clusterSize != null)
4429              {
4430                  result.AddOperand(clusterSize);
4431              }
4432              AddToFunctionDefinitions(result);
4433  
4434              return result;
4435          }
4436  
4437          public Instruction GroupNonUniformFMax(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4438          {
4439              Instruction result = NewInstruction(Op.OpGroupNonUniformFMax, GetNewId(), resultType);
4440  
4441              result.AddOperand(execution);
4442              result.AddOperand(operation);
4443              result.AddOperand(value);
4444              if (clusterSize != null)
4445              {
4446                  result.AddOperand(clusterSize);
4447              }
4448              AddToFunctionDefinitions(result);
4449  
4450              return result;
4451          }
4452  
4453          public Instruction GroupNonUniformBitwiseAnd(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4454          {
4455              Instruction result = NewInstruction(Op.OpGroupNonUniformBitwiseAnd, GetNewId(), resultType);
4456  
4457              result.AddOperand(execution);
4458              result.AddOperand(operation);
4459              result.AddOperand(value);
4460              if (clusterSize != null)
4461              {
4462                  result.AddOperand(clusterSize);
4463              }
4464              AddToFunctionDefinitions(result);
4465  
4466              return result;
4467          }
4468  
4469          public Instruction GroupNonUniformBitwiseOr(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4470          {
4471              Instruction result = NewInstruction(Op.OpGroupNonUniformBitwiseOr, GetNewId(), resultType);
4472  
4473              result.AddOperand(execution);
4474              result.AddOperand(operation);
4475              result.AddOperand(value);
4476              if (clusterSize != null)
4477              {
4478                  result.AddOperand(clusterSize);
4479              }
4480              AddToFunctionDefinitions(result);
4481  
4482              return result;
4483          }
4484  
4485          public Instruction GroupNonUniformBitwiseXor(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4486          {
4487              Instruction result = NewInstruction(Op.OpGroupNonUniformBitwiseXor, GetNewId(), resultType);
4488  
4489              result.AddOperand(execution);
4490              result.AddOperand(operation);
4491              result.AddOperand(value);
4492              if (clusterSize != null)
4493              {
4494                  result.AddOperand(clusterSize);
4495              }
4496              AddToFunctionDefinitions(result);
4497  
4498              return result;
4499          }
4500  
4501          public Instruction GroupNonUniformLogicalAnd(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4502          {
4503              Instruction result = NewInstruction(Op.OpGroupNonUniformLogicalAnd, GetNewId(), resultType);
4504  
4505              result.AddOperand(execution);
4506              result.AddOperand(operation);
4507              result.AddOperand(value);
4508              if (clusterSize != null)
4509              {
4510                  result.AddOperand(clusterSize);
4511              }
4512              AddToFunctionDefinitions(result);
4513  
4514              return result;
4515          }
4516  
4517          public Instruction GroupNonUniformLogicalOr(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4518          {
4519              Instruction result = NewInstruction(Op.OpGroupNonUniformLogicalOr, GetNewId(), resultType);
4520  
4521              result.AddOperand(execution);
4522              result.AddOperand(operation);
4523              result.AddOperand(value);
4524              if (clusterSize != null)
4525              {
4526                  result.AddOperand(clusterSize);
4527              }
4528              AddToFunctionDefinitions(result);
4529  
4530              return result;
4531          }
4532  
4533          public Instruction GroupNonUniformLogicalXor(Instruction resultType, Instruction execution, GroupOperation operation, Instruction value, Instruction clusterSize = null)
4534          {
4535              Instruction result = NewInstruction(Op.OpGroupNonUniformLogicalXor, GetNewId(), resultType);
4536  
4537              result.AddOperand(execution);
4538              result.AddOperand(operation);
4539              result.AddOperand(value);
4540              if (clusterSize != null)
4541              {
4542                  result.AddOperand(clusterSize);
4543              }
4544              AddToFunctionDefinitions(result);
4545  
4546              return result;
4547          }
4548  
4549          public Instruction GroupNonUniformQuadBroadcast(Instruction resultType, Instruction execution, Instruction value, Instruction index)
4550          {
4551              Instruction result = NewInstruction(Op.OpGroupNonUniformQuadBroadcast, GetNewId(), resultType);
4552  
4553              result.AddOperand(execution);
4554              result.AddOperand(value);
4555              result.AddOperand(index);
4556              AddToFunctionDefinitions(result);
4557  
4558              return result;
4559          }
4560  
4561          public Instruction GroupNonUniformQuadSwap(Instruction resultType, Instruction execution, Instruction value, Instruction direction)
4562          {
4563              Instruction result = NewInstruction(Op.OpGroupNonUniformQuadSwap, GetNewId(), resultType);
4564  
4565              result.AddOperand(execution);
4566              result.AddOperand(value);
4567              result.AddOperand(direction);
4568              AddToFunctionDefinitions(result);
4569  
4570              return result;
4571          }
4572  
4573          public Instruction GroupNonUniformPartitionNV(Instruction resultType, Instruction value)
4574          {
4575              Instruction result = NewInstruction(Op.OpGroupNonUniformPartitionNV, GetNewId(), resultType);
4576  
4577              result.AddOperand(value);
4578              AddToFunctionDefinitions(result);
4579  
4580              return result;
4581          }
4582  
4583          // Reserved
4584  
4585          public Instruction TraceRayKHR(Instruction accel, Instruction rayFlags, Instruction cullMask, Instruction sBTOffset, Instruction sBTStride, Instruction missIndex, Instruction rayOrigin, Instruction rayTmin, Instruction rayDirection, Instruction rayTmax, Instruction payload)
4586          {
4587              Instruction result = NewInstruction(Op.OpTraceRayKHR);
4588  
4589              result.AddOperand(accel);
4590              result.AddOperand(rayFlags);
4591              result.AddOperand(cullMask);
4592              result.AddOperand(sBTOffset);
4593              result.AddOperand(sBTStride);
4594              result.AddOperand(missIndex);
4595              result.AddOperand(rayOrigin);
4596              result.AddOperand(rayTmin);
4597              result.AddOperand(rayDirection);
4598              result.AddOperand(rayTmax);
4599              result.AddOperand(payload);
4600              AddToFunctionDefinitions(result);
4601  
4602              return result;
4603          }
4604  
4605          public Instruction ExecuteCallableKHR(Instruction sBTIndex, Instruction callableData)
4606          {
4607              Instruction result = NewInstruction(Op.OpExecuteCallableKHR);
4608  
4609              result.AddOperand(sBTIndex);
4610              result.AddOperand(callableData);
4611              AddToFunctionDefinitions(result);
4612  
4613              return result;
4614          }
4615  
4616          public Instruction ConvertUToAccelerationStructureKHR(Instruction resultType, Instruction accel)
4617          {
4618              Instruction result = NewInstruction(Op.OpConvertUToAccelerationStructureKHR, GetNewId(), resultType);
4619  
4620              result.AddOperand(accel);
4621              AddToFunctionDefinitions(result);
4622  
4623              return result;
4624          }
4625  
4626          public Instruction IgnoreIntersectionKHR()
4627          {
4628              Instruction result = NewInstruction(Op.OpIgnoreIntersectionKHR);
4629  
4630              AddToFunctionDefinitions(result);
4631  
4632              return result;
4633          }
4634  
4635          public Instruction TerminateRayKHR()
4636          {
4637              Instruction result = NewInstruction(Op.OpTerminateRayKHR);
4638  
4639              AddToFunctionDefinitions(result);
4640  
4641              return result;
4642          }
4643  
4644          public Instruction TypeRayQueryKHR()
4645          {
4646              Instruction result = NewInstruction(Op.OpTypeRayQueryKHR, GetNewId());
4647  
4648              AddToFunctionDefinitions(result);
4649  
4650              return result;
4651          }
4652  
4653          public Instruction RayQueryInitializeKHR(Instruction rayQuery, Instruction accel, Instruction rayFlags, Instruction cullMask, Instruction rayOrigin, Instruction rayTMin, Instruction rayDirection, Instruction rayTMax)
4654          {
4655              Instruction result = NewInstruction(Op.OpRayQueryInitializeKHR);
4656  
4657              result.AddOperand(rayQuery);
4658              result.AddOperand(accel);
4659              result.AddOperand(rayFlags);
4660              result.AddOperand(cullMask);
4661              result.AddOperand(rayOrigin);
4662              result.AddOperand(rayTMin);
4663              result.AddOperand(rayDirection);
4664              result.AddOperand(rayTMax);
4665              AddToFunctionDefinitions(result);
4666  
4667              return result;
4668          }
4669  
4670          public Instruction RayQueryTerminateKHR(Instruction rayQuery)
4671          {
4672              Instruction result = NewInstruction(Op.OpRayQueryTerminateKHR);
4673  
4674              result.AddOperand(rayQuery);
4675              AddToFunctionDefinitions(result);
4676  
4677              return result;
4678          }
4679  
4680          public Instruction RayQueryGenerateIntersectionKHR(Instruction rayQuery, Instruction hitT)
4681          {
4682              Instruction result = NewInstruction(Op.OpRayQueryGenerateIntersectionKHR);
4683  
4684              result.AddOperand(rayQuery);
4685              result.AddOperand(hitT);
4686              AddToFunctionDefinitions(result);
4687  
4688              return result;
4689          }
4690  
4691          public Instruction RayQueryConfirmIntersectionKHR(Instruction rayQuery)
4692          {
4693              Instruction result = NewInstruction(Op.OpRayQueryConfirmIntersectionKHR);
4694  
4695              result.AddOperand(rayQuery);
4696              AddToFunctionDefinitions(result);
4697  
4698              return result;
4699          }
4700  
4701          public Instruction RayQueryProceedKHR(Instruction resultType, Instruction rayQuery)
4702          {
4703              Instruction result = NewInstruction(Op.OpRayQueryProceedKHR, GetNewId(), resultType);
4704  
4705              result.AddOperand(rayQuery);
4706              AddToFunctionDefinitions(result);
4707  
4708              return result;
4709          }
4710  
4711          public Instruction RayQueryGetIntersectionTypeKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
4712          {
4713              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionTypeKHR, GetNewId(), resultType);
4714  
4715              result.AddOperand(rayQuery);
4716              result.AddOperand(intersection);
4717              AddToFunctionDefinitions(result);
4718  
4719              return result;
4720          }
4721  
4722          public Instruction FragmentMaskFetchAMD(Instruction resultType, Instruction image, Instruction coordinate)
4723          {
4724              Instruction result = NewInstruction(Op.OpFragmentMaskFetchAMD, GetNewId(), resultType);
4725  
4726              result.AddOperand(image);
4727              result.AddOperand(coordinate);
4728              AddToFunctionDefinitions(result);
4729  
4730              return result;
4731          }
4732  
4733          public Instruction FragmentFetchAMD(Instruction resultType, Instruction image, Instruction coordinate, Instruction fragmentIndex)
4734          {
4735              Instruction result = NewInstruction(Op.OpFragmentFetchAMD, GetNewId(), resultType);
4736  
4737              result.AddOperand(image);
4738              result.AddOperand(coordinate);
4739              result.AddOperand(fragmentIndex);
4740              AddToFunctionDefinitions(result);
4741  
4742              return result;
4743          }
4744  
4745          public Instruction ReadClockKHR(Instruction resultType, Instruction execution)
4746          {
4747              Instruction result = NewInstruction(Op.OpReadClockKHR, GetNewId(), resultType);
4748  
4749              result.AddOperand(execution);
4750              AddToFunctionDefinitions(result);
4751  
4752              return result;
4753          }
4754  
4755          public Instruction WritePackedPrimitiveIndices4x8NV(Instruction indexOffset, Instruction packedIndices)
4756          {
4757              Instruction result = NewInstruction(Op.OpWritePackedPrimitiveIndices4x8NV);
4758  
4759              result.AddOperand(indexOffset);
4760              result.AddOperand(packedIndices);
4761              AddToFunctionDefinitions(result);
4762  
4763              return result;
4764          }
4765  
4766          public Instruction ReportIntersectionNV(Instruction resultType, Instruction hit, Instruction hitKind)
4767          {
4768              Instruction result = NewInstruction(Op.OpReportIntersectionNV, GetNewId(), resultType);
4769  
4770              result.AddOperand(hit);
4771              result.AddOperand(hitKind);
4772              AddToFunctionDefinitions(result);
4773  
4774              return result;
4775          }
4776  
4777          public Instruction ReportIntersectionKHR(Instruction resultType, Instruction hit, Instruction hitKind)
4778          {
4779              Instruction result = NewInstruction(Op.OpReportIntersectionKHR, GetNewId(), resultType);
4780  
4781              result.AddOperand(hit);
4782              result.AddOperand(hitKind);
4783              AddToFunctionDefinitions(result);
4784  
4785              return result;
4786          }
4787  
4788          public Instruction IgnoreIntersectionNV()
4789          {
4790              Instruction result = NewInstruction(Op.OpIgnoreIntersectionNV);
4791  
4792              AddToFunctionDefinitions(result);
4793  
4794              return result;
4795          }
4796  
4797          public Instruction TerminateRayNV()
4798          {
4799              Instruction result = NewInstruction(Op.OpTerminateRayNV);
4800  
4801              AddToFunctionDefinitions(result);
4802  
4803              return result;
4804          }
4805  
4806          public Instruction TraceNV(Instruction accel, Instruction rayFlags, Instruction cullMask, Instruction sBTOffset, Instruction sBTStride, Instruction missIndex, Instruction rayOrigin, Instruction rayTmin, Instruction rayDirection, Instruction rayTmax, Instruction payloadId)
4807          {
4808              Instruction result = NewInstruction(Op.OpTraceNV);
4809  
4810              result.AddOperand(accel);
4811              result.AddOperand(rayFlags);
4812              result.AddOperand(cullMask);
4813              result.AddOperand(sBTOffset);
4814              result.AddOperand(sBTStride);
4815              result.AddOperand(missIndex);
4816              result.AddOperand(rayOrigin);
4817              result.AddOperand(rayTmin);
4818              result.AddOperand(rayDirection);
4819              result.AddOperand(rayTmax);
4820              result.AddOperand(payloadId);
4821              AddToFunctionDefinitions(result);
4822  
4823              return result;
4824          }
4825  
4826          public Instruction TypeAccelerationStructureNV()
4827          {
4828              Instruction result = NewInstruction(Op.OpTypeAccelerationStructureNV, GetNewId());
4829  
4830              AddToFunctionDefinitions(result);
4831  
4832              return result;
4833          }
4834  
4835          public Instruction TypeAccelerationStructureKHR()
4836          {
4837              Instruction result = NewInstruction(Op.OpTypeAccelerationStructureKHR, GetNewId());
4838  
4839              AddToFunctionDefinitions(result);
4840  
4841              return result;
4842          }
4843  
4844          public Instruction ExecuteCallableNV(Instruction sBTIndex, Instruction callableDataId)
4845          {
4846              Instruction result = NewInstruction(Op.OpExecuteCallableNV);
4847  
4848              result.AddOperand(sBTIndex);
4849              result.AddOperand(callableDataId);
4850              AddToFunctionDefinitions(result);
4851  
4852              return result;
4853          }
4854  
4855          public Instruction TypeCooperativeMatrixNV(Instruction componentType, Instruction execution, Instruction rows, Instruction columns)
4856          {
4857              Instruction result = NewInstruction(Op.OpTypeCooperativeMatrixNV, GetNewId());
4858  
4859              result.AddOperand(componentType);
4860              result.AddOperand(execution);
4861              result.AddOperand(rows);
4862              result.AddOperand(columns);
4863              AddToFunctionDefinitions(result);
4864  
4865              return result;
4866          }
4867  
4868          public Instruction CooperativeMatrixLoadNV(Instruction resultType, Instruction pointer, Instruction stride, Instruction columnMajor, MemoryAccessMask memoryAccess = (MemoryAccessMask)int.MaxValue)
4869          {
4870              Instruction result = NewInstruction(Op.OpCooperativeMatrixLoadNV, GetNewId(), resultType);
4871  
4872              result.AddOperand(pointer);
4873              result.AddOperand(stride);
4874              result.AddOperand(columnMajor);
4875              if (memoryAccess != (MemoryAccessMask)int.MaxValue)
4876              {
4877                  result.AddOperand(memoryAccess);
4878              }
4879              AddToFunctionDefinitions(result);
4880  
4881              return result;
4882          }
4883  
4884          public Instruction CooperativeMatrixStoreNV(Instruction pointer, Instruction obj, Instruction stride, Instruction columnMajor, MemoryAccessMask memoryAccess = (MemoryAccessMask)int.MaxValue)
4885          {
4886              Instruction result = NewInstruction(Op.OpCooperativeMatrixStoreNV);
4887  
4888              result.AddOperand(pointer);
4889              result.AddOperand(obj);
4890              result.AddOperand(stride);
4891              result.AddOperand(columnMajor);
4892              if (memoryAccess != (MemoryAccessMask)int.MaxValue)
4893              {
4894                  result.AddOperand(memoryAccess);
4895              }
4896              AddToFunctionDefinitions(result);
4897  
4898              return result;
4899          }
4900  
4901          public Instruction CooperativeMatrixMulAddNV(Instruction resultType, Instruction a, Instruction b, Instruction c)
4902          {
4903              Instruction result = NewInstruction(Op.OpCooperativeMatrixMulAddNV, GetNewId(), resultType);
4904  
4905              result.AddOperand(a);
4906              result.AddOperand(b);
4907              result.AddOperand(c);
4908              AddToFunctionDefinitions(result);
4909  
4910              return result;
4911          }
4912  
4913          public Instruction CooperativeMatrixLengthNV(Instruction resultType, Instruction type)
4914          {
4915              Instruction result = NewInstruction(Op.OpCooperativeMatrixLengthNV, GetNewId(), resultType);
4916  
4917              result.AddOperand(type);
4918              AddToFunctionDefinitions(result);
4919  
4920              return result;
4921          }
4922  
4923          public Instruction BeginInvocationInterlockEXT()
4924          {
4925              Instruction result = NewInstruction(Op.OpBeginInvocationInterlockEXT);
4926  
4927              AddToFunctionDefinitions(result);
4928  
4929              return result;
4930          }
4931  
4932          public Instruction EndInvocationInterlockEXT()
4933          {
4934              Instruction result = NewInstruction(Op.OpEndInvocationInterlockEXT);
4935  
4936              AddToFunctionDefinitions(result);
4937  
4938              return result;
4939          }
4940  
4941          public Instruction DemoteToHelperInvocationEXT()
4942          {
4943              Instruction result = NewInstruction(Op.OpDemoteToHelperInvocationEXT);
4944  
4945              AddToFunctionDefinitions(result);
4946  
4947              return result;
4948          }
4949  
4950          public Instruction IsHelperInvocationEXT(Instruction resultType)
4951          {
4952              Instruction result = NewInstruction(Op.OpIsHelperInvocationEXT, GetNewId(), resultType);
4953  
4954              AddToFunctionDefinitions(result);
4955  
4956              return result;
4957          }
4958  
4959          public Instruction UCountLeadingZerosINTEL(Instruction resultType, Instruction operand)
4960          {
4961              Instruction result = NewInstruction(Op.OpUCountLeadingZerosINTEL, GetNewId(), resultType);
4962  
4963              result.AddOperand(operand);
4964              AddToFunctionDefinitions(result);
4965  
4966              return result;
4967          }
4968  
4969          public Instruction UCountTrailingZerosINTEL(Instruction resultType, Instruction operand)
4970          {
4971              Instruction result = NewInstruction(Op.OpUCountTrailingZerosINTEL, GetNewId(), resultType);
4972  
4973              result.AddOperand(operand);
4974              AddToFunctionDefinitions(result);
4975  
4976              return result;
4977          }
4978  
4979          public Instruction AbsISubINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
4980          {
4981              Instruction result = NewInstruction(Op.OpAbsISubINTEL, GetNewId(), resultType);
4982  
4983              result.AddOperand(operand1);
4984              result.AddOperand(operand2);
4985              AddToFunctionDefinitions(result);
4986  
4987              return result;
4988          }
4989  
4990          public Instruction AbsUSubINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
4991          {
4992              Instruction result = NewInstruction(Op.OpAbsUSubINTEL, GetNewId(), resultType);
4993  
4994              result.AddOperand(operand1);
4995              result.AddOperand(operand2);
4996              AddToFunctionDefinitions(result);
4997  
4998              return result;
4999          }
5000  
5001          public Instruction IAddSatINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5002          {
5003              Instruction result = NewInstruction(Op.OpIAddSatINTEL, GetNewId(), resultType);
5004  
5005              result.AddOperand(operand1);
5006              result.AddOperand(operand2);
5007              AddToFunctionDefinitions(result);
5008  
5009              return result;
5010          }
5011  
5012          public Instruction UAddSatINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5013          {
5014              Instruction result = NewInstruction(Op.OpUAddSatINTEL, GetNewId(), resultType);
5015  
5016              result.AddOperand(operand1);
5017              result.AddOperand(operand2);
5018              AddToFunctionDefinitions(result);
5019  
5020              return result;
5021          }
5022  
5023          public Instruction IAverageINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5024          {
5025              Instruction result = NewInstruction(Op.OpIAverageINTEL, GetNewId(), resultType);
5026  
5027              result.AddOperand(operand1);
5028              result.AddOperand(operand2);
5029              AddToFunctionDefinitions(result);
5030  
5031              return result;
5032          }
5033  
5034          public Instruction UAverageINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5035          {
5036              Instruction result = NewInstruction(Op.OpUAverageINTEL, GetNewId(), resultType);
5037  
5038              result.AddOperand(operand1);
5039              result.AddOperand(operand2);
5040              AddToFunctionDefinitions(result);
5041  
5042              return result;
5043          }
5044  
5045          public Instruction IAverageRoundedINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5046          {
5047              Instruction result = NewInstruction(Op.OpIAverageRoundedINTEL, GetNewId(), resultType);
5048  
5049              result.AddOperand(operand1);
5050              result.AddOperand(operand2);
5051              AddToFunctionDefinitions(result);
5052  
5053              return result;
5054          }
5055  
5056          public Instruction UAverageRoundedINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5057          {
5058              Instruction result = NewInstruction(Op.OpUAverageRoundedINTEL, GetNewId(), resultType);
5059  
5060              result.AddOperand(operand1);
5061              result.AddOperand(operand2);
5062              AddToFunctionDefinitions(result);
5063  
5064              return result;
5065          }
5066  
5067          public Instruction ISubSatINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5068          {
5069              Instruction result = NewInstruction(Op.OpISubSatINTEL, GetNewId(), resultType);
5070  
5071              result.AddOperand(operand1);
5072              result.AddOperand(operand2);
5073              AddToFunctionDefinitions(result);
5074  
5075              return result;
5076          }
5077  
5078          public Instruction USubSatINTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5079          {
5080              Instruction result = NewInstruction(Op.OpUSubSatINTEL, GetNewId(), resultType);
5081  
5082              result.AddOperand(operand1);
5083              result.AddOperand(operand2);
5084              AddToFunctionDefinitions(result);
5085  
5086              return result;
5087          }
5088  
5089          public Instruction IMul32x16INTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5090          {
5091              Instruction result = NewInstruction(Op.OpIMul32x16INTEL, GetNewId(), resultType);
5092  
5093              result.AddOperand(operand1);
5094              result.AddOperand(operand2);
5095              AddToFunctionDefinitions(result);
5096  
5097              return result;
5098          }
5099  
5100          public Instruction UMul32x16INTEL(Instruction resultType, Instruction operand1, Instruction operand2)
5101          {
5102              Instruction result = NewInstruction(Op.OpUMul32x16INTEL, GetNewId(), resultType);
5103  
5104              result.AddOperand(operand1);
5105              result.AddOperand(operand2);
5106              AddToFunctionDefinitions(result);
5107  
5108              return result;
5109          }
5110  
5111          public Instruction LoopControlINTEL(params LiteralInteger[] loopControlParameters)
5112          {
5113              Instruction result = NewInstruction(Op.OpLoopControlINTEL);
5114  
5115              result.AddOperand(loopControlParameters);
5116              AddToFunctionDefinitions(result);
5117  
5118              return result;
5119          }
5120  
5121          public Instruction FPGARegINTEL(Instruction resultType, Instruction resultObj, Instruction input)
5122          {
5123              Instruction result = NewInstruction(Op.OpFPGARegINTEL, GetNewId(), resultType);
5124  
5125              result.AddOperand(resultObj);
5126              result.AddOperand(input);
5127              AddToFunctionDefinitions(result);
5128  
5129              return result;
5130          }
5131  
5132          public Instruction RayQueryGetRayTMinKHR(Instruction resultType, Instruction rayQuery)
5133          {
5134              Instruction result = NewInstruction(Op.OpRayQueryGetRayTMinKHR, GetNewId(), resultType);
5135  
5136              result.AddOperand(rayQuery);
5137              AddToFunctionDefinitions(result);
5138  
5139              return result;
5140          }
5141  
5142          public Instruction RayQueryGetRayFlagsKHR(Instruction resultType, Instruction rayQuery)
5143          {
5144              Instruction result = NewInstruction(Op.OpRayQueryGetRayFlagsKHR, GetNewId(), resultType);
5145  
5146              result.AddOperand(rayQuery);
5147              AddToFunctionDefinitions(result);
5148  
5149              return result;
5150          }
5151  
5152          public Instruction RayQueryGetIntersectionTKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5153          {
5154              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionTKHR, GetNewId(), resultType);
5155  
5156              result.AddOperand(rayQuery);
5157              result.AddOperand(intersection);
5158              AddToFunctionDefinitions(result);
5159  
5160              return result;
5161          }
5162  
5163          public Instruction RayQueryGetIntersectionInstanceCustomIndexKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5164          {
5165              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionInstanceCustomIndexKHR, GetNewId(), resultType);
5166  
5167              result.AddOperand(rayQuery);
5168              result.AddOperand(intersection);
5169              AddToFunctionDefinitions(result);
5170  
5171              return result;
5172          }
5173  
5174          public Instruction RayQueryGetIntersectionInstanceIdKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5175          {
5176              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionInstanceIdKHR, GetNewId(), resultType);
5177  
5178              result.AddOperand(rayQuery);
5179              result.AddOperand(intersection);
5180              AddToFunctionDefinitions(result);
5181  
5182              return result;
5183          }
5184  
5185          public Instruction RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5186          {
5187              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR, GetNewId(), resultType);
5188  
5189              result.AddOperand(rayQuery);
5190              result.AddOperand(intersection);
5191              AddToFunctionDefinitions(result);
5192  
5193              return result;
5194          }
5195  
5196          public Instruction RayQueryGetIntersectionGeometryIndexKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5197          {
5198              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionGeometryIndexKHR, GetNewId(), resultType);
5199  
5200              result.AddOperand(rayQuery);
5201              result.AddOperand(intersection);
5202              AddToFunctionDefinitions(result);
5203  
5204              return result;
5205          }
5206  
5207          public Instruction RayQueryGetIntersectionPrimitiveIndexKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5208          {
5209              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionPrimitiveIndexKHR, GetNewId(), resultType);
5210  
5211              result.AddOperand(rayQuery);
5212              result.AddOperand(intersection);
5213              AddToFunctionDefinitions(result);
5214  
5215              return result;
5216          }
5217  
5218          public Instruction RayQueryGetIntersectionBarycentricsKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5219          {
5220              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionBarycentricsKHR, GetNewId(), resultType);
5221  
5222              result.AddOperand(rayQuery);
5223              result.AddOperand(intersection);
5224              AddToFunctionDefinitions(result);
5225  
5226              return result;
5227          }
5228  
5229          public Instruction RayQueryGetIntersectionFrontFaceKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5230          {
5231              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionFrontFaceKHR, GetNewId(), resultType);
5232  
5233              result.AddOperand(rayQuery);
5234              result.AddOperand(intersection);
5235              AddToFunctionDefinitions(result);
5236  
5237              return result;
5238          }
5239  
5240          public Instruction RayQueryGetIntersectionCandidateAABBOpaqueKHR(Instruction resultType, Instruction rayQuery)
5241          {
5242              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionCandidateAABBOpaqueKHR, GetNewId(), resultType);
5243  
5244              result.AddOperand(rayQuery);
5245              AddToFunctionDefinitions(result);
5246  
5247              return result;
5248          }
5249  
5250          public Instruction RayQueryGetIntersectionObjectRayDirectionKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5251          {
5252              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionObjectRayDirectionKHR, GetNewId(), resultType);
5253  
5254              result.AddOperand(rayQuery);
5255              result.AddOperand(intersection);
5256              AddToFunctionDefinitions(result);
5257  
5258              return result;
5259          }
5260  
5261          public Instruction RayQueryGetIntersectionObjectRayOriginKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5262          {
5263              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionObjectRayOriginKHR, GetNewId(), resultType);
5264  
5265              result.AddOperand(rayQuery);
5266              result.AddOperand(intersection);
5267              AddToFunctionDefinitions(result);
5268  
5269              return result;
5270          }
5271  
5272          public Instruction RayQueryGetWorldRayDirectionKHR(Instruction resultType, Instruction rayQuery)
5273          {
5274              Instruction result = NewInstruction(Op.OpRayQueryGetWorldRayDirectionKHR, GetNewId(), resultType);
5275  
5276              result.AddOperand(rayQuery);
5277              AddToFunctionDefinitions(result);
5278  
5279              return result;
5280          }
5281  
5282          public Instruction RayQueryGetWorldRayOriginKHR(Instruction resultType, Instruction rayQuery)
5283          {
5284              Instruction result = NewInstruction(Op.OpRayQueryGetWorldRayOriginKHR, GetNewId(), resultType);
5285  
5286              result.AddOperand(rayQuery);
5287              AddToFunctionDefinitions(result);
5288  
5289              return result;
5290          }
5291  
5292          public Instruction RayQueryGetIntersectionObjectToWorldKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5293          {
5294              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionObjectToWorldKHR, GetNewId(), resultType);
5295  
5296              result.AddOperand(rayQuery);
5297              result.AddOperand(intersection);
5298              AddToFunctionDefinitions(result);
5299  
5300              return result;
5301          }
5302  
5303          public Instruction RayQueryGetIntersectionWorldToObjectKHR(Instruction resultType, Instruction rayQuery, Instruction intersection)
5304          {
5305              Instruction result = NewInstruction(Op.OpRayQueryGetIntersectionWorldToObjectKHR, GetNewId(), resultType);
5306  
5307              result.AddOperand(rayQuery);
5308              result.AddOperand(intersection);
5309              AddToFunctionDefinitions(result);
5310  
5311              return result;
5312          }
5313  
5314      }
5315  }