mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-07-20 22:57:39 -04:00
Avoid mem cmp mem in trans even though it's an X86ism becase we don't always catch it later on.
This commit is contained in:
+11
-1
@@ -625,7 +625,17 @@ let trans_visitor
|
||||
let op_b = sub_sz b in
|
||||
let tmp = next_vreg_cell word_sty in
|
||||
mov tmp op_a;
|
||||
emit (Il.cmp op_a op_b);
|
||||
(*
|
||||
* FIXME: X86-ism going via a vreg; mem op= mem doesn't
|
||||
* work and IL lacks sufficient brains to cope just now.
|
||||
* Instead, should be
|
||||
*
|
||||
* emit (Il.cmp op_a op_b)
|
||||
*
|
||||
* Luckily this isn't the worst hack since we already
|
||||
* needed a tmp vreg for op_a.
|
||||
*)
|
||||
emit (Il.cmp (Il.Cell tmp) op_b);
|
||||
let jmp = mark () in
|
||||
emit (Il.jmp Il.JAE Il.CodeNone);
|
||||
mov tmp op_b;
|
||||
|
||||
Reference in New Issue
Block a user