File tree Expand file tree Collapse file tree 2 files changed +12
-28
lines changed Expand file tree Collapse file tree 2 files changed +12
-28
lines changed Original file line number Diff line number Diff line change @@ -294,34 +294,28 @@ class Attributes<Version ver = DXIL1_0, list<DXILAttribute> attrs> {
294294 list<DXILAttribute> op_attrs = attrs;
295295}
296296
297- class DXILConstant<int value_> {
298- int value = value_;
299- }
300-
301- defset list<DXILConstant> BarrierModes = {
302- def BarrierMode_DeviceMemoryBarrier : DXILConstant<2>;
303- def BarrierMode_DeviceMemoryBarrierWithGroupSync : DXILConstant<3>;
304- def BarrierMode_GroupMemoryBarrier : DXILConstant<8>;
305- def BarrierMode_GroupMemoryBarrierWithGroupSync : DXILConstant<9>;
306- def BarrierMode_AllMemoryBarrier : DXILConstant<10>;
307- def BarrierMode_AllMemoryBarrierWithGroupSync : DXILConstant<11>;
308- }
297+ defvar BarrierMode_DeviceMemoryBarrier = 2;
298+ defvar BarrierMode_DeviceMemoryBarrierWithGroupSync = 3;
299+ defvar BarrierMode_GroupMemoryBarrier = 8;
300+ defvar BarrierMode_GroupMemoryBarrierWithGroupSync = 9;
301+ defvar BarrierMode_AllMemoryBarrier = 10;
302+ defvar BarrierMode_AllMemoryBarrierWithGroupSync = 11;
309303
310304// Intrinsic arg selection
311305class Arg {
312306 int index = -1;
313- DXILConstant value;
307+ int value = 0 ;
314308 bit is_i8 = 0;
315309 bit is_i32 = 0;
316310}
317311class ArgSelect<int index_> : Arg {
318312 let index = index_;
319313}
320- class ArgI32<DXILConstant value_> : Arg {
314+ class ArgI32<int value_> : Arg {
321315 let value = value_;
322316 let is_i32 = 1;
323317}
324- class ArgI8<DXILConstant value_> : Arg {
318+ class ArgI8<int value_> : Arg {
325319 let value = value_;
326320 let is_i8 = 1;
327321}
Original file line number Diff line number Diff line change @@ -208,25 +208,15 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
208208 bool IsI8 = Arg->getValueAsBit (" is_i8" );
209209 bool IsI32 = Arg->getValueAsBit (" is_i32" );
210210 int Index = Arg->getValueAsInt (" index" );
211- const Record *ValueRec = Arg->getValueAsOptionalDef (" value" );
211+ int Value = Arg->getValueAsInt (" value" );
212212
213213 DXILArgSelect ArgSelect;
214214 if (IsI8) {
215- if (!ValueRec) {
216- PrintFatalError (R, Twine (" 'value' must be defined for i8 "
217- " ArgSelect for DXIL operation - " ) +
218- OpName);
219- }
220215 ArgSelect.Type = DXILArgSelect::Type::I8;
221- ArgSelect.Value = ValueRec-> getValueAsInt ( " value " ) ;
216+ ArgSelect.Value = Value ;
222217 } else if (IsI32) {
223- if (!ValueRec) {
224- PrintFatalError (R, Twine (" 'value' must be defined for i32 "
225- " ArgSelect for DXIL operation - " ) +
226- OpName);
227- }
228218 ArgSelect.Type = DXILArgSelect::Type::I32;
229- ArgSelect.Value = ValueRec-> getValueAsInt ( " value " ) ;
219+ ArgSelect.Value = Value ;
230220 } else {
231221 if (Index < 0 ) {
232222 PrintFatalError (
You can’t perform that action at this time.
0 commit comments