Commit 64b8a61
x86/x64: Don't use undefined MUL/IMUL zero flag.
Reported by VrIgHtEr.
(cherry picked from commit c92d0cb)
When emitting the arithmetic operations on registers via the
`asm_intarith()`, the next `test` instruction may be dropped since the
flag register is modified by the arithmetic instruction to be emitted.
But the `imul` instruction [1] doesn't modify ZF, so its value is
undefined. This patch prevents dropping the `test` instruction if
the emitted instruction is `imul`.
Sergey Kaplun:
* added the description and the test for the problem
[1]: https://www.felixcloutier.com/x86/imul
Part of tarantool/tarantool#11691
Reviewed-by: Sergey Bronnikov <[email protected]>
Signed-off-by: Sergey Kaplun <[email protected]>
(cherry picked from commit bb02057)1 parent d1d1936 commit 64b8a61
File tree
2 files changed
+40
-1
lines changed- src
- test/tarantool-tests
2 files changed
+40
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2061 | 2061 | | |
2062 | 2062 | | |
2063 | 2063 | | |
2064 | | - | |
| 2064 | + | |
| 2065 | + | |
2065 | 2066 | | |
2066 | 2067 | | |
2067 | 2068 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments