Skip to content

Commit a93bd9d

Browse files
committedNov 11, 2024
8343810: [s390x] is_uimm* methods should take unsigned arguments
Reviewed-by: lucy
1 parent f12c370 commit a93bd9d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed
 

‎src/hotspot/cpu/s390/assembler_s390.hpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,23 @@ class Immediate {
5656
}
5757

5858
// Test if x is within signed immediate range for nbits.
59-
static bool is_uimm(int64_t x, unsigned int nbits) {
59+
static bool is_uimm(uint64_t x, unsigned int nbits) {
6060
// nbits == 0 --> false
6161
// nbits >= 64 --> true
6262
assert(1 <= nbits && nbits < 64, "don't call, use statically known result");
63-
const uint64_t xu = (unsigned long)x;
6463
const uint64_t maxplus1 = 1UL << nbits;
65-
return xu < maxplus1; // Unsigned comparison. Negative inputs appear to be very large.
64+
return x < maxplus1; // Unsigned comparison. Negative inputs appear to be very large.
6665
}
67-
static bool is_uimm32(int64_t x) {
66+
static bool is_uimm32(uint64_t x) {
6867
return is_uimm(x, 32);
6968
}
70-
static bool is_uimm16(int64_t x) {
69+
static bool is_uimm16(uint64_t x) {
7170
return is_uimm(x, 16);
7271
}
73-
static bool is_uimm12(int64_t x) {
72+
static bool is_uimm12(uint64_t x) {
7473
return is_uimm(x, 12);
7574
}
76-
static bool is_uimm8(int64_t x) {
75+
static bool is_uimm8(uint64_t x) {
7776
return is_uimm(x, 8);
7877
}
7978
};

0 commit comments

Comments
 (0)
Please sign in to comment.