[llvm-dev] Signed or unsigned EQ/NEQ (original) (raw)
David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 18 02:22:53 PST 2017
- Previous message: [llvm-dev] Signed or unsigned EQ/NEQ
- Next message: [llvm-dev] Signed or unsigned EQ/NEQ
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 17 Nov 2017, at 21:11, Dounia Khaldi via llvm-dev <llvm-dev at lists.llvm.org> wrote:
The problem is that CmpInst::ICMPEQ and CmpInst::ICMPNE are neither signed nor unsigned in LLVM. Also, I did not find a way to find out if the integer operands of the CmpInst are signed or unsigned. Apparently, LLVM does not distinguish in its type system between signed and unsigned variables. So, I am not able to generate the appropriate signed or unsigned ICMP(S|U)LT or ICMP(S|U)GT.
In what way would you expect a signed and unsigned integer to differ in equality comparison? Two integers are equal if they have the same bit pattern, they are not equal if they do not. If you want help in constructing a signed and unsigned notion of equality then you’ll first have to define what you want it to mean, or you are unlikely to find anyone able to help.
David
- Previous message: [llvm-dev] Signed or unsigned EQ/NEQ
- Next message: [llvm-dev] Signed or unsigned EQ/NEQ
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]