Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update clip to support fp64. #6146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/glow/LLVMIRCodeGen/LLVMIRGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ class LLVMIRGen {
const glow::Value *val);
/// Generates LLVM IR that materializes the constant \p val.
llvm::Value *emitConstF32(llvm::IRBuilder<> &builder, float val);
/// Generates LLVM IR that materializes the constant double \p val.
llvm::Value *emitConstF64(llvm::IRBuilder<> &builder, double val);
/// Generates LLVM IR that materializes the constant int64 \p val.
llvm::Value *emitConstI64(llvm::IRBuilder<> &builder, int64_t val);
/// Generates LLVM IR that materializes the constant \p val.
Expand Down
7 changes: 7 additions & 0 deletions lib/LLVMIRCodeGen/LLVMIRGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ llvm::Type *LLVMIRGen::getLLVMPtrType(glow::ElemKind kind) {
case ElemKind::BoolTy:
T = llvm::Type::getInt8PtrTy(getLLVMContext());
break;
case ElemKind::Float64Ty:
T = llvm::Type::getDoubleTy(getLLVMContext());
break;
default:
LOG(FATAL) << "Unsupported element type: "
<< Type::getElementName(kind).str();
Expand Down Expand Up @@ -667,6 +670,10 @@ llvm::Value *LLVMIRGen::emitConstF32(llvm::IRBuilder<> &builder, float val) {
return llvm::ConstantFP::get(llvm::Type::getFloatTy(getLLVMContext()), val);
}

llvm::Value *LLVMIRGen::emitConstF64(llvm::IRBuilder<> &builder, double val) {
return llvm::ConstantFP::get(llvm::Type::getDoubleTy(getLLVMContext()), val);
}

llvm::Value *LLVMIRGen::emitConstI64(llvm::IRBuilder<> &builder, int64_t val) {
return builder.getInt64(val);
}
Expand Down