Skip to content

Commit d9ffe1f

Browse files
committed
Add intrinsics for bindless buffers support
write_predef_surface is main intrinsic to initialize %bss. Other intrinsics are duplicates of original intrinsics with ability to work with %bss variable.
1 parent 6d29de3 commit d9ffe1f

File tree

1 file changed

+303
-1
lines changed

1 file changed

+303
-1
lines changed

GenXIntrinsics/include/llvm/GenXIntrinsics/Intrinsic_definitions.py

Lines changed: 303 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4619,5 +4619,307 @@
46194619
"jump_table" : { "result" : "anyptr",
46204620
"arguments" : ["anyint", "vararg"],
46214621
"attributes" : "NoMem"
4622-
}
4622+
},
4623+
4624+
## ``llvm.genx.write.predef.surface`` : write predefined surface variable
4625+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4626+
##
4627+
## * arg0: ptr predefined surface variable
4628+
## * arg1: i32 value to write
4629+
##
4630+
## This corresponds to MOVS visa instruction and utilizes technique of using
4631+
## global variable in LLVM IR for predefined surfaces.
4632+
##
4633+
"write_predef_surface" : { "result": "void",
4634+
"arguments" : ["anyptr", "int"],
4635+
"attributes" : "WriteMem",
4636+
},
4637+
4638+
## Internal VC memory intrinsics.
4639+
## These versions are supposed to use predefined visa variables like %bss.
4640+
## Intrinsics are supposed to be internal to VC backend.
4641+
4642+
## ``llvm.genx.dword.atomic2.*.predef.surface`` : dword atomic with binary operator with predefined surface
4643+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4644+
## * ``llvm.genx.dword.atomic2.add.predef.surface`` : vISA DWORD_ATOMIC ADD instruction
4645+
## * ``llvm.genx.dword.atomic2.sub.predef.surface`` : vISA DWORD_ATOMIC SUB instruction
4646+
## * ``llvm.genx.dword.atomic2.min.predef.surface`` : vISA DWORD_ATOMIC MIN instruction
4647+
## * ``llvm.genx.dword.atomic2.max.predef.surface`` : vISA DWORD_ATOMIC MAX instruction
4648+
## * ``llvm.genx.dword.atomic2.xchg.predef.surface`` : vISA DWORD_ATOMIC XCHG instruction
4649+
## * ``llvm.genx.dword.atomic2.and.predef.surface`` : vISA DWORD_ATOMIC AND instruction
4650+
## * ``llvm.genx.dword.atomic2.or.predef.surface`` : vISA DWORD_ATOMIC OR instruction
4651+
## * ``llvm.genx.dword.atomic2.xor.predef.surface`` : vISA DWORD_ATOMIC XOR instruction
4652+
## * ``llvm.genx.dword.atomic2.imin.predef.surface`` : vISA DWORD_ATOMIC IMIN instruction
4653+
## * ``llvm.genx.dword.atomic2.imax.predef.surface`` : vISA DWORD_ATOMIC IMAX instruction
4654+
##
4655+
## * (Exec_size inferred from element offset type)
4656+
## * arg0: vXi1 predicate (overloaded)
4657+
## * arg1: ptr predefined surface (overloaded)
4658+
## * arg2: vXi32 element offset in bytes (overloaded)
4659+
## * arg3: vXi32 src
4660+
##
4661+
## * Return value: vXi32 the old value read
4662+
##
4663+
## Predicate, element offset, src, and the return value must all have the
4664+
## same vector width, which must be 1, 8 or 16.
4665+
##
4666+
"dword_atomic2_add_predef_surface" : { "result" : "anyvector",
4667+
"arguments" : ["anyvector","anyptr","anyint",0],
4668+
"attributes" : "None",
4669+
},
4670+
"dword_atomic2_sub_predef_surface" : { "result" : "anyvector",
4671+
"arguments" : ["anyvector","anyptr","anyint",0],
4672+
"attributes" : "None",
4673+
},
4674+
"dword_atomic2_min_predef_surface" : { "result" : "anyvector",
4675+
"arguments" : ["anyvector","anyptr","anyint",0],
4676+
"attributes" : "None",
4677+
},
4678+
"dword_atomic2_max_predef_surface" : { "result" : "anyvector",
4679+
"arguments" : ["anyvector","anyptr","anyint",0],
4680+
"attributes" : "None",
4681+
},
4682+
"dword_atomic2_xchg_predef_surface" : { "result" : "anyvector",
4683+
"arguments" : ["anyvector","anyptr","anyint",0],
4684+
"attributes" : "None",
4685+
},
4686+
"dword_atomic2_and_predef_surface" : { "result" : "anyvector",
4687+
"arguments" : ["anyvector","anyptr","anyint",0],
4688+
"attributes" : "None",
4689+
},
4690+
"dword_atomic2_or_predef_surface" : { "result" : "anyvector",
4691+
"arguments" : ["anyvector","anyptr","anyint",0],
4692+
"attributes" : "None",
4693+
},
4694+
"dword_atomic2_xor_predef_surface" : { "result" : "anyvector",
4695+
"arguments" : ["anyvector","anyptr","anyint",0],
4696+
"attributes" : "None",
4697+
},
4698+
"dword_atomic2_imin_predef_surface" : { "result" : "anyvector",
4699+
"arguments" : ["anyvector","anyptr","anyint",0],
4700+
"attributes" : "None",
4701+
},
4702+
"dword_atomic2_imax_predef_surface" : { "result" : "anyvector",
4703+
"arguments" : ["anyvector","anyptr","anyint",0],
4704+
"attributes" : "None",
4705+
},
4706+
4707+
## ``llvm.genx.dword.atomic2.*.predef.surface`` : dword atomic with fmin/fmax operation with predefined surface
4708+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4709+
## * ``llvm.genx.dword.atomic2.fmin.predef.surface`` : vISA DWORD_ATOMIC FMIN instruction
4710+
## * ``llvm.genx.dword.atomic2.fmax.predef.surface`` : vISA DWORD_ATOMIC FMAX instruction
4711+
##
4712+
## * (Exec_size inferred from element offset type)
4713+
## * arg0: vXi1 predicate (overloaded)
4714+
## * arg1: ptr predefined surface (overloaded)
4715+
## * arg2: vXi32 element offset in bytes (overloaded)
4716+
## * arg3: vXfloat src
4717+
##
4718+
## * Return value: vXfloat the old value read
4719+
##
4720+
## Predicate, element offset, src, and the return value must all have the
4721+
## same vector width, which must be 1, 8 or 16.
4722+
##
4723+
"dword_atomic2_fmin_predef_surface" : { "result" : "anyvector",
4724+
"arguments" : ["anyvector","anyptr","anyint",0],
4725+
"attributes" : "None",
4726+
},
4727+
"dword_atomic2_fmax_predef_surface" : { "result" : "anyvector",
4728+
"arguments" : ["anyvector","anyptr","anyint",0],
4729+
"attributes" : "None",
4730+
},
4731+
4732+
## ``llvm.genx.dword.atomic2.*.predef.surface`` : dword atomic with inc/dec operation with predefined surface
4733+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4734+
## * ``llvm.genx.dword.atomic2.inc.predef.surface`` : vISA DWORD_ATOMIC INC instruction
4735+
## * ``llvm.genx.dword.atomic2.dec.predef.surface`` : vISA DWORD_ATOMIC DEC instruction
4736+
##
4737+
## * (Exec_size inferred from element offset type)
4738+
## * arg0: vXi1 predicate (overloaded)
4739+
## * arg1: ptr predefined surface (overloaded)
4740+
## * arg2: vXi32 element offset in bytes (overloaded)
4741+
##
4742+
## * Return value: vXi32 the old value read
4743+
##
4744+
## Predicate, element offset, src, and the return value must all have the
4745+
## same vector width, which must be 1, 8 or 16.
4746+
##
4747+
"dword_atomic2_inc_predef_surface" : { "result" : "anyvector",
4748+
"arguments" : ["anyvector","anyptr","anyint"],
4749+
"attributes" : "None",
4750+
},
4751+
"dword_atomic2_dec_predef_surface" : { "result" : "anyvector",
4752+
"arguments" : ["anyvector","anyptr","anyint"],
4753+
"attributes" : "None",
4754+
},
4755+
4756+
## ``llvm.genx.dword.atomic2.cmpxchg.predef.surface`` : vISA DWORD_ATOMIC CMPXCHG instruction with predefined surface
4757+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4758+
##
4759+
## * (Exec_size inferred from element offset type)
4760+
## * arg0: vXi1 predicate (overloaded)
4761+
## * arg1: ptr predefined surface (overloaded)
4762+
## * arg2: vXi32 element offset in bytes (overloaded)
4763+
## * arg3: vXi32 src0
4764+
## * arg4: vXi32 src1
4765+
##
4766+
## * Return value: vXi32 the old value read
4767+
##
4768+
## Predicate, element offset, src, and the return value must all have the
4769+
## same vector width, which must be 1, 8 or 16.
4770+
##
4771+
"dword_atomic2_cmpxchg_predef_surface" : { "result" : "anyvector",
4772+
"arguments" : ["anyvector","anyptr","anyint",0,0],
4773+
"attributes" : "None",
4774+
},
4775+
4776+
## ``llvm.genx.dword.atomic2.fcmpwr.predef.surface`` : vISA DWORD_ATOMIC FCMPWR instruction with predefined surface
4777+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4778+
##
4779+
## * (Exec_size inferred from element offset type)
4780+
## * arg0: vXi1 predicate (overloaded)
4781+
## * arg1: ptr predefined surface (overloaded)
4782+
## * arg2: vXi32 element offset in bytes (overloaded)
4783+
## * arg3: vXfloat src0
4784+
## * arg4: vXfloat src1
4785+
##
4786+
## * Return value: vXfloat the old value read
4787+
##
4788+
## Predicate, element offset, src, and the return value must all have the
4789+
## same vector width, which must be 1, 8 or 16.
4790+
##
4791+
"dword_atomic2_fcmpwr_predef_surface" : { "result" : "anyvector",
4792+
"arguments" : ["anyvector","anyptr","anyint",0,0],
4793+
"attributes" : "None",
4794+
},
4795+
4796+
## ``llvm.genx.gather.masked.scaled2.predef.surface`` : vISA GATHER_SCALED instruction with predefined surface
4797+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4798+
##
4799+
## * (Exec_size inferred from element offset type)
4800+
## * arg0: i32 log2 num blocks, constant (0/1/2 for num blocks 1/2/4)
4801+
## * arg1: i16 scale, constant
4802+
## * arg2: ptr predefined surface (overloaded)
4803+
## * arg3: i32 global offset in bytes
4804+
## * arg4: vXi32 element offset in bytes (overloaded)
4805+
## * arg5: vXi1 predicate (overloaded)
4806+
##
4807+
## * Return value: vXi32/float the data read
4808+
##
4809+
"gather_masked_scaled2_predef_surface" : { "result" : "anyvector",
4810+
"arguments" : ["int","short","anyptr","int","anyint","anyvector"],
4811+
"attributes" : "ReadMem",
4812+
},
4813+
4814+
## ``llvm.genx.gather4.masked.scaled2.predef.surface`` : vISA GATHER4_SCALED instruction with predefined surface
4815+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4816+
##
4817+
## * (Exec_size inferred from element offset type)
4818+
## * arg0: i32 channel mask, constant
4819+
## * arg1: i16 scale, constant
4820+
## * arg2: ptr predefined surface (overloaded)
4821+
## * arg3: i32 global offset in bytes
4822+
## * arg4: vXi32 element offset in bytes
4823+
## * arg5: vXi1 predicate (overloaded)
4824+
##
4825+
## * Return value: vXi32/float the data read
4826+
##
4827+
"gather4_masked_scaled2_predef_surface" : { "result" : "anyvector",
4828+
"arguments" : ["int","short","anyptr","int","anyint","anyvector"],
4829+
"attributes" : "ReadMem",
4830+
},
4831+
4832+
## ``llvm.genx.scatter.scaled.predef.surface`` : vISA SCATTER_SCALED instruction with predefined surface
4833+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4834+
##
4835+
## * (Exec_size inferred from element offset type)
4836+
## * arg0: vXi1 predicate (overloaded)
4837+
## * arg1: i32 log2 num blocks, constant (0/1/2 for num blocks 1/2/4)
4838+
## * arg2: i16 scale, constant
4839+
## * arg3: ptr predefined surface (overloaded)
4840+
## * arg4: i32 global offset in bytes
4841+
## * arg5: vXi32 element offset (overloaded)
4842+
## * arg6: data to write (overloaded)
4843+
##
4844+
## The vector width of the element offset arg is the number of elements to
4845+
## write, which must be power of 2 and less than or equal to 32.
4846+
##
4847+
## The predicate arg must have the same vector width.
4848+
##
4849+
## The data type to write must have UD, D or F type. For 1 and 2 byte (1 x num
4850+
## blocks) accesses the upper bytes will be ignored.
4851+
##
4852+
"scatter_scaled_predef_surface" : { "result" : "void",
4853+
"arguments" : ["anyvector","int","short","anyptr","int","anyint","anyvector"],
4854+
"attributes" : "None",
4855+
},
4856+
4857+
## ``llvm.genx.scatter4.scaled.predef.surface`` : vISA SCATTER4_SCALED instruction with predefined surface
4858+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4859+
##
4860+
## * (Exec_size inferred from element offset type)
4861+
## * arg0: vXi1 predicate (overloaded)
4862+
## * arg1: i32 channel mask, constant
4863+
## * arg2: i16 scale, constant
4864+
## * arg3: ptr predefined surface (overloaded)
4865+
## * arg4: i32 global offset in bytes
4866+
## * arg5: vXi32 element offset in bytes (overloaded)
4867+
## * arg6: data to write (overloaded)
4868+
##
4869+
## The vector width of the element offset arg is the number of elements to
4870+
## write, which must be 8 or 16.
4871+
## The predicate arg must have the same vector width.
4872+
## The instruction writes up to 4 channels per element, with the lowest 4
4873+
## bits of the channel mask arg giving the mask of channels _not_ to read.
4874+
## The number of 0 bits in that lower 4 bits of the channel mask arg is the
4875+
## number of channels to write per element.
4876+
## The channels to write must be contiguous and starting at channel 0.
4877+
## The vector width of the data to write must be the number of elements
4878+
## times the number of channels to write per element.
4879+
## The element type of the data to write must be i32 or float.
4880+
##
4881+
"scatter4_scaled_predef_surface" : { "result" : "void",
4882+
"arguments" : ["anyvector","int","short","anyptr","int","anyint","anyvector"],
4883+
"attributes" : "None",
4884+
},
4885+
4886+
## ``llvm.genx.oword.ld*.predef.surface`` : oword load instruction with predefined surface
4887+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4888+
## * ``llvm.genx.oword.ld.predef.surface`` : vISA OWORD_LD instruction
4889+
## * ``llvm.genx.oword.ld.unaligned.predef.surface`` : vISA OWORD_LD_UNALIGNED instruction
4890+
##
4891+
## * (log2 number of owords inferred from return type)
4892+
## * arg0: i32 is_modified, constant
4893+
## * arg1: ptr predefined surface variable (overloaded)
4894+
## * arg2: i32 offset (in owords for .ld / in bytes for .ld.unaligned)
4895+
##
4896+
## * Return value: vXiN the data read.
4897+
##
4898+
## The byte size of the return type must be 16, 32, 64, or 128.
4899+
##
4900+
"oword_ld_predef_surface" : { "result" : "anyvector",
4901+
"arguments" : ["int", "anyptr", "int"],
4902+
"attributes": "ReadMem",
4903+
},
4904+
4905+
"oword_ld_unaligned_predef_surface" : { "result" : "anyvector",
4906+
"arguments": ["int", "anyptr", "int"],
4907+
"attributes" : "ReadMem",
4908+
},
4909+
4910+
## ``llvm.genx.oword.st.predef.surface`` : vISA OWORD_ST instruction with predefined surface
4911+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4912+
##
4913+
## * (log2 number of owords inferred from return type)
4914+
## * arg0: ptr predefined surface variable (overloaded)
4915+
## * arg1: i32 offset (in owords)
4916+
## * arg2: data to write (overloaded)
4917+
##
4918+
## The byte size of the data to write must be 16, 32, 64, or 128.
4919+
##
4920+
"oword_st_predef_surface" : { "result" : "void",
4921+
"arguments" : ["anyptr", "int", "anyvector"],
4922+
"attributes" : "None",
4923+
},
4924+
46234925
}

0 commit comments

Comments
 (0)