<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 6/18/14, 3:01 AM, pratik dand wrote:<br>
</div>
<blockquote
cite="mid:CAJFa+mSAqu1SJuEXmVKiGFGeMN-=JcHW15bbyLTyEMQpH=21uQ@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr">Dear,
<div><br>
</div>
<div>I am new to llvm and hence have very little idea about a
problem that is my university project.</div>
<div>I am supposed to assume a X86 CPU supporting an instruction
ADDenc that adds two encrypted operands. The original ADD also
exists and should operate on unencrypted operands.</div>
<div><br>
</div>
<div>My task is to transform C programs into the new X86
assembly that supports ADDenc. I have very little idea about
this.</div>
<div><br>
</div>
<div>I have been suggested the following approaches</div>
<div>
1) Adding a new Instruction ADDenc in the current X86 LLVM
backend and make the necessary changes.</div>
<div>2) Adding a new LLVM IR instruction addenc that recognises
the operands at this level instead of general LLVM add, then
add an instruction in the target X86 to transform addenc of
LLVM to ADDenc of X86.</div>
</div>
</blockquote>
<br>
There is a third option: if you have an assembler that understands
the new ADDenc instruction, you can probably add inline assembly
code that performs the AddEnc instruction. This will only work if
you're doing ahead-of-time compilation and clang is configured to
use your new assembler, but if you're transforming C code, that is
most likely what you're doing.<br>
<br>
That said, if you're sufficiently confident with working with the
LLVM code generator, I think you should add support for the AddEnc
instruction in the X86 Backend. As to whether you should add an
intrinsic or modify the backend to just figure out where to use
AddEnc, I'm guessing that adding an intrinsic would be better, but
people more familiar with the code generator infrastructure should
comment.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote
cite="mid:CAJFa+mSAqu1SJuEXmVKiGFGeMN-=JcHW15bbyLTyEMQpH=21uQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>I have been given an LLVM pass that can run on LLVM IR and
decide which are the encrypted operands. </div>
<div><br>
</div>
<div>Any help of any kind will be helpful as I know very little
about LLVM. <br>
</div>
<div>
<div><br>
</div>
-- <br>
Pratik
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>