[llvm] r371929 - [CodeEmitter] Improve testing for APInt encoding

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 01:44:41 PDT 2019


Author: jamesm
Date: Sun Sep 15 01:44:40 2019
New Revision: 371929

URL: http://llvm.org/viewvc/llvm-project?rev=371929&view=rev
Log:
[CodeEmitter] Improve testing for APInt encoding

I missed Artem's comment in D67487 before committing.

Differential Revision: https://reviews.llvm.org/D67487

Modified:
    llvm/trunk/test/TableGen/BigEncoder.td

Modified: llvm/trunk/test/TableGen/BigEncoder.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/BigEncoder.td?rev=371929&r1=371928&r2=371929&view=diff
==============================================================================
--- llvm/trunk/test/TableGen/BigEncoder.td (original)
+++ llvm/trunk/test/TableGen/BigEncoder.td Sun Sep 15 01:44:40 2019
@@ -45,17 +45,8 @@ def biz : Instruction {
     field bits<16> SoftFail = 0;
     }
 
-def baz : Instruction {
-    let InOperandList = (ins Myi32:$factor);
-    field bits<65> Inst;
-    bits<32> factor;
-    let Inst{7-0} = 0xDD;
-    let Inst{15-8} = factor{11-4}; // offset by 4 + custom decode
-    let AsmString = "baz  $factor";
-    field bits<16> SoftFail = 0;
-    }
-
 }
+
 // CHECK-LABEL: case ::biz: {
 // CHECK: const APInt [[x:M[0-9]+]] = APInt::getBitsSet(65, 3, 7);
 // CHECK-NEXT: Value |= (op & [[x]]) << 9;
@@ -67,3 +58,9 @@ def baz : Instruction {
 // CHECK-NEXT: op &= [[x]];
 // CHECK-NEXT: op <<= 8;
 // CHECK-NEXT: Value |= op;
+
+// CHECK-LABEL: case ::bar: {
+// CHECK: const APInt [[x:M[0-9]+]] = APInt::getBitsSet(65, 3, 11);
+// CHECK-NEXT: op &= [[x]];
+// CHECK-NEXT: op <<= 5;
+// CHECK-NEXT: Value |= op;




More information about the llvm-commits mailing list