[PATCH] D12277: [X86] Add intrinsic support for clac, stac, lgdt and sgdt

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 23:46:07 PDT 2015


mkuper added inline comments.

================
Comment at: lib/Target/X86/X86InstrSystem.td:394
@@ -393,3 +393,3 @@
 let SchedRW = [WriteSystem] in {
-def SGDT16m : I<0x01, MRM0m, (outs opaque48mem:$dst), (ins),
+def SGDT16m : I<0x01, MRM0m, (outs), (ins opaque48mem:$dst),
               "sgdt{w}\t$dst", [], IIC_SGDT>, TB, OpSize16, Requires<[Not64BitMode]>;
----------------
rnk wrote:
> Why should these change to ins? lgdt goes from memory into the chip and sgdt goes from the chip out to memory, right?
I may be deeply confused, but I've always been under the impression memory operands should always go into the "ins" - regardless of whether the instruction is storing or loading through the pointer. The pointer itself is always an input to the instruction, never an output of it.

In practice, having it in as an "out" breaks pattern-matching since tablegen expects the input pattern to refer to instruction inputs, not outputs.


http://reviews.llvm.org/D12277





More information about the llvm-commits mailing list