<div dir="ltr">While its true that X86 has 128-bit registers for SSE. There are no instructions for doing 128-bit arithmetic on them. So for example, you can't add two 128 bit registers and get a 128 bit result. Because of this i128 isn't considered a legal type by the X86 backend. It doesn't have a register class assigned to it via a call to addRegisterClass in X86ISelLowering.cpp.<div><div><br></div><div>It's also not possible in the X86 backend today to use an XMM register in the address calculations for a load or store.</div></div><div><br></div><div>I think in general the pointer type also needs to be listed as a valid integer type in the data layout string too.</div><div><br></div><div>But I'm not sure why you got the particular seg fault you go.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Mon, Jan 15, 2018 at 5:23 PM, Barbora Murinová via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I've been trying to extend pointer size of the X86 target to 128 bits. For the prortype, I would like nothing more than the pointers being i128 type with the same value as before. All I've done was changing the data layout string to p:128:128 and when trying to run a basic program such as:<br><br>int a = 42;<br>int *p = &a;</div><div><br></div><div>it segfaults with the following stack trace:</div><div><br></div><div><div>#0 0x00000000013eff7a llvm::sys::PrintStackTrace(<wbr>llvm::raw_ostream&) </div><div>/afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/llvm/lib/Support/Unix/Signals.inc:402:0" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/llvm/<wbr>lib/Support/Unix/Signals.inc:<wbr>402:0</a></div><div>#1 0x00000000013ee20e llvm::sys::RunSignalHandlers() /afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/llvm/lib/Support/Signals.cpp:50:0" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/llvm/<wbr>lib/Support/Signals.cpp:50:0</a></div><div>#2 0x00000000013ee34a SignalHandler(int) /afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/llvm/lib/Support/Unix/Signals.inc:242:0" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/llvm/<wbr>lib/Support/Unix/Signals.inc:<wbr>242:0</a></div><div>#3 0x00007fad6b434370 __restore_rt (/lib64/libpthread.so.0+<wbr>0xf370)</div><div>#4 0x0000000001ba1734 llvm::DAGTypeLegalizer::<wbr>PromoteIntOp_ATOMIC_STORE(<wbr>llvm::AtomicSDNode*) </div><div>/afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1025:0" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/llvm/<wbr>lib/CodeGen/SelectionDAG/<wbr>LegalizeIntegerTypes.cpp:1025:<wbr>0</a></div><div>Stack dump:</div><div>0.      Program arguments: /afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/build/bin/clang-6.0" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/build/<wbr>bin/clang-6.0</a> -cc1 -triple x86_64-unknown-linux-gnu -emit-obj </div><div>-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name simple.c -mrelocation-model static -mthread-model posix </div><div>-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info </div><div>-debugger-tuning=gdb -resource-dir /afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/build/lib/clang/6.0.0" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/build/<wbr>lib/clang/6.0.0</a> -internal-isystem /usr/local/include </div><div>-internal-isystem /afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/build/lib/clang/6.0.0/include" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/build/<wbr>lib/clang/6.0.0/include</a> -internal-externc-isystem /include </div><div>-internal-externc-isystem /usr/include -fdebug-compilation-dir /afs/<a href="http://inf.ed.ac.uk/user/s14/s1455152/Documents/HP/build" target="_blank">inf.ed.ac.uk/user/s14/<wbr>s1455152/Documents/HP/build</a> -ferror-limit 19 -fmessage-length </div><div>159 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/simple-2837aa.o -x c ../copy/simple.c </div><div>1.      <eof> parser at end of file</div><div>2.      Code generation</div><div>3.      Running pass 'Function Pass Manager' on module '../copy/simple.c'.</div><div>4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'</div><div>clang-6.0: error: unable to execute command: Segmentation fault</div><div>clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)</div><div><br></div><div>Now I know almost nothing about LLVM, but I assumed that since X86 target has SSE extensions, it wouldn't have a problem with a 128-bit value type in general. I would really appreciate any explanations and pointers you can give me. Sorry for such a general question.<br><br>Best wishes,<br>Barbora</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-1164091109653566287gmail_signature"><div dir="ltr"><div><font size="1" color="#999999">----------------</font></div><div><font size="1" color="#999999">Barbora Murinová</font></div><div><font size="1" color="#999999">The University of Edinburgh</font></div><div><font size="1" color="#999999">SK: <a href="tel:+421%20905%20718%20390" value="+421905718390" target="_blank">+421905718390</a><br>UK: <a href="tel:+44%207477%20833795" value="+447477833795" target="_blank">+447477833795</a></font></div></div></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>