Define the x86 pause instruction.
authorDan Gohman <gohman@apple.com>
Thu, 20 May 2010 01:35:50 +0000 (01:35 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 20 May 2010 01:35:50 +0000 (01:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104204 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrSSE.td
test/MC/AsmParser/X86/x86_32-bit_cat.s
test/MC/AsmParser/X86/x86_32-new-encoder.s

index 0f782c9a8fde14824a9db8b481fa41b020cd9850..829f65c4623f01f5ae40b73f03206a6f32d0b65f 100644 (file)
@@ -2417,6 +2417,10 @@ def LFENCE : I<0xAE, MRM_E8, (outs), (ins),
 def MFENCE : I<0xAE, MRM_F0, (outs), (ins),
                "mfence", [(int_x86_sse2_mfence)]>, TB, Requires<[HasSSE2]>;
 
+// Pause. This "instruction" is encoded as "rep; nop", so even though it
+// was introduced with SSE2, it's backward compabitle.
+def PAUSE : I<0x90, RawFrm, (outs), (ins), "pause", []>, REP;
+
 //TODO: custom lower this so as to never even generate the noop
 def : Pat<(membarrier (i8 imm), (i8 imm), (i8 imm), (i8 imm),
            (i8 0)), (NOOP)>;
index ec2bfa4a913d0da581b1fc6dc825066cf8a3e458..c1efe293c00ad7ef4382e61b00ef4c6fca01886a 100644 (file)
 // CHECK:      clflush 305419896
                clflush 0x12345678
 
+// CHECK:      pause
+               pause
+
+// CHECK:      sfence
+               sfence
+
 // CHECK:      lfence
                lfence
 
index 2400f5ad0125da35a6ceba66a113d3d5e9731bf9..6c087761671ec604c1895e8fd7bda123dacd0bea 100644 (file)
@@ -1,5 +1,8 @@
 // RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s
 
+       pause
+// CHECK: pause
+// CHECK: encoding: [0xf3,0x90]
        sfence
 // CHECK: sfence
 // CHECK: encoding: [0x0f,0xae,0xf8]