Skip to content

Commit

Permalink
Conversion: Support float16 and bfloat in ConstantDataSequential
Browse files Browse the repository at this point in the history
  • Loading branch information
aleasto authored and danielecattaneo committed Oct 19, 2023
1 parent 4bb934f commit 004ad24
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Conversion/LLVMFloatToFixed/ConstantConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ Constant *FloatToFixed::convertConstantDataSequential(ConstantDataSequential *cd
return createConstantDataSequentialFP<uint64_t>(cds, fixpt);
}

if (fixpt.getFloatingPointStandard() == FixedPointType::Float_half) {
return createConstantDataSequentialFP<uint16_t>(cds, fixpt);
}

if (fixpt.getFloatingPointStandard() == FixedPointType::Float_bfloat) {
return createConstantDataSequentialFP<uint16_t>(cds, fixpt);
}

llvm_unreachable("Unsupported float constant conversion");
}

Expand Down

0 comments on commit 004ad24

Please sign in to comment.