From 59a1fde2a1421561f57d7b931883cb7ce1739e9d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 3 Apr 2022 20:37:09 -0400 Subject: [PATCH] Fix is_zero_mask. --- InstructionSets/PowerPC/Instruction.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InstructionSets/PowerPC/Instruction.hpp b/InstructionSets/PowerPC/Instruction.hpp index b0b742791..89d6959d7 100644 --- a/InstructionSets/PowerPC/Instruction.hpp +++ b/InstructionSets/PowerPC/Instruction.hpp @@ -59,9 +59,9 @@ enum class BranchOption: uint32_t { /// @returns @c 0 if reg == 0; @c ~0 otherwise. /// @discussion Provides a branchless way to substitute the value 0 for the value of r0 -/// in affected instructions. +/// in affected instructions. Assumes arithmetic shifts. template constexpr IntT is_zero_mask(uint32_t reg) { - return ~IntT((reg - 1) >> 5); + return ~IntT((int(reg) - 1) >> 5); } enum class Operation: uint8_t {