@@ -300,8 +300,8 @@ class G4_SendMsgDescriptor
300300 static const int SLMIndex = 0xFE ;
301301
302302 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);
305305
306306 // / Construct a object with descriptor and extended descriptor values.
307307 // / used in IR_Builder::createSendMsgDesc(uint32_t desc, uint32_t extDesc, SendAccess access)
@@ -378,16 +378,18 @@ class G4_SendMsgDescriptor
378378 }
379379
380380 /* Info methods */
381+ // common for all sends
381382 uint16_t ResponseLength () const { return desc.layout .rspLength ; }
382383 uint16_t MessageLength () const { return desc.layout .msgLength ; }
383384 uint16_t extMessageLength () const { return (uint16_t )src1Len; }
384-
385- bool isCPSEnabled () const {return extDesc.layout .cps != 0 ;}
386385 bool isDataPortRead () const { return accessType != SendAccess::WRITE_ONLY; }
387386 bool isDataPortWrite () const { return accessType != SendAccess::READ_ONLY; }
388387 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)
391393 bool isHDC () const
392394 {
393395 auto funcID = getFuncId ();
@@ -397,88 +399,66 @@ class G4_SendMsgDescriptor
397399 funcID == SFID::DP_DC2 ||
398400 funcID == SFID::DP_CC;
399401 }
400- // isHDC() must be true
401- uint32_t getHdcMessageType () const ;
402-
403- bool isThreadMessage () const {
404- return getFuncId () == SFID::GATEWAY || getFuncId () == SFID::SPAWNER;
405- }
406402
403+ uint32_t getHdcMessageType () const ;
407404 bool isAtomicMessage () const ;
408405 uint16_t getHdcAtomicOp () const ;
409406
410407 bool isSLMMessage () const ;
411408
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
421409 unsigned int getEnabledChannelNum () const ;
422410 unsigned int getBlockNum () const ;
423411 unsigned int getBlockSize () const ;
424- // true if the message is either oword read or unaligned oword read
425412 bool isOwordLoad () const ;
426413
427- // introduced to replace direct access to desc bits
428414 bool isHdcTypedSurfaceWrite () const ;
429415
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-
438416 // return offset in unit of GRF
439417 uint16_t getScratchRWOffset () const
440418 {
441419 MUST_BE_TRUE (isScratchRW (), " Message is not scratch space R/W." );
442420 return (getFuncCtrl () & 0xFFFu );
443421 }
444422
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- }
458423 bool isScratchRW () const
459424 {
460425 // scratch msg: DC0, bit 18 = 1
461426 return getFuncId () == SFID::DP_DC && ((getFuncCtrl () & 0x40000u ) != 0 );
462427 }
463428 bool isScratchRead () const
464429 {
465- if ( !isScratchRW () )
466- return false ;
467- return ((getFuncCtrl () & 0x20000u ) == 0 );
430+ return isScratchRW () && (getFuncCtrl () & 0x20000u ) == 0 ;
468431 }
469432 bool isScratchWrite () const
470433 {
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;
474441 }
475442
476- bool isHeaderPresent () const ;
477- void setHeaderPresent (bool val);
443+ bool isA64Message () const ;
478444
445+ // for sampler mesasges only
446+ bool isSampler () const { return getFuncId () == SFID::SAMPLER; }
447+ bool isCPSEnabled () const { return extDesc.layout .cps != 0 ; }
479448 bool is16BitInput () const ;
480449 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+ }
482462
483463 const G4_Operand *getBti () const {return m_bti;}
484464 G4_Operand *getBti () {return m_bti;}
0 commit comments