@@ -300,8 +300,8 @@ class G4_SendMsgDescriptor
300
300
static const int SLMIndex = 0xFE ;
301
301
302
302
G4_SendMsgDescriptor (uint32_t fCtrl , uint32_t regs2rcv, uint32_t regs2snd,
303
- uint32_t fID , bool isEot , uint16_t extMsgLength, uint32_t extFCtrl,
304
- SendAccess access, G4_Operand * bti, G4_Operand * sti, IR_Builder& builder);
303
+ SFID fID , uint16_t extMsgLength, uint32_t extFCtrl,
304
+ SendAccess access, G4_Operand* bti, G4_Operand* sti, IR_Builder& builder);
305
305
306
306
// / Construct a object with descriptor and extended descriptor values.
307
307
// / used in IR_Builder::createSendMsgDesc(uint32_t desc, uint32_t extDesc, SendAccess access)
@@ -378,16 +378,18 @@ class G4_SendMsgDescriptor
378
378
}
379
379
380
380
/* Info methods */
381
+ // common for all sends
381
382
uint16_t ResponseLength () const { return desc.layout .rspLength ; }
382
383
uint16_t MessageLength () const { return desc.layout .msgLength ; }
383
384
uint16_t extMessageLength () const { return (uint16_t )src1Len; }
384
-
385
- bool isCPSEnabled () const {return extDesc.layout .cps != 0 ;}
386
385
bool isDataPortRead () const { return accessType != SendAccess::WRITE_ONLY; }
387
386
bool isDataPortWrite () const { return accessType != SendAccess::READ_ONLY; }
388
387
SendAccess getAccess () const { return accessType; }
389
- bool isValidFuncCtrl () const { return funcCtrlValid; }
390
- bool isSampler () const {return getFuncId () == SFID::SAMPLER;}
388
+ bool isValidFuncCtrl () const { return funcCtrlValid; }
389
+ bool isHeaderPresent () const ;
390
+ void setHeaderPresent (bool val);
391
+
392
+ // for HDC messages only (DC0/DC1/DC2)
391
393
bool isHDC () const
392
394
{
393
395
auto funcID = getFuncId ();
@@ -397,88 +399,66 @@ class G4_SendMsgDescriptor
397
399
funcID == SFID::DP_DC2 ||
398
400
funcID == SFID::DP_CC;
399
401
}
400
- // isHDC() must be true
401
- uint32_t getHdcMessageType () const ;
402
-
403
- bool isThreadMessage () const {
404
- return getFuncId () == SFID::GATEWAY || getFuncId () == SFID::SPAWNER;
405
- }
406
402
403
+ uint32_t getHdcMessageType () const ;
407
404
bool isAtomicMessage () const ;
408
405
uint16_t getHdcAtomicOp () const ;
409
406
410
407
bool isSLMMessage () const ;
411
408
412
- bool isBarrierMsg () const ;
413
- bool isFence () const ;
414
-
415
- bool isSendBarrier () const {
416
- return isAtomicMessage () || isBarrierMsg (); // atomic write or explicit barrier
417
- }
418
-
419
- // ///////////////////////////////////////////////////////
420
- // the following may only be called on HDC messages
421
409
unsigned int getEnabledChannelNum () const ;
422
410
unsigned int getBlockNum () const ;
423
411
unsigned int getBlockSize () const ;
424
- // true if the message is either oword read or unaligned oword read
425
412
bool isOwordLoad () const ;
426
413
427
- // introduced to replace direct access to desc bits
428
414
bool isHdcTypedSurfaceWrite () const ;
429
415
430
- // TODO: this should be eliminated; it only supports a subset of messages
431
- // and can produce a false negative on newer messages; it also doesn't
432
- // support the SFID separate from the descriptor
433
- //
434
- // read-only implies that it doesn't write (e.g. an atomic)
435
- static bool isReadOnlyMessage (uint32_t msgDesc, uint32_t exDesc);
436
-
437
-
438
416
// return offset in unit of GRF
439
417
uint16_t getScratchRWOffset () const
440
418
{
441
419
MUST_BE_TRUE (isScratchRW (), " Message is not scratch space R/W." );
442
420
return (getFuncCtrl () & 0xFFFu );
443
421
}
444
422
445
- // number of GRFs to read/write
446
- //
447
- // Block Size indicates the number of simd-8 registers to be read|written.
448
- // 11: 8 registers
449
- // 10: 4 registers
450
- // 01: 2 registers
451
- // 00: 1 register
452
- uint16_t getScratchRWSize () const
453
- {
454
- MUST_BE_TRUE (isScratchRW (), " Message is not scratch space R/W." );
455
- uint16_t bitV = ((getFuncCtrl () & 0x3000u ) >> 12 );
456
- return 0x1 << bitV;
457
- }
458
423
bool isScratchRW () const
459
424
{
460
425
// scratch msg: DC0, bit 18 = 1
461
426
return getFuncId () == SFID::DP_DC && ((getFuncCtrl () & 0x40000u ) != 0 );
462
427
}
463
428
bool isScratchRead () const
464
429
{
465
- if ( !isScratchRW () )
466
- return false ;
467
- return ((getFuncCtrl () & 0x20000u ) == 0 );
430
+ return isScratchRW () && (getFuncCtrl () & 0x20000u ) == 0 ;
468
431
}
469
432
bool isScratchWrite () const
470
433
{
471
- if ( !isScratchRW () )
472
- return false ;
473
- return ((getFuncCtrl ()& 0x20000u ) != 0 );
434
+ return isScratchRW () && (getFuncCtrl () & 0x20000u ) != 0 ;
435
+ }
436
+ uint16_t getScratchRWSize () const
437
+ {
438
+ MUST_BE_TRUE (isScratchRW (), " Message is not scratch space R/W." );
439
+ uint16_t bitV = ((getFuncCtrl () & 0x3000u ) >> 12 );
440
+ return 0x1 << bitV;
474
441
}
475
442
476
- bool isHeaderPresent () const ;
477
- void setHeaderPresent (bool val);
443
+ bool isA64Message () const ;
478
444
445
+ // for sampler mesasges only
446
+ bool isSampler () const { return getFuncId () == SFID::SAMPLER; }
447
+ bool isCPSEnabled () const { return extDesc.layout .cps != 0 ; }
479
448
bool is16BitInput () const ;
480
449
bool is16BitReturn () const ;
481
- bool isA64Message () const ;
450
+
451
+ bool isThreadMessage () const
452
+ {
453
+ return getFuncId () == SFID::GATEWAY || getFuncId () == SFID::SPAWNER;
454
+ }
455
+
456
+ bool isBarrierMsg () const ;
457
+ bool isFence () const ;
458
+
459
+ bool isSendBarrier () const {
460
+ return isAtomicMessage () || isBarrierMsg (); // atomic write or explicit barrier
461
+ }
482
462
483
463
const G4_Operand *getBti () const {return m_bti;}
484
464
G4_Operand *getBti () {return m_bti;}
0 commit comments