Skip to content
Closed
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
4 changes: 4 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenBuiltinX86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,10 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
case X86::BI__builtin_ia32_sqrtpd:
case X86::BI__builtin_ia32_sqrtps256:
case X86::BI__builtin_ia32_sqrtps:
CGF.CGM.getDiags().Report(E->getExprLoc(), diag::err_cir_nyi)
<< "__builtin_ia32_sqrtps";
return CIRGenFunction::IgnoreValue();

case X86::BI__builtin_ia32_sqrtph256:
case X86::BI__builtin_ia32_sqrtph:
case X86::BI__builtin_ia32_sqrtph512:
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/CIR/CodeGen/CIRGenCleanup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "clang/CIR/MissingFeatures.h"

#include<algorithm>
using namespace clang;
using namespace clang::CIRGen;

Expand Down Expand Up @@ -97,7 +98,7 @@ EHScopeStack::getInnermostActiveNormalCleanup() const {
char *EHScopeStack::allocate(size_t size) {
size = llvm::alignTo(size, ScopeStackAlignment);
if (!startOfBuffer) {
unsigned capacity = llvm::PowerOf2Ceil(std::max(size, 1024ul));
unsigned capacity = llvm::PowerOf2Ceil(std::max(static_cast<unsigned long>(size), 1024ul));
startOfBuffer = std::make_unique<char[]>(capacity);
startOfData = endOfBuffer = startOfBuffer.get() + capacity;
} else if (static_cast<size_t>(startOfData - startOfBuffer.get()) < size) {
Expand Down
14 changes: 14 additions & 0 deletions clang/test/CIR/CodeGen/X86/builtin-x86-sqrt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// RUN: not %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir -o - %s 2>&1 | FileCheck %s

// Minimal stand-in for the SSE vector type.
typedef float __m128 __attribute__((__vector_size__(16)));

// Declare the builtin explicitly so we don't need headers.
__m128 __builtin_ia32_sqrtps(__m128);

__m128 test_sqrtps(__m128 a) {
return __builtin_ia32_sqrtps(a);
}

// CHECK: error: ClangIR code gen Not Yet Implemented: CIR lowering for x86 sqrt builtins is not implemented yet
// CHECK: error: ClangIR code gen Not Yet Implemented: unimplemented builtin call: __builtin_ia32_sqrtps
Loading