mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-11-23 16:35:02 +03:00
Tests for all single-precision floating point load and store ops
This commit is contained in:
parent
a25a477944
commit
11affb8848
@ -2,15 +2,37 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void _start() {
|
||||
float res [] = {0.0,0.0};
|
||||
float res [] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
|
||||
float a=45.4; // r9
|
||||
float b=1.1;
|
||||
float b=1.1; // r10
|
||||
float c=0.0;
|
||||
float *pointer = &res[0]; // r10
|
||||
int idx1 = 4;
|
||||
int idx2 = 0;
|
||||
|
||||
/* TEST: Load/store single precision D-form */
|
||||
asm ( " stfs %0,0(%2) \n"
|
||||
" stfs %1,4(%2) \n"
|
||||
" lfs %1,0(%2) \n"
|
||||
" lfs %0,4(%2) \n"
|
||||
" stfsu %0,0(%2) \n"
|
||||
" stfsu %1,4(%2) \n"
|
||||
" lfsu %1,-4(%2) \n"
|
||||
" lfsu %0,4(%2) \n"
|
||||
: "+r"(a), "+r"(b)
|
||||
: "r"(pointer));
|
||||
|
||||
/* TEST: Load/store single precision */
|
||||
asm ( " stfs %1,0(%2) \n"
|
||||
: "=r"(b)
|
||||
: "r"(a), "r"(pointer));
|
||||
/* TEST: Load/store single precision X-form */
|
||||
asm ( " stfsx %0,%2,%3 \n"
|
||||
" stfsx %1,%2,%4 \n"
|
||||
" lfsx %1,%2,%3 \n"
|
||||
" lfsx %0,%2,%4 \n"
|
||||
" stfsux %0,%2,%3 \n"
|
||||
" stfsux %1,%2,%4 \n"
|
||||
" lfsux %1,%2,%3 \n"
|
||||
" lfsux %0,%2,%4 \n"
|
||||
: "+r"(a), "+r"(b)
|
||||
: "r"(pointer), "r"(idx1), "r"(idx2));
|
||||
|
||||
EXIT();
|
||||
}
|
||||
|
Binary file not shown.
@ -12,37 +12,84 @@ _start:
|
||||
.type _start, @function
|
||||
.L._start:
|
||||
std 31,-8(1)
|
||||
stdu 1,-96(1)
|
||||
stdu 1,-144(1)
|
||||
mr 31,1
|
||||
xxlxor 0,0,0
|
||||
stfs 0,64(31)
|
||||
xxlxor 0,0,0
|
||||
stfs 0,68(31)
|
||||
xxlxor 32,32,32
|
||||
li 9,80
|
||||
stxvw4x 32,31,9
|
||||
xxlxor 32,32,32
|
||||
li 9,96
|
||||
stxvw4x 32,31,9
|
||||
addis 9,2,.LC0@toc@ha
|
||||
addi 9,9,.LC0@toc@l
|
||||
lfs 0,0(9)
|
||||
stfs 0,48(31)
|
||||
xxlxor 0,0,0
|
||||
addis 9,2,.LC1@toc@ha
|
||||
addi 9,9,.LC1@toc@l
|
||||
lfs 0,0(9)
|
||||
stfs 0,52(31)
|
||||
addi 9,31,64
|
||||
std 9,56(31)
|
||||
lwz 9,48(31)
|
||||
ld 10,56(31)
|
||||
xxlxor 0,0,0
|
||||
stfs 0,56(31)
|
||||
addi 9,31,80
|
||||
std 9,64(31)
|
||||
li 9,4
|
||||
stw 9,72(31)
|
||||
li 9,0
|
||||
stw 9,76(31)
|
||||
ld 8,64(31)
|
||||
lfs 12,48(31)
|
||||
lfs 0,52(31)
|
||||
stfs 12,112(31)
|
||||
lwz 10,112(31)
|
||||
stfs 0,112(31)
|
||||
lwz 9,112(31)
|
||||
#APP
|
||||
# 10 "test-fp.c" 1
|
||||
stfs 9,0(10)
|
||||
# 14 "test-fp.c" 1
|
||||
stfs 10,0(8)
|
||||
stfs 9,4(8)
|
||||
lfs 9,0(8)
|
||||
lfs 10,4(8)
|
||||
stfsu 10,0(8)
|
||||
stfsu 9,4(8)
|
||||
lfsu 9,-4(8)
|
||||
lfsu 10,4(8)
|
||||
|
||||
# 0 "" 2
|
||||
#NO_APP
|
||||
stw 10,48(31)
|
||||
stw 9,52(31)
|
||||
ld 8,64(31)
|
||||
lwz 7,72(31)
|
||||
lwz 6,76(31)
|
||||
lfs 12,48(31)
|
||||
lfs 0,52(31)
|
||||
stfs 12,112(31)
|
||||
lwz 10,112(31)
|
||||
stfs 0,112(31)
|
||||
lwz 9,112(31)
|
||||
#APP
|
||||
# 26 "test-fp.c" 1
|
||||
stfsx 10,8,7
|
||||
stfsx 9,8,6
|
||||
lfsx 9,8,7
|
||||
lfsx 10,8,6
|
||||
stfsux 10,8,7
|
||||
stfsux 9,8,6
|
||||
lfsux 9,8,7
|
||||
lfsux 10,8,6
|
||||
|
||||
# 0 "" 2
|
||||
#NO_APP
|
||||
stw 10,48(31)
|
||||
stw 9,52(31)
|
||||
#APP
|
||||
# 14 "test-fp.c" 1
|
||||
# 37 "test-fp.c" 1
|
||||
li 0,1
|
||||
sc
|
||||
# 0 "" 2
|
||||
#NO_APP
|
||||
nop
|
||||
addi 1,31,96
|
||||
addi 1,31,144
|
||||
ld 31,-8(1)
|
||||
blr
|
||||
.long 0
|
||||
@ -52,4 +99,7 @@ sc
|
||||
.align 2
|
||||
.LC0:
|
||||
.long 1110808986
|
||||
.align 2
|
||||
.LC1:
|
||||
.long 1066192077
|
||||
.ident "GCC: (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"
|
||||
|
@ -1,3 +1,3 @@
|
||||
R { funcs = [(0x10000148, [(0x10000148, 84)])]
|
||||
, ignoreBlocks = [0x1000019c]
|
||||
R { funcs = [(0x10000148, [(0x10000148, 252)])]
|
||||
, ignoreBlocks = [0x10000244]
|
||||
}
|
Loading…
Reference in New Issue
Block a user