Commit 558e8eea authored by Axel Simon's avatar Axel Simon

merge

parents 939e09f7 46b8f201
020dca84d06f508ce7c75112dbc5406a03c2dc49 big_dis.c
cbf435b9283c831cae4225ec5d6c500ec814d73b inference_bug
......@@ -35,7 +35,7 @@ main:
#mulq (%ebx)
#movsq
#rep movsq
rep movsq
#movbeq (%rax), %rbx
......@@ -93,7 +93,7 @@ main:
#cdqe
add %rax, %rax
#add (%rax), %rax
#inc %rax
#blah:
......
......@@ -235,13 +235,12 @@ val sem-mul conv x = do
factor0-sem <- return (semantic-register-of (register-by-size low A sz));
factor0 <- mktemp;
expand factor0 conv (var factor0-sem) sz (sz + sz);
factor0 <- expand mktemp conv (var factor0-sem) sz (sz + sz);
factor1 <- reads conv (sz + sz) x.opnd1;
product <- mktemp;
mul (sz + sz) product (var factor0) factor1;
mul (sz + sz) product factor0 factor1;
emit-mul-flags sz product;
......@@ -522,8 +521,6 @@ val sem-pand-vpand-opnd avx-encoded opnd1 opnd2 opnd3 = do
write-extend avx-encoded size dst (var temp)
end
### => Subscope <=
val sem-pand x = sem-pand-vpand-opnd '0' x.opnd1 x.opnd1 x.opnd2
val sem-vpand x = sem-pand-vpand-opnd '1' x.opnd1 x.opnd2 x.opnd3
......@@ -621,7 +618,6 @@ val sem-pblend-vpblend-opnd bit-selector avx-encoded element-size opnd1 opnd2 op
mov element-size (at-offset temp-dst offset) (var (at-offset temp-src1 offset))
else
return void
end
in
vector-apply size element-size m
......@@ -829,7 +825,6 @@ val sem-phbinop-vphbinop-opnd avx-encoded element-size operator opnd1 opnd2 opnd
mov size (at-offset temp-src size) src2;
temp-dst <- mktemp;
let
val m i = do
dst-offset <- return (element-size*i);
......@@ -937,7 +932,6 @@ val sem-pmcombine-opnd avx-encoded element-size combiner mover1 mover2 opnd1 opn
local-src2 <- mktemp;
local-dst1 <- mktemp;
local-dst2 <- mktemp;
let
val m i = do
offset <- return (2*element-size*i);
......@@ -981,7 +975,6 @@ val sem-pcomp-opnd avx-encoded comparer element-size opnd1 opnd2 opnd3 = do
mov size temp-src2 src2;
temp-dst <- mktemp;
let
val m i = do
offset <- return (element-size*i);
......@@ -1051,7 +1044,6 @@ val sem-pmovex-vpmovex avx-encoded mover from-size to-size x = do
mov src-size temp-src src;
temp-dst <- mktemp;
let
val m i = do
src-offset <- return (from-size*i);
......@@ -1083,7 +1075,6 @@ val sem-pmuldq-vpmuldq-opnd avx-encoded opnd1 opnd2 opnd3 = do
mov size temp-src2 src2;
temp-dst <- mktemp;
let
val m offset = do
movsx (2*element-size) temp-src1 element-size (var (at-offset temp-src1 offset));
......@@ -1397,7 +1388,6 @@ val sem-psadbw-vpsadbw-opnd avx-encoded opnd1 opnd2 opnd3 = do
mov size temp-src2 src2;
temp-dst <- mktemp;
diff-element-size <- return 8;
let
val m i = do
......@@ -1405,7 +1395,7 @@ val sem-psadbw-vpsadbw-opnd avx-encoded opnd1 opnd2 opnd3 = do
_if (/gtu diff-element-size (var (at-offset temp-src1 offset)) (var (at-offset temp-src2 offset))) _then
sub diff-element-size (at-offset temp-dst offset) (var (at-offset temp-src1 offset)) (var (at-offset temp-src2 offset))
_else
_else
sub diff-element-size (at-offset temp-dst offset) (var (at-offset temp-src2 offset)) (var (at-offset temp-src1 offset))
end
in
......@@ -1431,22 +1421,6 @@ val sem-psadbw-vpsadbw-opnd avx-encoded opnd1 opnd2 opnd3 = do
end;
mov sum-element-size (at-offset temp-dst offset) (var temp-sum)
#Todo: Loop?!
#movzx ex-size temp-sum-ex diff-element-size (var (at-offset temp-dst (offset + diff-element-size)));
#add ex-size temp-sum (var temp-sum) (var temp-sum-ex);
#movzx ex-size temp-sum-ex diff-element-size (var (at-offset temp-dst (offset + (2*diff-element-size))));
#add ex-size temp-sum (var temp-sum) (var temp-sum-ex);
#movzx ex-size temp-sum-ex diff-element-size (var (at-offset temp-dst (offset + (3*diff-element-size))));
#add ex-size temp-sum (var temp-sum) (var temp-sum-ex);
#movzx ex-size temp-sum-ex diff-element-size (var (at-offset temp-dst (offset + (4*diff-element-size))));
#add ex-size temp-sum (var temp-sum) (var temp-sum-ex);
#movzx ex-size temp-sum-ex diff-element-size (var (at-offset temp-dst (offset + (5*diff-element-size))));
#add ex-size temp-sum (var temp-sum) (var temp-sum-ex);
#movzx ex-size temp-sum-ex diff-element-size (var (at-offset temp-dst (offset + (6*diff-element-size))));
#add ex-size temp-sum (var temp-sum) (var temp-sum-ex);
#movzx ex-size temp-sum-ex diff-element-size (var (at-offset temp-dst (offset + (7*diff-element-size))));
#add ex-size temp-sum (var temp-sum) (var temp-sum-ex)
end
in
vector-apply size sum-element-size m
......@@ -1510,7 +1484,6 @@ val sem-pshuf-vdhwlw avx-encoded element-size low-size high-size x = do
);
temp-dst <- mktemp;
if low-size > 0 then
mov low-size temp-dst (var temp-src)
else
......@@ -2074,17 +2047,13 @@ end
val sem-rep-repe-repne size sem fc = do
count-reg <- return (semantic-register-of (register-by-size low C size));
cond-creg <- let
val v = /neq size (var count-reg) (imm 0)
in
return v
end;
cond-creg <- return (/neq size (var count-reg) (imm 0));
cond <- mktemp;
c <- cond-creg;
mov 1 cond c;
_while (/d (var cond)) __ do
sem;
with-subscope sem;
sub size count-reg (var count-reg) (imm 1);
......
......@@ -62,14 +62,17 @@ type signedness =
Signed
| Unsigned
val expand expanded conv lin from-sz to-sz =
val expand dst-getter conv lin from-sz to-sz =
if from-sz === to-sz then
mov to-sz expanded lin
else
return lin
else do
expanded <- dst-getter;
case conv of
Signed: movsx to-sz expanded from-sz lin
| Unsigned: movzx to-sz expanded from-sz lin
end
end;
return (var expanded)
end
val segment-add mode64 address segment = let
val seg-sem seg-reg = SEM_LIN_VAR(semantic-register-of seg-reg)
......@@ -99,9 +102,8 @@ val segmented-lin lin sz segment = do
real-addr-sz <- real-addr-sz;
mode64 <- mode64?;
expanded <- mktemp;
expand expanded Unsigned lin sz real-addr-sz;
return (segment-add mode64 (var expanded) segment)
expanded <- expand mktemp Unsigned lin sz real-addr-sz;
return (segment-add mode64 expanded segment)
end
val segmented-reg reg segment = segmented-lin (var reg) reg.size segment
......@@ -142,9 +144,8 @@ val conv-with conv sz x =
val conv-reg conv sz r = do
reg <- return (semantic-register-of r);
expanded <- mktemp;
expand expanded conv (var reg) reg.size sz;
return (var expanded)
expanded <- expand mktemp conv (var reg) reg.size sz;
return expanded
end
val conv-sum conv sz x =
......@@ -183,18 +184,18 @@ val conv-with conv sz x =
| MEM x:
let
val m expanded = do
t <- mktemp;
address <- conv-mem x;
segmented-load x.sz t x.psz address x.segment;
expand expanded conv (var t) x.sz sz;
return (var expanded)
segmented-load x.sz expanded x.psz address x.segment;
expanded <- expand (return expanded) conv (var expanded) x.sz sz;
return expanded
end
in do
#address <- conv-mem x;
address <- return (conv-mem x);
expanded <- mktemp;
with-subscope (m expanded);
return (var expanded)
expanded <- with-subscope (m expanded);
return expanded
end end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment