[llvm] r314911 - bpf: fix an insn encoding issue for neg insn
Yonghong Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 09:11:52 PDT 2017
Author: yhs
Date: Wed Oct 4 09:11:52 2017
New Revision: 314911
URL: http://llvm.org/viewvc/llvm-project?rev=314911&view=rev
Log:
bpf: fix an insn encoding issue for neg insn
Signed-off-by: Yonghong Song <yhs at fb.com>
Modified:
llvm/trunk/lib/Target/BPF/BPFInstrInfo.td
llvm/trunk/test/MC/BPF/insn-unit-32.s
llvm/trunk/test/MC/BPF/insn-unit.s
Modified: llvm/trunk/lib/Target/BPF/BPFInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFInstrInfo.td?rev=314911&r1=314910&r2=314911&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFInstrInfo.td (original)
+++ llvm/trunk/lib/Target/BPF/BPFInstrInfo.td Wed Oct 4 09:11:52 2017
@@ -238,9 +238,7 @@ class NEG_RR<BPFOpClass Class, BPFArithO
dag outs, dag ins, string asmstr, list<dag> pattern>
: TYPE_ALU_JMP<Opc.Value, 0, outs, ins, asmstr, pattern> {
bits<4> dst;
- bits<4> src;
- let Inst{55-52} = src;
let Inst{51-48} = dst;
let BPFClass = Class;
}
Modified: llvm/trunk/test/MC/BPF/insn-unit-32.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/BPF/insn-unit-32.s?rev=314911&r1=314910&r2=314911&view=diff
==============================================================================
--- llvm/trunk/test/MC/BPF/insn-unit-32.s (original)
+++ llvm/trunk/test/MC/BPF/insn-unit-32.s Wed Oct 4 09:11:52 2017
@@ -7,7 +7,7 @@
w1 -= w2 // BPF_SUB | BPF_X
w2 *= w3 // BPF_MUL | BPF_X
w3 /= w4 // BPF_DIV | BPF_X
-// CHECK: 84 11 00 00 00 00 00 00 w1 = -w1
+// CHECK: 84 01 00 00 00 00 00 00 w1 = -w1
// CHECK: 0c 10 00 00 00 00 00 00 w0 += w1
// CHECK: 1c 21 00 00 00 00 00 00 w1 -= w2
// CHECK: 2c 32 00 00 00 00 00 00 w2 *= w3
Modified: llvm/trunk/test/MC/BPF/insn-unit.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/BPF/insn-unit.s?rev=314911&r1=314910&r2=314911&view=diff
==============================================================================
--- llvm/trunk/test/MC/BPF/insn-unit.s (original)
+++ llvm/trunk/test/MC/BPF/insn-unit.s Wed Oct 4 09:11:52 2017
@@ -118,7 +118,7 @@
// CHECK: 3f 43 00 00 00 00 00 00 r3 /= r4
Llabel0 :
- r0 = -r0 // BPF_NEG
+ r2 = -r2 // BPF_NEG
r4 |= r5 // BPF_OR | BPF_X
r5 &= r6 // BPF_AND | BPF_X
r6 <<= r7 // BPF_LSH | BPF_X
@@ -127,7 +127,7 @@ Llabel0 :
r9 = r10 // BPF_MOV | BPF_X
r10 s>>= r0 // BPF_ARSH | BPF_X
// CHECK:Llabel0:
-// CHECK: 87 00 00 00 00 00 00 00 r0 = -r0
+// CHECK: 87 02 00 00 00 00 00 00 r2 = -r2
// CHECK: 4f 54 00 00 00 00 00 00 r4 |= r5
// CHECK: 5f 65 00 00 00 00 00 00 r5 &= r6
// CHECK: 6f 76 00 00 00 00 00 00 r6 <<= r7
More information about the llvm-commits
mailing list