Skip to content

Commit f9cef9d

Browse files
PikachuHyAxlauko
authored andcommitted
[CIR][CIRGen] Support __builtin_signbitl (llvm#1117)
follow llvm/clangir#1033 handle `LongDoubleType` with `FP80Type`.
1 parent c3f4b90 commit f9cef9d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clang/test/CIR/CodeGen/builtin-signbit.c

+10
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,13 @@ void test_signbit_long_double(long double val) {
3030
// LLVM: [[TMP1:%.*]] = bitcast x86_fp80 %{{.+}} to i80
3131
// LLVM: [[TMP2:%.*]] = icmp slt i80 [[TMP1]], 0
3232
}
33+
34+
void test_signbit_long_double(long double val) {
35+
// CIR: test_signbit_long_double
36+
// LLVM: test_signbit_long_double
37+
__builtin_signbitl(val);
38+
// CIR: %{{.+}} = cir.signbit %{{.+}} : !cir.long_double<!cir.f80> -> !s32i
39+
// LLVM: [[TMP1:%.*]] = bitcast x86_fp80 %{{.+}} to i80
40+
// LLVM: [[TMP2:%.*]] = icmp slt i80 [[TMP1]], 0
41+
// LLVM: %{{.+}} = zext i1 [[TMP2]] to i32
42+
}

0 commit comments

Comments
 (0)