[llvm] r191632 - Change type of XOP flag in code emitters to a bool. Remove a some unneeded cases from switch.

Craig Topper craig.topper at gmail.com
Sun Sep 29 01:33:34 PDT 2013


Author: ctopper
Date: Sun Sep 29 03:33:34 2013
New Revision: 191632

URL: http://llvm.org/viewvc/llvm-project?rev=191632&view=rev
Log:
Change type of XOP flag in code emitters to a bool. Remove a some unneeded cases from switch.

Modified:
    llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
    llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
    llvm/trunk/test/MC/X86/avx512-encodings.s

Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp?rev=191632&r1=191631&r2=191632&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp Sun Sep 29 03:33:34 2013
@@ -564,7 +564,7 @@ void X86MCCodeEmitter::EmitVEXOpcodePref
   unsigned char VEX_W = 0;
 
   // XOP: Use XOP prefix byte 0x8f instead of VEX.
-  unsigned char XOP = 0;
+  bool XOP = false;
 
   // VEX_5M (VEX m-mmmmm field):
   //
@@ -621,7 +621,7 @@ void X86MCCodeEmitter::EmitVEXOpcodePref
     VEX_W = 1;
 
   if ((TSFlags >> X86II::VEXShift) & X86II::XOP)
-    XOP = 1;
+    XOP = true;
 
   if ((TSFlags >> X86II::VEXShift) & X86II::VEX_L)
     VEX_L = 1;
@@ -669,11 +669,8 @@ void X86MCCodeEmitter::EmitVEXOpcodePref
   case X86II::XOPA:
     VEX_5M = 0xA;
     break;
-  case X86II::A6:  // Bypass: Not used by VEX
-  case X86II::A7:  // Bypass: Not used by VEX
-  case X86II::TB:  // Bypass: Not used by VEX
-  case 0:
-    break;  // No prefix!
+  case X86II::TB: // VEX_5M/VEX_PP already correct
+    break;
   }
 
 

Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=191632&r1=191631&r2=191632&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sun Sep 29 03:33:34 2013
@@ -840,7 +840,7 @@ void Emitter<CodeEmitter>::emitVEXOpcode
   unsigned char VEX_W = 0;
 
   // XOP: Use XOP prefix byte 0x8f instead of VEX.
-  unsigned char XOP = 0;
+  bool XOP = false;
 
   // VEX_5M (VEX m-mmmmm field):
   //
@@ -883,7 +883,7 @@ void Emitter<CodeEmitter>::emitVEXOpcode
     VEX_W = 1;
 
   if ((TSFlags >> X86II::VEXShift) & X86II::XOP)
-    XOP = 1;
+    XOP = true;
 
   if ((TSFlags >> X86II::VEXShift) & X86II::VEX_L)
     VEX_L = 1;
@@ -923,11 +923,8 @@ void Emitter<CodeEmitter>::emitVEXOpcode
     case X86II::XOPA:
       VEX_5M = 0xA;
       break;
-    case X86II::A6:  // Bypass: Not used by VEX
-    case X86II::A7:  // Bypass: Not used by VEX
-    case X86II::TB:  // Bypass: Not used by VEX
-    case 0:
-      break;  // No prefix!
+    case X86II::TB: // VEX_5M/VEX_PP already correct
+      break;
   }
 
 

Modified: llvm/trunk/test/MC/X86/avx512-encodings.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/avx512-encodings.s?rev=191632&r1=191631&r2=191632&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/avx512-encodings.s (original)
+++ llvm/trunk/test/MC/X86/avx512-encodings.s Sun Sep 29 03:33:34 2013
@@ -1,45 +1,5 @@
 // RUN: llvm-mc -triple x86_64-unknown-unknown -mcpu=knl --show-encoding %s | FileCheck %s
 
-// CHECK: vinserti32x4
-// CHECK: encoding: [0x62,0xa3,0x55,0x48,0x38,0xcd,0x01]
-vinserti32x4  $1, %xmm21, %zmm5, %zmm17
-
-// CHECK: vinserti32x4
-// CHECK: encoding: [0x62,0xe3,0x1d,0x40,0x38,0x4f,0x10,0x01]
-vinserti32x4  $1, 256(%rdi), %zmm28, %zmm17
-
-// CHECK: vextracti32x4
-// CHECK: encoding: [0x62,0x33,0x7d,0x48,0x39,0xc9,0x01]
-vextracti32x4  $1, %zmm9, %xmm17
-
-// CHECK: vextracti64x4
-// CHECK: encoding: [0x62,0x33,0xfd,0x48,0x3b,0xc9,0x01]
-vextracti64x4  $1, %zmm9, %ymm17
-
-// CHECK: vextracti64x4
-// CHECK: encoding: [0x62,0x73,0xfd,0x48,0x3b,0x4f,0x10,0x01]
-vextracti64x4  $1, %zmm9, 512(%rdi)
-
-// CHECK: vpsrad
-// CHECK: encoding: [0x62,0xb1,0x35,0x40,0x72,0xe1,0x02]
-vpsrad $2, %zmm17, %zmm25
-
-// CHECK: vpsrad
-// CHECK: encoding: [0x62,0xf1,0x35,0x40,0x72,0x64,0xb7,0x08,0x02]
-vpsrad $2, 512(%rdi, %rsi, 4), %zmm25
-
-// CHECK: vpsrad
-// CHECK: encoding: [0x62,0x21,0x1d,0x48,0xe2,0xc9]
-vpsrad %xmm17, %zmm12, %zmm25
-
-// CHECK: vpsrad
-// CHECK: encoding: [0x62,0x61,0x1d,0x48,0xe2,0x4c,0xb7,0x20]
-vpsrad 512(%rdi, %rsi, 4), %zmm12, %zmm25
-
-// CHECK: vpbroadcastd {{.*}} {%k1} {z}
-// CHECK: encoding: [0x62,0xf2,0x7d,0xc9,0x58,0xc8]
-vpbroadcastd  %xmm0, %zmm1 {%k1} {z}
-
 // CHECK: vmovdqu64 {{.*}} {%k3}
 // CHECK: encoding: [0x62,0xf1,0xfe,0x4b,0x6f,0xc8]
-vmovdqu64 %zmm0, %zmm1 {%k3}
\ No newline at end of file
+vmovdqu64 %zmm0, %zmm1 {%k3}





More information about the llvm-commits mailing list