diff options
author | Yonghong Song <yhs@fb.com> | 2017-08-23 04:25:57 +0000 |
---|---|---|
committer | Yonghong Song <yhs@fb.com> | 2017-08-23 04:25:57 +0000 |
commit | dc1dbf6ef320175acbdc1206da4b0a176b304449 (patch) | |
tree | 8bdc3de57d2c7319c86e5f484184e2dfb8b00532 /llvm/test/CodeGen/BPF/setcc.ll | |
parent | d6c0868da50280334e0dbad9ab6dd87875d2afbd (diff) | |
download | bcm5719-llvm-dc1dbf6ef320175acbdc1206da4b0a176b304449.tar.gz bcm5719-llvm-dc1dbf6ef320175acbdc1206da4b0a176b304449.zip |
bpf: add variants of -mcpu=# and support for additional jmp insns
-mcpu=# will support:
. generic: the default insn set
. v1: insn set version 1, the same as generic
. v2: insn set version 2, version 1 + additional jmp insns
. probe: the compiler will probe the underlying kernel to
decide proper version of insn set.
We did not not use -mcpu=native since llc/llvm will interpret -mcpu=native
as the underlying hardware architecture regardless of -march value.
Currently, only x86_64 supports -mcpu=probe. Other architecture will
silently revert to "generic".
Also added -mcpu=help to print available cpu parameters.
llvm will print out the information only if there are at least one
cpu and at least one feature. Add an unused dummy feature to
enable the printout.
Examples for usage:
$ llc -march=bpf -mcpu=v1 -filetype=asm t.ll
$ llc -march=bpf -mcpu=v2 -filetype=asm t.ll
$ llc -march=bpf -mcpu=generic -filetype=asm t.ll
$ llc -march=bpf -mcpu=probe -filetype=asm t.ll
$ llc -march=bpf -mcpu=v3 -filetype=asm t.ll
'v3' is not a recognized processor for this target (ignoring processor)
...
$ llc -march=bpf -mcpu=help -filetype=asm t.ll
Available CPUs for this target:
generic - Select the generic processor.
probe - Select the probe processor.
v1 - Select the v1 processor.
v2 - Select the v2 processor.
Available features for this target:
dummy - unused feature.
Use +feature to enable a feature, or -feature to disable it.
For example, llc -mcpu=mycpu -mattr=+feature1,-feature2
...
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 311522
Diffstat (limited to 'llvm/test/CodeGen/BPF/setcc.ll')
-rw-r--r-- | llvm/test/CodeGen/BPF/setcc.ll | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/llvm/test/CodeGen/BPF/setcc.ll b/llvm/test/CodeGen/BPF/setcc.ll index 7e20814da80..d82a76237a1 100644 --- a/llvm/test/CodeGen/BPF/setcc.ll +++ b/llvm/test/CodeGen/BPF/setcc.ll @@ -1,4 +1,5 @@ -; RUN: llc -march=bpfel < %s | FileCheck %s +; RUN: llc -march=bpfel < %s | FileCheck --check-prefix=CHECK-V1 %s +; RUN: llc -march=bpfel -mcpu=v2 < %s | FileCheck --check-prefix=CHECK-V2 %s define i16 @sccweqand(i16 %a, i16 %b) nounwind { %t1 = and i16 %a, %b @@ -7,7 +8,8 @@ define i16 @sccweqand(i16 %a, i16 %b) nounwind { ret i16 %t3 } ; CHECK-LABEL: sccweqand: -; CHECK: if r1 == 0 +; CHECK-V1: if r1 == 0 +; CHECK-V2: if r1 == 0 define i16 @sccwneand(i16 %a, i16 %b) nounwind { %t1 = and i16 %a, %b @@ -16,7 +18,8 @@ define i16 @sccwneand(i16 %a, i16 %b) nounwind { ret i16 %t3 } ; CHECK-LABEL: sccwneand: -; CHECK: if r1 != 0 +; CHECK-V1: if r1 != 0 +; CHECK-V2: if r1 != 0 define i16 @sccwne(i16 %a, i16 %b) nounwind { %t1 = icmp ne i16 %a, %b @@ -24,7 +27,8 @@ define i16 @sccwne(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwne: -; CHECK: if r1 != r2 +; CHECK-V1: if r1 != r2 +; CHECK-V2: if r1 != r2 define i16 @sccweq(i16 %a, i16 %b) nounwind { %t1 = icmp eq i16 %a, %b @@ -32,7 +36,8 @@ define i16 @sccweq(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccweq: -; CHECK: if r1 == r2 +; CHECK-V1: if r1 == r2 +; CHECK-V2: if r1 == r2 define i16 @sccwugt(i16 %a, i16 %b) nounwind { %t1 = icmp ugt i16 %a, %b @@ -40,7 +45,8 @@ define i16 @sccwugt(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwugt: -; CHECK: if r1 > r2 +; CHECK-V1: if r1 > r2 +; CHECK-V2: if r1 > r2 define i16 @sccwuge(i16 %a, i16 %b) nounwind { %t1 = icmp uge i16 %a, %b @@ -48,7 +54,8 @@ define i16 @sccwuge(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwuge: -; CHECK: if r1 >= r2 +; CHECK-V1: if r1 >= r2 +; CHECK-V2: if r1 >= r2 define i16 @sccwult(i16 %a, i16 %b) nounwind { %t1 = icmp ult i16 %a, %b @@ -56,7 +63,8 @@ define i16 @sccwult(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwult: -; CHECK: if r2 > r1 +; CHECK-V1: if r2 > r1 +; CHECK-V2: if r1 < r2 define i16 @sccwule(i16 %a, i16 %b) nounwind { %t1 = icmp ule i16 %a, %b @@ -64,7 +72,8 @@ define i16 @sccwule(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwule: -; CHECK: if r2 >= r1 +; CHECK-V1: if r2 >= r1 +; CHECK-V2: if r1 <= r2 define i16 @sccwsgt(i16 %a, i16 %b) nounwind { %t1 = icmp sgt i16 %a, %b @@ -72,7 +81,8 @@ define i16 @sccwsgt(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwsgt: -; CHECK: if r1 s> r2 +; CHECK-V1: if r1 s> r2 +; CHECK-V2: if r1 s> r2 define i16 @sccwsge(i16 %a, i16 %b) nounwind { %t1 = icmp sge i16 %a, %b @@ -80,7 +90,8 @@ define i16 @sccwsge(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwsge: -; CHECK: if r1 s>= r2 +; CHECK-V1: if r1 s>= r2 +; CHECK-V2: if r1 s>= r2 define i16 @sccwslt(i16 %a, i16 %b) nounwind { %t1 = icmp slt i16 %a, %b @@ -88,7 +99,8 @@ define i16 @sccwslt(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwslt: -; CHECK: if r2 s> r1 +; CHECK-V1: if r2 s> r1 +; CHECK-V2: if r1 s< r2 define i16 @sccwsle(i16 %a, i16 %b) nounwind { %t1 = icmp sle i16 %a, %b @@ -96,4 +108,5 @@ define i16 @sccwsle(i16 %a, i16 %b) nounwind { ret i16 %t2 } ; CHECK-LABEL:sccwsle: -; CHECK: if r2 s>= r1 +; CHECK-V1: if r2 s>= r1 +; CHECK-V2: if r1 s<= r2 |