mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-26 14:33:02 +02:00
3ea2df7c7b
Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) llvm-svn: 232184
65 lines
2.3 KiB
LLVM
65 lines
2.3 KiB
LLVM
; RUN: llc -march=mipsel -relocation-model=pic -O0 -mips-fast-isel -fast-isel-abort=1 -mcpu=mips32r2 \
|
|
; RUN: < %s | FileCheck %s
|
|
; RUN: llc -march=mipsel -relocation-model=pic -O0 -mips-fast-isel -fast-isel-abort=1 -mcpu=mips32 \
|
|
; RUN: < %s | FileCheck %s
|
|
|
|
@x = common global [128000 x float] zeroinitializer, align 4
|
|
@y = global float* getelementptr inbounds ([128000 x float], [128000 x float]* @x, i32 0, i32 0), align 4
|
|
@result = common global float 0.000000e+00, align 4
|
|
@.str = private unnamed_addr constant [5 x i8] c"%f \0A\00", align 1
|
|
|
|
; Function Attrs: nounwind
|
|
define void @foo() {
|
|
entry:
|
|
; CHECK-LABEL: .ent foo
|
|
%0 = load float*, float** @y, align 4
|
|
%arrayidx = getelementptr inbounds float, float* %0, i32 64000
|
|
store float 5.500000e+00, float* %arrayidx, align 4
|
|
; CHECK: lui $[[REG_FPCONST_INT:[0-9]+]], 16560
|
|
; CHECK: mtc1 $[[REG_FPCONST_INT]], $f[[REG_FPCONST:[0-9]+]]
|
|
; CHECK: lw $[[REG_Y_GOT:[0-9]+]], %got(y)(${{[0-9]+}})
|
|
; CHECK: lw $[[REG_Y:[0-9]+]], 0($[[REG_Y_GOT]])
|
|
; CHECK: lui $[[REG_IDX_UPPER:[0-9]+]], 3
|
|
; CHECK: ori $[[REG_IDX:[0-9]+]], $[[REG_IDX_UPPER]], 59392
|
|
; CHECK: addu $[[REG_Y_IDX:[0-9]+]], $[[REG_IDX]], $[[REG_Y]]
|
|
; CHECK: swc1 $f[[REG_FPCONST]], 0($[[REG_Y_IDX]])
|
|
ret void
|
|
; CHECK-LABEL: .end foo
|
|
}
|
|
|
|
; Function Attrs: nounwind
|
|
define void @goo() {
|
|
entry:
|
|
; CHECK-LABEL: .ent goo
|
|
%0 = load float*, float** @y, align 4
|
|
%arrayidx = getelementptr inbounds float, float* %0, i32 64000
|
|
%1 = load float, float* %arrayidx, align 4
|
|
store float %1, float* @result, align 4
|
|
; CHECK-DAG: lw $[[REG_RESULT:[0-9]+]], %got(result)(${{[0-9]+}})
|
|
; CHECK-DAG: lw $[[REG_Y_GOT:[0-9]+]], %got(y)(${{[0-9]+}})
|
|
; CHECK-DAG: lw $[[REG_Y:[0-9]+]], 0($[[REG_Y_GOT]])
|
|
; CHECK-DAG: lui $[[REG_IDX_UPPER:[0-9]+]], 3
|
|
; CHECK-DAG: ori $[[REG_IDX:[0-9]+]], $[[REG_IDX_UPPER]], 59392
|
|
; CHECK-DAG: addu $[[REG_Y_IDX:[0-9]+]], $[[REG_IDX]], $[[REG_Y]]
|
|
; CHECK-DAG: lwc1 $f[[Y_IDX:[0-9]+]], 0($[[REG_Y_IDX]])
|
|
; CHECK-DAG: swc1 $f[[Y_IDX]], 0($[[REG_RESULT]])
|
|
; CHECK-LABEL: .end goo
|
|
ret void
|
|
}
|
|
|
|
;
|
|
; Original C code for test.
|
|
;
|
|
;float x[128000];
|
|
;float *y = x;
|
|
;float result;
|
|
|
|
|
|
;void foo() {
|
|
; y[64000] = 5.5;
|
|
;}
|
|
|
|
;void goo() {
|
|
; result = y[64000];
|
|
;}
|