Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrection instruction selection for Ibased on ppc #10303

Merged
merged 2 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,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 Stephen Dolan)

- #10349: Fix destroyed_at_c_call on RISC-V
(Mark Shinwell, review by Nicolás Ojeda Bär)

Expand Down
7 changes: 6 additions & 1 deletion asmcomp/power/emit.mlp
Original file line number Diff line number Diff line change
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
1 change: 0 additions & 1 deletion testsuite/tests/lib-string/binary.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ let () =

let () =
let b = "\xfe\xdc\xba\x98\x76\x54\x32\x10\x01\x00" in
let b = Bytes.(to_string (copy (of_string b))) in
assert (String.get_int64_le b 0 = 0x1032547698badcfeL);
assert (String.get_int64_be b 0 = 0xfedcba9876543210L);
assert (String.get_int64_le b 1 = 0x011032547698badcL);
Expand Down