Skip to content

Commit

Permalink
Ensure DS-form offset is a multiple of 4
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Mar 19, 2021
1 parent 601b93b commit 84acfd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -97,6 +97,10 @@ Working version
- #10244: Optimise Int32.unsigned_to_int
(Fabian Hemmer, review by Stephen Dolan and Xavier Leroy)

- #10302, #10303: Fix incorrect instruction selection for string constant loads
on ppc.
(David Allsopp, review by ???)

### Type system:

* #10081: Typecheck `x |> f` and `f @@ x` as `(f x)`
Expand Down
7 changes: 6 additions & 1 deletion asmcomp/power/emit.mlp
Expand Up @@ -244,7 +244,12 @@ let emit_load_store instr addressing_mode addr n arg =
let (lo, hi) = low_high_s d in
if hi <> 0 then
` addis 11, 11, {emit_int hi}\n`;
` {emit_string instr} {emit_reg arg}, {emit_int lo}(11)\n`
if valid_offset instr lo then
` {emit_string instr} {emit_reg arg}, {emit_int lo}(11)\n`
else begin
` li 0, {emit_int lo}\n`;
` {emit_string instr}x {emit_reg arg}, 11, 0\n`
end
end
| Iindexed ofs ->
if is_immediate ofs && valid_offset instr ofs then
Expand Down

0 comments on commit 84acfd7

Please sign in to comment.