diff options
author | Björn Gustavsson <[email protected]> | 2019-03-05 16:37:08 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-03-06 15:42:44 +0100 |
commit | 7128f182ac4051b45bb0f526d8983f5ada1e12f0 (patch) | |
tree | 60c9fa7fe462bc3583ccf639d42cab6e4b44096c /erts/emulator | |
parent | 8eb6e937c4c5aa4c86142f37f1455637f7e8a20a (diff) | |
download | otp-7128f182ac4051b45bb0f526d8983f5ada1e12f0.tar.gz otp-7128f182ac4051b45bb0f526d8983f5ada1e12f0.tar.bz2 otp-7128f182ac4051b45bb0f526d8983f5ada1e12f0.zip |
Slightly optimize is_eq and is_ne
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/instrs.tab | 12 | ||||
-rw-r--r-- | erts/emulator/beam/ops.tab | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab index 5b81517359..1eb83b61f2 100644 --- a/erts/emulator/beam/instrs.tab +++ b/erts/emulator/beam/instrs.tab @@ -884,12 +884,16 @@ i_is_ne_exact_literal(Fail, Src, Literal) { } } -is_eq(Fail, X, Y) { - CMP_EQ_ACTION($X, $Y, $FAIL($Fail)); +is_eq(Fail, A, B) { + Eterm a = $A; + Eterm b = $B; + CMP_EQ_ACTION(a, b, $FAIL($Fail)); } -is_ne(Fail, X, Y) { - CMP_NE_ACTION($X, $Y, $FAIL($Fail)); +is_ne(Fail, A, B) { + Eterm a = $A; + Eterm b = $B; + CMP_NE_ACTION(a, b, $FAIL($Fail)); } is_lt(Fail, X, Y) { diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 4e7e5f5de1..ef26afc10a 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -489,9 +489,13 @@ is_ge f? c x is_ge f? s s %hot -is_eq f? s s +is_eq Fail=f Const=c Reg=xy => is_eq Fail Reg Const +is_eq Fail=f C1=c C2=c => move C1 x | is_eq Fail x C2 +is_eq f? S s -is_ne f? s s +is_ne Fail=f Const=c Reg=xy => is_ne Fail Reg Const +is_ne Fail=f C1=c C2=c => move C1 x | is_ne Fail x C2 +is_ne f? S s # # Putting tuples. |