Skip to content

Commit d8fc918

Browse files
jgu222igcbot
authored andcommitted
use long as return type of timestamp intrinsic
Using long as timestamp intrinsic's return type can save a few instructions on platforms that supports QW.
1 parent 9ec8670 commit d8fc918

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

IGC/BiFModule/Implementation/IGCBiF_Intrinsics.cl

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ half __builtin_IB_ftoh_rtz(float) __attribute__((const));
133133
#endif // defined(cl_khr_fp64)
134134

135135
// Debug/Testing Built-In Functions
136-
uint2 __builtin_IB_read_cycle_counter(void) __attribute__((const));
136+
ulong __builtin_IB_read_cycle_counter(void) __attribute__((const));
137137
void __builtin_IB_source_value(uint reg);
138138
uint __builtin_IB_set_dbg_register(uint dgb0_0);
139139
uint __builtin_IB_movreg(uint reg) __attribute__((const));

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -4765,10 +4765,11 @@ void EmitPass::emitcycleCounter(llvm::Instruction* inst)
47654765
{
47664766
// Must move 2 DW at the same time, so use "(W) mov (2|M0)"
47674767
CVariable* dst = m_destination;
4768+
CVariable* dst2DW = m_currShader->GetNewAlias(dst, ISA_TYPE_UD, 0, 0);
47684769
m_encoder->SetNoMask();
47694770
m_encoder->SetSrcRegion(0, 1, 1, 0);
47704771
m_encoder->SetUniformSIMDSize(SIMDMode::SIMD2);
4771-
m_encoder->Copy(dst, m_currShader->GetTSC());
4772+
m_encoder->Copy(dst2DW, m_currShader->GetTSC());
47724773
m_encoder->Push();
47734774
}
47744775

IGC/GenISAIntrinsics/Intrinsic_definitions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@
807807
"None"]],
808808
####################################################################################################
809809
"GenISA_cycleCounter": ["",
810-
[("int2", ""),
810+
[("long", "result"),
811811
[],
812812
"None"]],
813813
####################################################################################################

0 commit comments

Comments
 (0)