i256 for x86_64

Hello all

I have a very simple handwritten .ll file that can be translated to native assembly on x86_64 when I use i128. But if I use i256 I get an error. see the file and the first line of the error below. Any help is appreciated! I played a little bit with target datalayout but it didn’t help.

Best
Ehsan

Input File:

target datalayout = “e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128”
target triple = “x86_64-unknown-linux-gnu”

define i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
entry:

%0 = tail call i256 (…)* @get_num() nounwind ;comment here
ret i32 0
}

declare i256 @get_num(…)

Hello all

I have a very simple handwritten .ll file that can be translated to native assembly on x86_64 when I use i128. But if I use i256 I get an error. see the file and the first line of the error below. Any help is appreciated! I played a little bit with target datalayout but it didn't help.

This works for me on mainline. Are you using an old version of llvm?

-Chris

Yes I use 2.6 as my OS seems to be too old for 2.7.

Are there any restrictions on integer types for x86_64?

There was a longstanding bug involving directly returning types too
large to fit in registers. AFAIK, this was fixed for 2.7. If you
need to use 2.6, generate code that returns the value by reference.

-Eli

Are there any restrictions on integer types for x86_64?

You won't be able to return anything larger than i128 if you are
using LLVM 2.6.

Ciao,

Duncan.