[PATCH] D45253: [X86][WAITPKG] WaitPKG instructions

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 12:48:43 PDT 2018


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86InstrInfo.td:2683
+                     "umonitor\t$src", [(int_x86_umonitor GR64:$src)]>, XS,
+                    Requires<[HasWAITPKG, In64BitMode]>;
+
----------------
What is the llvm-mc assembler expectation here? As this is defined it means that 64-bit mode assembly must alway use a 64-bit register and 32-bit mode must always use a 32-bit register. The documentation itself mentions being able to use a 16-bit register and that the 0x67 prefix has an effect, but that's not captured here.


================
Comment at: lib/Target/X86/X86InstrInfo.td:2701
+                     "tpause\t$src", [(int_x86_tpause64 GR64:$src, EAX, EDX)]>,
+                     PD, Requires<[HasWAITPKG, In64BitMode]>;
+  }
----------------
Again this also has a weird assembler expectation the register size is dependent on the mode.


================
Comment at: test/CodeGen/X86/waitpkg-intrinsics-64.ll:14
+  %address.addr = alloca i8*, align 8
+  store i8* %address, i8** %address.addr, align 8
+  %0 = load i8*, i8** %address.addr, align 8
----------------
Can these tests be simplified to not use so many loads and stores? Is this the -O0 clang output? Can we use -O2 output instead.


https://reviews.llvm.org/D45253





More information about the llvm-commits mailing list