<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Stephen,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><span>Thank you. The llvm IR accept the i48 but it will fail if I use i48 as data type in *.td file. Do you know how to add i48 type in *.td, or it is not allowed.<br>The other question is "Is it possible to make clang compiler generate i48 for "C int type varialbe?". If you don't know the answer of this clang question I will post it on clang development list.<br><br>Best regards<br><br>Jonathan<br></span><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font
 face="Arial" size="2"> <b><span style="font-weight:bold;">寄件者:</span></b> Stephen Checkoway <s@pahtak.org><br> <b><span style="font-weight: bold;">收件者:</span></b> gamma_chen <gamma_chen@yahoo.com.tw> <br><b><span style="font-weight: bold;">副本:</span></b> "llvmdev@cs.uiuc.edu" <llvmdev@cs.uiuc.edu>; Vijay Daultani <vijay.daultani@gmail.com> <br> <b><span style="font-weight: bold;">寄件日期:</span></b> 2013/9/5 (週四) 3:59 PM<br> <b><span style="font-weight: bold;">主旨:</span></b> Re: [LLVMdev] C int type for 48bits cpu<br> </font> </div> <div class="y_msg_container"><br><br>On Sep 5, 2013, at 3:37 AM, gamma_chen <<a ymailto="mailto:gamma_chen@yahoo.com.tw" href="mailto:gamma_chen@yahoo.com.tw">gamma_chen@yahoo.com.tw</a>> wrote:<br><br>> LLVM only support primitive type i32 and i64, no i48. The clang translate "C int type" to i32 too. My question is if a cpu is 48 bits register size, how
 to write the backend for 48 bits register architecture. Can someone help me with this problem?<br><br><br>I'm not LLVM expert, but I'm pretty sure your initial sentence is false. For example:<br><br>steve$ cat a.ll<br>; ModuleID = 'a.c'<br>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-n8:16:32:64-S128"<br>target triple = "x86_64-apple-macosx10.8.0"<br><br>define i48 @foo() nounwind uwtable ssp {<br>  ret i48 3<br>}<br>steve$ clang -S a.ll<br>steve$ cat a.s<br>    .section    __TEXT,__text,regular,pure_instructions<br>    .globl    _foo<br>    .align    4, 0x90<br>_foo:                                   ## @foo<br>    .cfi_startproc<br>##
 BB#0:<br>    pushq    %rbp<br>Ltmp2:<br>    .cfi_def_cfa_offset 16<br>Ltmp3:<br>    .cfi_offset %rbp, -16<br>    movq    %rsp, %rbp<br>Ltmp4:<br>    .cfi_def_cfa_register %rbp<br>    movl    $3, %eax<br>    popq    %rbp<br>    ret<br>    .cfi_endproc<br><br><br>.subsections_via_symbols<br><br>As you can see, i48 was a perfectly valid LLVM type.<br><br>Without having written a backend, I'd imagine you specify what types are legal and then either generic code or target-dependent code is going to legalize the type. In my example, I imagine the i48 was legalized to an i64 which is legal for my target architecture.<br><br>-- <br>Stephen Checkoway<br><br><br><br><br><br></div> </div> </div>  </div></body></html>