File tree 2 files changed +51
-6
lines changed 2 files changed +51
-6
lines changed Original file line number Diff line number Diff line change @@ -83,20 +83,19 @@ let size_float = 8
83
83
84
84
let size_vec128 = 16
85
85
86
- let allow_unaligned_access = true
86
+ let allow_unaligned_access = true
87
87
88
88
(* Behavior of division *)
89
89
90
90
let division_crashes_on_overflow = false
91
91
92
92
(* Operations on addressing modes *)
93
93
94
- let identity_addressing = Iindexed 0
94
+ let identity_addressing =
95
+ Misc. fatal_error " Arch.identity_addressing not supported"
95
96
96
- let offset_addressing addr delta =
97
- match addr with
98
- | Iindexed n -> Iindexed (n + delta)
99
- | Ibased (s , n ) -> Ibased (s, n + delta)
97
+ let offset_addressing _addr _delta =
98
+ Misc. fatal_error " Arch.offset_addressing not supported"
100
99
101
100
let num_args_addressing = function
102
101
| Iindexed _ -> 1
Original file line number Diff line number Diff line change @@ -173,6 +173,52 @@ class selector =
173
173
(* Other operations are regular *)
174
174
| _ -> super#select_operation op args dbg ~label_after
175
175
176
+ method! emit_stores env dbg data regs_addr =
177
+ let offset = ref (- Arch. size_int) in
178
+ let base =
179
+ assert (Array. length regs_addr = 1 );
180
+ ref regs_addr
181
+ in
182
+ List. iter
183
+ (fun arg ->
184
+ match self#emit_expr env arg ~bound_name: None with
185
+ | None -> assert false
186
+ | Some regs ->
187
+ for i = 0 to Array. length regs - 1 do
188
+ let r = regs.(i) in
189
+ let kind =
190
+ match r.Reg. typ with
191
+ | Float -> Double
192
+ | Float32 -> Single { reg = Float32 }
193
+ | Vec128 ->
194
+ (* 128-bit memory operations are default unaligned. Aligned
195
+ (big)array operations are handled separately via cmm. *)
196
+ Onetwentyeight_unaligned
197
+ | Val | Addr | Int -> Word_val
198
+ | Valx2 ->
199
+ Misc. fatal_error " Unexpected machtype_component Valx2"
200
+ in
201
+ if not (Selection_utils. is_offset kind ! offset)
202
+ then (
203
+ let tmp = self#regs_for typ_int in
204
+ self#insert_debug env
205
+ (self#lift_op
206
+ (self#make_const_int (Nativeint. of_int ! offset)))
207
+ dbg [||] tmp;
208
+ self#insert_debug env
209
+ (self#lift_op (Operation. Intop Iadd ))
210
+ dbg (Array. append ! base tmp) tmp;
211
+ base := tmp;
212
+ offset := 0 );
213
+ self#insert_debug env
214
+ (self#make_store kind (Iindexed ! offset) false )
215
+ dbg
216
+ (Array. append [| r |] ! base)
217
+ [||];
218
+ offset := ! offset + Select_utils. size_component r.Reg. typ
219
+ done )
220
+ data
221
+
176
222
method! insert_move_extcall_arg env ty_arg src dst =
177
223
let ty_arg_is_int32 =
178
224
match ty_arg with
You can’t perform that action at this time.
0 commit comments