diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-07 15:41:53 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-07 15:41:53 +0200 |
commit | 5ba2022b8e67e28bf7dbd02a7eb5d19ba90aadb7 (patch) | |
tree | 4bd939520902e0e0ed78149de2774f966d62ce55 /DevTools/UserspaceEmulator/SoftCPU.h | |
parent | 3b3d1586495a88249f4a48c1ffd9fa650431467d (diff) | |
download | serenity-5ba2022b8e67e28bf7dbd02a7eb5d19ba90aadb7.zip |
UserspaceEmulator: Result is initialized after OR with all-1 immediate
When compiling with "-Os", GCC produces the following pattern for
atomic decrement (which is used by our RefCounted template):
or eax, -1
lock xadd [destination], eax
Since or-ing with -1 will always produce the same output (-1), we can
mark the result of these operations as initialized. This stops us from
complaining about false positives when running the shell in UE. :^)
Diffstat (limited to 'DevTools/UserspaceEmulator/SoftCPU.h')
-rw-r--r-- | DevTools/UserspaceEmulator/SoftCPU.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/DevTools/UserspaceEmulator/SoftCPU.h b/DevTools/UserspaceEmulator/SoftCPU.h index c78eddcaf4..16b3c140a6 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.h +++ b/DevTools/UserspaceEmulator/SoftCPU.h @@ -1048,29 +1048,29 @@ private: virtual void wrap_0xD3_16(const X86::Instruction&) override; virtual void wrap_0xD3_32(const X86::Instruction&) override; - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_AL_imm8(Op, const X86::Instruction&); - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_AX_imm16(Op, const X86::Instruction&); - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_EAX_imm32(Op, const X86::Instruction&); - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_RM16_imm16(Op, const X86::Instruction&); - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_RM16_imm8(Op, const X86::Instruction&); template<bool update_dest, typename Op> void generic_RM16_unsigned_imm8(Op, const X86::Instruction&); template<bool update_dest, bool is_zero_idiom_if_both_operands_same, typename Op> void generic_RM16_reg16(Op, const X86::Instruction&); - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_RM32_imm32(Op, const X86::Instruction&); - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_RM32_imm8(Op, const X86::Instruction&); template<bool update_dest, typename Op> void generic_RM32_unsigned_imm8(Op, const X86::Instruction&); template<bool update_dest, bool is_zero_idiom_if_both_operands_same, typename Op> void generic_RM32_reg32(Op, const X86::Instruction&); - template<bool update_dest, typename Op> + template<bool update_dest, bool is_or, typename Op> void generic_RM8_imm8(Op, const X86::Instruction&); template<bool update_dest, bool is_zero_idiom_if_both_operands_same, typename Op> void generic_RM8_reg8(Op, const X86::Instruction&); |