llvm.org GIT mirror llvm / f296082
Add _allrem, _aullrem and _allmul to the runtime for MSVC. http://llvm.org/bugs/show_bug.cgi?id=10305 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134744 91177308-0d34-0410-b5e6-96231b3b80d8 Julien Lerouge 8 years ago
2 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
234234 // Setup Windows compiler runtime calls.
235235 setLibcallName(RTLIB::SDIV_I64, "_alldiv");
236236 setLibcallName(RTLIB::UDIV_I64, "_aulldiv");
237 setLibcallName(RTLIB::SREM_I64, "_allrem");
238 setLibcallName(RTLIB::UREM_I64, "_aullrem");
239 setLibcallName(RTLIB::MUL_I64, "_allmul");
237240 setLibcallName(RTLIB::FPTOUINT_F64_I64, "_ftol2");
238241 setLibcallName(RTLIB::FPTOUINT_F32_I64, "_ftol2");
239242 setLibcallCallingConv(RTLIB::SDIV_I64, CallingConv::X86_StdCall);
240243 setLibcallCallingConv(RTLIB::UDIV_I64, CallingConv::X86_StdCall);
244 setLibcallCallingConv(RTLIB::SREM_I64, CallingConv::X86_StdCall);
245 setLibcallCallingConv(RTLIB::UREM_I64, CallingConv::X86_StdCall);
246 setLibcallCallingConv(RTLIB::MUL_I64, CallingConv::X86_StdCall);
241247 setLibcallCallingConv(RTLIB::FPTOUINT_F64_I64, CallingConv::C);
242248 setLibcallCallingConv(RTLIB::FPTOUINT_F32_I64, CallingConv::C);
243249 }
0 ; Test that, for a 64 bit signed rem, a libcall to allrem is made on Windows
1 ; unless we have libgcc.
2
3 ; RUN: llc < %s -mtriple i386-pc-win32 | FileCheck %s
4 ; RUN: llc < %s -mtriple i386-pc-cygwin | FileCheck %s -check-prefix USEMODDI
5 ; RUN: llc < %s -mtriple i386-pc-mingw32 | FileCheck %s -check-prefix USEMODDI
6 ; PR10305
7 ; END.
8
9 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind readonly {
10 entry:
11 %conv4 = sext i32 %argc to i64
12 %div = srem i64 84, %conv4
13 %conv7 = trunc i64 %div to i32
14 ret i32 %conv7
15 }
16
17 ; CHECK: allrem
18 ; USEMODDI: moddi3