[llvm-commits] [llvm] r72941 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
Duncan Sands
baldrick at free.fr
Fri Jun 5 07:57:24 PDT 2009
Hi Sanjiv,
> Allow libcalls for i16 sdiv/udiv/rem operations.
please factor out into helper methods that get the right
SDIV/SREM for the type, along the lines of RTLIB::getFPROUND.
Please modify LegalizeDAG.cpp to use the helpers also.
Thanks,
Duncan.
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Fri Jun 5 09:41:10 2009
> @@ -1746,7 +1746,9 @@
> DebugLoc dl = N->getDebugLoc();
>
> RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
> - if (VT == MVT::i32)
> + if (VT == MVT::i16)
> + LC = RTLIB::SDIV_I16;
> + else if (VT == MVT::i32)
> LC = RTLIB::SDIV_I32;
> else if (VT == MVT::i64)
> LC = RTLIB::SDIV_I64;
> @@ -1908,7 +1910,9 @@
> DebugLoc dl = N->getDebugLoc();
>
> RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
> - if (VT == MVT::i32)
> + if (VT == MVT::i16)
> + LC = RTLIB::SREM_I16;
> + else if (VT == MVT::i32)
> LC = RTLIB::SREM_I32;
> else if (VT == MVT::i64)
> LC = RTLIB::SREM_I64;
> @@ -1937,7 +1941,9 @@
> DebugLoc dl = N->getDebugLoc();
>
> RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
> - if (VT == MVT::i32)
> + if (VT == MVT::i16)
> + LC = RTLIB::UDIV_I16;
> + else if (VT == MVT::i32)
> LC = RTLIB::UDIV_I32;
> else if (VT == MVT::i64)
> LC = RTLIB::UDIV_I64;
> @@ -1955,7 +1961,9 @@
> DebugLoc dl = N->getDebugLoc();
>
> RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
> - if (VT == MVT::i32)
> + if (VT == MVT::i16)
> + LC = RTLIB::UREM_I16;
> + else if (VT == MVT::i32)
> LC = RTLIB::UREM_I32;
> else if (VT == MVT::i64)
> LC = RTLIB::UREM_I64;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list