Skip to content

Commit 1fb0bd3

Browse files
jgu222igcbot
authored andcommitted
Use BF type in IGC
As BF is a new visa type, let IGC use it.
1 parent 23d2f7c commit 1fb0bd3

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ namespace IGC
708708
return 31;
709709
case ISA_TYPE_W:
710710
case ISA_TYPE_HF:
711+
case ISA_TYPE_BF:
711712
return 15;
712713
case ISA_TYPE_B:
713714
return 7;
@@ -720,7 +721,7 @@ namespace IGC
720721

721722
bool IsFloat(VISA_Type type)
722723
{
723-
return type == ISA_TYPE_DF || type == ISA_TYPE_F || type == ISA_TYPE_HF;
724+
return type == ISA_TYPE_DF || type == ISA_TYPE_F || type == ISA_TYPE_HF || type == ISA_TYPE_BF;
724725
}
725726

726727
uint64_t CalculateImmediateValue(CVariable* var, e_modifier mod)

IGC/Compiler/CISACodeGen/CVariable.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ uint CVariable::GetCISADataTypeSize(VISA_Type type)
211211
case ISA_TYPE_Q: return 8;
212212
case ISA_TYPE_UQ: return 8;
213213
case ISA_TYPE_HF: return 2;
214+
case ISA_TYPE_BF: return 2;
214215
default:
215216
IGC_ASSERT_MESSAGE(0, "Unimplemented CISA Data Type");
216217
break;
@@ -253,6 +254,8 @@ e_alignment CVariable::GetCISADataTypeAlignment(VISA_Type type)
253254
return EALIGN_QWORD;
254255
case ISA_TYPE_HF:
255256
return EALIGN_WORD;
257+
case ISA_TYPE_BF:
258+
return EALIGN_WORD;
256259
default:
257260
IGC_ASSERT_MESSAGE(0, "Unimplemented CISA Data Type");
258261
break;

IGC/Compiler/CISACodeGen/CVariable.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ namespace IGC {
314314
case ISA_TYPE_Q: return "q";
315315
case ISA_TYPE_UV: return "uv";
316316
case ISA_TYPE_HF: return "hf";
317+
case ISA_TYPE_BF: return "bf";
317318
default: return "illegal";
318319
}
319320
}

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,7 @@ static uint64_t getFPOne(VISA_Type Ty)
20032003
{
20042004
case ISA_TYPE_DF: return 0x3FF0000000000000;
20052005
case ISA_TYPE_F: return 0x3F800000;
2006+
case ISA_TYPE_BF: return 0x3F80;
20062007
case ISA_TYPE_HF: return 0x3C00;
20072008
default: break;
20082009
}

0 commit comments

Comments
 (0)