Commit c44fc24e authored by Léo Gourdin's avatar Léo Gourdin
Browse files

removing some Expansion when loading float/single constants

parent 3bf9a4fc
...@@ -825,22 +825,28 @@ let expanse (sb : superblock) code pm = ...@@ -825,22 +825,28 @@ let expanse (sb : superblock) code pm =
| _ -> ()); | _ -> ());
(if !Clflags.option_fexpanse_others && not !was_exp then (if !Clflags.option_fexpanse_others && not !was_exp then
match inst with match inst with
| Iop (Ofloatconst f, nil, dest, succ) -> | Iop (Ofloatconst f, nil, dest, succ) -> (
debug "Iop/Ofloatconst\n"; match make_immed64 (Floats.Float.to_bits f) with
let r = r2pi () in | Imm64_single _ | Imm64_large _ -> ()
let l = loadimm64 vn r (Floats.Float.to_bits f) in | Imm64_pair (hi, lo) ->
let r', l' = extract_arg l in debug "Iop/Ofloatconst\n";
exp := addinst vn Ofloat_of_bits [ r' ] dest :: l'; let r = r2pi () in
exp := extract_final vn !exp dest succ; let l = load_hilo64 vn r hi lo in
was_exp := true let r', l' = extract_arg l in
| Iop (Osingleconst f, nil, dest, succ) -> exp := addinst vn Ofloat_of_bits [ r' ] dest :: l';
debug "Iop/Osingleconst\n"; exp := extract_final vn !exp dest succ;
let r = r2pi () in was_exp := true)
let l = loadimm32 vn r (Floats.Float32.to_bits f) in | Iop (Osingleconst f, nil, dest, succ) -> (
let r', l' = extract_arg l in match make_immed32 (Floats.Float32.to_bits f) with
exp := addinst vn Osingle_of_bits [ r' ] dest :: l'; | Imm32_single imm -> ()
exp := extract_final vn !exp dest succ; | Imm32_pair (hi, lo) ->
was_exp := true debug "Iop/Osingleconst\n";
let r = r2pi () in
let l = load_hilo32 vn r hi lo in
let r', l' = extract_arg l in
exp := addinst vn Osingle_of_bits [ r' ] dest :: l';
exp := extract_final vn !exp dest succ;
was_exp := true)
| Iop (Ointconst n, nil, dest, succ) -> | Iop (Ointconst n, nil, dest, succ) ->
debug "Iop/Ointconst\n"; debug "Iop/Ointconst\n";
exp := loadimm32 vn dest n; exp := loadimm32 vn dest n;
......
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