Skip to content

Commit d72c5fb

Browse files
gretay-jspoechsel
authored andcommitted
flambda-backend: Remove Cmm.memory_chunk.Double_u (ocaml#42)
* Add missing case for Ispecific rdtsc in an exhaustive match * Remove Cmm.memory_chunk.Double_u All current targets treat Double_u the same as Double. * Update comment for Double * Remove Cmm.memory_chunk.Double_u All current targets treat Double_u the same as Double. * Update comment for Double * Fixup after a rebase
1 parent 9d34d99 commit d72c5fb

File tree

18 files changed

+40
-45
lines changed

18 files changed

+40
-45
lines changed

asmcomp/amd64/emit.mlp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ let emit_instr fallthrough i =
718718
I.movsxd (addressing addr DWORD i 0) dest
719719
| Single ->
720720
I.cvtss2sd (addressing addr REAL4 i 0) dest
721-
| Double | Double_u ->
721+
| Double ->
722722
I.movsd (addressing addr REAL8 i 0) dest
723723
end
724724
| Lop(Istore(chunk, addr, _)) ->
@@ -734,7 +734,7 @@ let emit_instr fallthrough i =
734734
| Single ->
735735
I.cvtsd2ss (arg i 0) xmm15;
736736
I.movss xmm15 (addressing addr REAL4 i 1)
737-
| Double | Double_u ->
737+
| Double ->
738738
I.movsd (arg i 0) (addressing addr REAL8 i 1)
739739
end
740740
| Lop(Ialloc { bytes = n; dbginfo }) ->

asmcomp/amd64/selection.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ method! select_operation op args dbg =
203203
self#select_floatarith false Idivf Ifloatdiv args
204204
| Cextcall("sqrt", _, _, false) ->
205205
begin match args with
206-
[Cop(Cload ((Double|Double_u as chunk), _), [loc], _dbg)] ->
206+
[Cop(Cload ((Double as chunk), _), [loc], _dbg)] ->
207207
let (addr, arg) = self#select_addressing chunk loc in
208208
(Ispecific(Ifloatsqrtf addr), [arg])
209209
| [arg] ->
@@ -251,11 +251,11 @@ method! select_operation op args dbg =
251251

252252
method select_floatarith commutative regular_op mem_op args =
253253
match args with
254-
[arg1; Cop(Cload ((Double|Double_u as chunk), _), [loc2], _)] ->
254+
[arg1; Cop(Cload ((Double as chunk), _), [loc2], _)] ->
255255
let (addr, arg2) = self#select_addressing chunk loc2 in
256256
(Ispecific(Ifloatarithmem(mem_op, addr)),
257257
[arg1; arg2])
258-
| [Cop(Cload ((Double|Double_u as chunk), _), [loc1], _); arg2]
258+
| [Cop(Cload ((Double as chunk), _), [loc1], _); arg2]
259259
when commutative ->
260260
let (addr, arg1) = self#select_addressing chunk loc1 in
261261
(Ispecific(Ifloatarithmem(mem_op, addr)),

asmcomp/arm/emit.mlp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ let emit_instr i =
578578
| Lop(Iload(Single, addr)) when !fpu >= VFPv2 ->
579579
` flds s14, {emit_addressing addr i.arg 0}\n`;
580580
` fcvtds {emit_reg i.res.(0)}, s14\n`; 2
581-
| Lop(Iload((Double | Double_u), addr)) when !fpu = Soft ->
581+
| Lop(Iload(Double, addr)) when !fpu = Soft ->
582582
(* Use LDM or LDRD if possible *)
583583
begin match i.res.(0), i.res.(1), addr with
584584
{loc = Reg rt}, {loc = Reg rt2}, Iindexed 0
@@ -605,14 +605,13 @@ let emit_instr i =
605605
| Byte_signed -> "ldrsb"
606606
| Sixteen_unsigned -> "ldrh"
607607
| Sixteen_signed -> "ldrsh"
608-
| Double
609-
| Double_u -> "fldd"
608+
| Double -> "fldd"
610609
| _ (* 32-bit quantities *) -> "ldr" in
611610
` {emit_string instr} {emit_reg r}, {emit_addressing addr i.arg 0}\n`; 1
612611
| Lop(Istore(Single, addr, _)) when !fpu >= VFPv2 ->
613612
` fcvtsd s14, {emit_reg i.arg.(0)}\n`;
614613
` fsts s14, {emit_addressing addr i.arg 1}\n`; 2
615-
| Lop(Istore((Double | Double_u), addr, _)) when !fpu = Soft ->
614+
| Lop(Istore(Double, addr, _)) when !fpu = Soft ->
616615
(* Use STM or STRD if possible *)
617616
begin match i.arg.(0), i.arg.(1), addr with
618617
{loc = Reg rt}, {loc = Reg rt2}, Iindexed 0
@@ -634,8 +633,7 @@ let emit_instr i =
634633
| Byte_signed -> "strb"
635634
| Sixteen_unsigned
636635
| Sixteen_signed -> "strh"
637-
| Double
638-
| Double_u -> "fstd"
636+
| Double -> "fstd"
639637
| _ (* 32-bit quantities *) -> "str" in
640638
` {emit_string instr} {emit_reg r}, {emit_addressing addr i.arg 1}\n`; 1
641639
| Lop(Ialloc { bytes = n; dbginfo }) ->

asmcomp/arm/selection.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ open Mach
2424
let is_offset chunk n =
2525
match chunk with
2626
(* VFPv{2,3} load/store have -1020 to 1020. Offset must be multiple of 4 *)
27-
| Single | Double | Double_u
27+
| Single | Double
2828
when !fpu >= VFPv2 ->
2929
n >= -1020 && n <= 1020 && n mod 4 = 0
3030
(* ARM load/store byte/word have -4095 to 4095 *)

asmcomp/arm64/emit.mlp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ let emit_instr i =
744744
| Single ->
745745
` ldr s7, {emit_addressing addr base}\n`;
746746
` fcvt {emit_reg dst}, s7\n`
747-
| Word_int | Word_val | Double | Double_u ->
747+
| Word_int | Word_val | Double ->
748748
` ldr {emit_reg dst}, {emit_addressing addr base}\n`
749749
end
750750
| Lop(Istore(size, addr, _)) ->
@@ -766,7 +766,7 @@ let emit_instr i =
766766
| Single ->
767767
` fcvt s7, {emit_reg src}\n`;
768768
` str s7, {emit_addressing addr base}\n`;
769-
| Word_int | Word_val | Double | Double_u ->
769+
| Word_int | Word_val | Double ->
770770
` str {emit_reg src}, {emit_addressing addr base}\n`
771771
end
772772
| Lop(Ialloc { bytes = n; dbginfo }) ->

asmcomp/arm64/selection.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ let is_offset chunk n =
3131
n land 1 = 0 && n lsr 1 < 0x1000
3232
| Thirtytwo_unsigned | Thirtytwo_signed | Single ->
3333
n land 3 = 0 && n lsr 2 < 0x1000
34-
| Word_int | Word_val | Double | Double_u ->
34+
| Word_int | Word_val | Double ->
3535
n land 7 = 0 && n lsr 3 < 0x1000)
3636

3737
(* An automaton to recognize ( 0+1+0* | 1+0+1* )

asmcomp/cmm.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ type memory_chunk =
146146
| Word_val
147147
| Single
148148
| Double
149-
| Double_u
150149

151150
and operation =
152151
Capply of machtype

asmcomp/cmm.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ type memory_chunk =
135135
| Word_int (* integer or pointer outside heap *)
136136
| Word_val (* pointer inside heap or encoded int *)
137137
| Single
138-
| Double (* 64-bit-aligned 64-bit float *)
139-
| Double_u (* word-aligned 64-bit float *)
138+
| Double (* word-aligned 64-bit float
139+
see PR#10433 *)
140140

141141
and operation =
142142
Capply of machtype

asmcomp/cmm_helpers.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -569,18 +569,18 @@ let unbox_float dbg =
569569
| Some (Uconst_float x) ->
570570
Cconst_float (x, dbg) (* or keep _dbg? *)
571571
| _ ->
572-
Cop(Cload (Double_u, Immutable), [cmm], dbg)
572+
Cop(Cload (Double, Immutable), [cmm], dbg)
573573
end
574-
| cmm -> Cop(Cload (Double_u, Immutable), [cmm], dbg)
574+
| cmm -> Cop(Cload (Double, Immutable), [cmm], dbg)
575575
)
576576

577577
(* Complex *)
578578

579579
let box_complex dbg c_re c_im =
580580
Cop(Calloc, [alloc_floatarray_header 2 dbg; c_re; c_im], dbg)
581581

582-
let complex_re c dbg = Cop(Cload (Double_u, Immutable), [c], dbg)
583-
let complex_im c dbg = Cop(Cload (Double_u, Immutable),
582+
let complex_re c dbg = Cop(Cload (Double, Immutable), [c], dbg)
583+
let complex_im c dbg = Cop(Cload (Double, Immutable),
584584
[Cop(Cadda, [c; Cconst_int (size_float, dbg)], dbg)],
585585
dbg)
586586

@@ -728,7 +728,7 @@ let int_array_ref arr ofs dbg =
728728
Cop(Cload (Word_int, Mutable),
729729
[array_indexing log2_size_addr arr ofs dbg], dbg)
730730
let unboxed_float_array_ref arr ofs dbg =
731-
Cop(Cload (Double_u, Mutable),
731+
Cop(Cload (Double, Mutable),
732732
[array_indexing log2_size_float arr ofs dbg], dbg)
733733
let float_array_ref arr ofs dbg =
734734
box_float dbg (unboxed_float_array_ref arr ofs dbg)
@@ -743,7 +743,7 @@ let int_array_set arr ofs newval dbg =
743743
Cop(Cstore (Word_int, Lambda.Assignment),
744744
[array_indexing log2_size_addr arr ofs dbg; newval], dbg)
745745
let float_array_set arr ofs newval dbg =
746-
Cop(Cstore (Double_u, Lambda.Assignment),
746+
Cop(Cstore (Double, Lambda.Assignment),
747747
[array_indexing log2_size_float arr ofs dbg; newval], dbg)
748748

749749
(* String length *)
@@ -2094,7 +2094,7 @@ let generic_functions shared units =
20942094
type unary_primitive = expression -> Debuginfo.t -> expression
20952095

20962096
let floatfield n ptr dbg =
2097-
Cop(Cload (Double_u, Mutable),
2097+
Cop(Cload (Double, Mutable),
20982098
[if n = 0 then ptr
20992099
else Cop(Cadda, [ptr; Cconst_int(n * size_float, dbg)], dbg)],
21002100
dbg)
@@ -2198,7 +2198,7 @@ let setfield n ptr init arg1 arg2 dbg =
21982198

21992199
let setfloatfield n init arg1 arg2 dbg =
22002200
return_unit dbg (
2201-
Cop(Cstore (Double_u, init),
2201+
Cop(Cstore (Double, init),
22022202
[if n = 0 then arg1
22032203
else Cop(Cadda, [arg1; Cconst_int(n * size_float, dbg)], dbg);
22042204
arg2], dbg))

asmcomp/i386/CSE.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ method! class_of_operation op =
2929
(* Operations that affect the floating-point stack cannot be factored *)
3030
| Iconst_float _ | Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf
3131
| Iintoffloat | Ifloatofint
32-
| Iload((Single | Double | Double_u), _) -> Op_other
32+
| Iload((Single | Double), _) -> Op_other
3333
(* Specific ops *)
3434
| Ispecific(Ilea _) -> Op_pure
3535
| Ispecific(Istore_int(_, _, is_asg)) -> Op_store is_asg

0 commit comments

Comments
 (0)