mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
7c9c6ed761
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
39 lines
1.0 KiB
LLVM
39 lines
1.0 KiB
LLVM
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
|
|
|
|
define i8 @mask8(i8 %x) {
|
|
%m0 = bitcast i8 %x to <8 x i1>
|
|
%m1 = xor <8 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
|
|
%ret = bitcast <8 x i1> %m1 to i8
|
|
ret i8 %ret
|
|
; CHECK: mask8
|
|
; CHECK: knotb
|
|
; CHECK: ret
|
|
}
|
|
|
|
define void @mask8_mem(i8* %ptr) {
|
|
%x = load i8, i8* %ptr, align 4
|
|
%m0 = bitcast i8 %x to <8 x i1>
|
|
%m1 = xor <8 x i1> %m0, <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>
|
|
%ret = bitcast <8 x i1> %m1 to i8
|
|
store i8 %ret, i8* %ptr, align 4
|
|
ret void
|
|
; CHECK-LABEL: mask8_mem
|
|
; CHECK: kmovb ([[ARG1:%rdi|%rcx]]), %k{{[0-7]}}
|
|
; CHECK-NEXT: knotb
|
|
; CHECK-NEXT: kmovb %k{{[0-7]}}, ([[ARG1]])
|
|
; CHECK: ret
|
|
}
|
|
|
|
define i8 @mand8(i8 %x, i8 %y) {
|
|
%ma = bitcast i8 %x to <8 x i1>
|
|
%mb = bitcast i8 %y to <8 x i1>
|
|
%mc = and <8 x i1> %ma, %mb
|
|
%md = xor <8 x i1> %ma, %mb
|
|
%me = or <8 x i1> %mc, %md
|
|
%ret = bitcast <8 x i1> %me to i8
|
|
; CHECK: kandb
|
|
; CHECK: kxorb
|
|
; CHECK: korb
|
|
ret i8 %ret
|
|
}
|