Skip to content

Commit b66c5bb

Browse files
kyansitoaus-intel
authored andcommitted
Add intrinsics to represent cm_imul builtin
This intrinsic doesn't produce vISA instr and must be lower in backend Small fixes in madw description to allow only width equal 2GRF/sizeof(i32)
1 parent 006d176 commit b66c5bb

File tree

1 file changed

+50
-29
lines changed

1 file changed

+50
-29
lines changed

GenXIntrinsics/include/llvm/GenXIntrinsics/Intrinsic_definitions.py

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,35 +1096,6 @@
10961096
"attributes" : "NoMem"
10971097
},
10981098

1099-
### ``llvm.genx.*madw.<return type>.<any int>`` : madw instruction, no saturation
1100-
### ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1101-
### * ``llvm.genx.smadw`` : result signed
1102-
### * ``llvm.genx.umadw`` : result unsigned
1103-
###
1104-
### result := arg0 * arg1 + arg2
1105-
###
1106-
### * Return value: result, the full 64-bit of the results of multiplying two 32-bit
1107-
### integers and adding 32-bit integer(32b*32b+32b->64b).
1108-
### The low 32b of results are stored in the lower GRF and
1109-
### the high 32b of results are stored in the high GRF.
1110-
###
1111-
### Return width of intrinsic depends on args width:
1112-
### if args width <= GRF/sizeof(i32) then return width = 2*GRF/sizeof(i32)
1113-
### else return width = 2 * args width
1114-
###
1115-
### * arg0: first input, same element type as result
1116-
### * arg1: second input, same type as arg0
1117-
### * arg2: third input, same type as arg0
1118-
###
1119-
"umadw" : { "result" : "anyint",
1120-
"arguments" : ["anyint", 1, 1],
1121-
"attributes" : "NoMem"
1122-
},
1123-
"smadw" : { "result" : "anyint",
1124-
"arguments" : ["anyint", 1, 1],
1125-
"attributes" : "NoMem"
1126-
},
1127-
11281099
### ``llvm.genx.*max.<return type>.<any int>`` : max instruction
11291100
### ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11301101
### * ``llvm.genx.smax`` : result and operands signed
@@ -1191,6 +1162,28 @@
11911162
### cover vISA functionality
11921163
###
11931164

1165+
### imad
1166+
### ^^^^
1167+
###
1168+
### ``llvm.genx.*imad.<{hi, lo}>.<any int>`` : imad instruction
1169+
### ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1170+
### * ``llvm.genx.simad`` : result and operands signed
1171+
### * ``llvm.genx.uimad`` : result and operands unsigned
1172+
###
1173+
### result := {hi, lo} = arg0 * arg1
1174+
###
1175+
### * arg0: first input, i32 scalar/vector integer type
1176+
### * arg1: second input, same type as arg0
1177+
###
1178+
"simad" : { "result" : ["anyint", "anyint"],
1179+
"arguments" : [0, 0],
1180+
"attributes" : "NoMem"
1181+
},
1182+
"uimad" : { "result" : ["anyint", "anyint"],
1183+
"arguments" : [0, 0],
1184+
"attributes" : "NoMem"
1185+
},
1186+
11941187
### mul
11951188
### ^^^
11961189
### Still need non-saaturating mul intrinsic as def-hoist/copy-prop in jitter
@@ -4933,4 +4926,32 @@
49334926
"attributes" : "None",
49344927
},
49354928

4929+
4930+
## ``llvm.genx.*madw.<return type>.<any int>`` : madw instruction, no saturation
4931+
## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4932+
## * ``llvm.genx.smadw`` : result signed
4933+
## * ``llvm.genx.umadw`` : result unsigned
4934+
##
4935+
## result := arg0 * arg1 + arg2
4936+
##
4937+
## * Return value: result, the full 64-bit of the results of multiplying two 32-bit
4938+
## integers and adding 32-bit integer(32b*32b+32b->64b).
4939+
## The low 32b of results are stored in the lower GRF and
4940+
## the high 32b of results are stored in the high GRF.
4941+
##
4942+
## Return width must be 2*GRF/sizeof(i32)
4943+
## Args width must be no more than GRF/sizeof(i32) and must be a power of two
4944+
##
4945+
## * arg0: first input, same element type as result
4946+
## * arg1: second input, same type as arg0
4947+
## * arg2: third input, same type as arg0
4948+
##
4949+
"umadw" : { "result" : "anyint",
4950+
"arguments" : ["anyint", 1, 1],
4951+
"attributes" : "NoMem"
4952+
},
4953+
"smadw" : { "result" : "anyint",
4954+
"arguments" : ["anyint", 1, 1],
4955+
"attributes" : "NoMem"
4956+
},
49364957
}

0 commit comments

Comments
 (0)