[LLVMdev] libcalls for shifts

Eli Friedman eli.friedman at gmail.com
Sun Jan 8 13:57:53 PST 2012


On Sun, Jan 8, 2012 at 2:37 AM, Johannes Birgmeier
<e0902998 at student.tuwien.ac.at> wrote:
>> Is i64 a legal type on your target?  If so, you might need to hack the
>> code generator a bit; no in-tree target has a legal integer type that
>> doesn't support shifts.  If not, I have no idea how you're getting
>> that error.
>
> Yes, well, i64 is a legal type, that's how it is. However, i64s are
> always stored in two 32-bit registers and in some cases need complicated
> instruction patterns for easy things (such as add, sub and so on) that
> basically simulate the i64 behaviour with a sequence of i32
> instructions.

I think you're misunderstanding what it means for a type to be "legal"
on a target.  If you don't have a single i64 addition instruction on
i64 registers, you shouldn't be marking i64 as a legal type.  You can
custom-lower certain operations on i64 if there's some instruction
sequence which is better than the default expansion.

-Eli




More information about the llvm-dev mailing list