projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Changed keep logic: all nodes can be keeped yet, thi is necessary to fix fehler152
[libfirm]
/
ir
/
ir
/
irmode.c
diff --git
a/ir/ir/irmode.c
b/ir/ir/irmode.c
index
0a41285
..
b59c13c
100644
(file)
--- a/
ir/ir/irmode.c
+++ b/
ir/ir/irmode.c
@@
-536,11
+536,11
@@
int smaller_mode(const ir_mode *sm, const ir_mode *lm) {
case irms_int_number:
switch (get_mode_sort(lm)) {
case irms_int_number:
case irms_int_number:
switch (get_mode_sort(lm)) {
case irms_int_number:
- if(get_mode_arithmetic(sm) != get_mode_arithmetic(lm))
+ if
(get_mode_arithmetic(sm) != get_mode_arithmetic(lm))
return 0;
/* only two complement implemented */
return 0;
/* only two complement implemented */
- assert(get_mode_arithmetic(sm)
==
irma_twos_complement);
+ assert(get_mode_arithmetic(sm)
==
irma_twos_complement);
/* integers are convertable if
* - both have the same sign and lm is the larger one
/* integers are convertable if
* - both have the same sign and lm is the larger one
@@
-548,12
+548,12
@@
int smaller_mode(const ir_mode *sm, const ir_mode *lm) {
* (one for the sign, one for the highest bit of sm)
* - sm & lm are two_complement and lm has greater or equal number of bits
*/
* (one for the sign, one for the highest bit of sm)
* - sm & lm are two_complement and lm has greater or equal number of bits
*/
- if(mode_is_signed(sm)) {
- if(!mode_is_signed(lm))
+ if
(mode_is_signed(sm)) {
+ if
(!mode_is_signed(lm))
return 0;
return sm_bits <= lm_bits;
} else {
return 0;
return sm_bits <= lm_bits;
} else {
- if(mode_is_signed(lm)) {
+ if
(mode_is_signed(lm)) {
return sm_bits < lm_bits;
}
return sm_bits <= lm_bits;
return sm_bits < lm_bits;
}
return sm_bits <= lm_bits;
@@
-843,7
+843,11
@@
void init_mode(void) {
ir_mode *find_unsigned_mode(const ir_mode *mode) {
ir_mode n = *mode;
ir_mode *find_unsigned_mode(const ir_mode *mode) {
ir_mode n = *mode;
- assert(mode->sort == irms_int_number);
+ /* allowed for reference mode */
+ if (mode->sort == irms_reference)
+ n.sort = irms_int_number;
+
+ assert(n.sort == irms_int_number);
n.sign = 0;
return find_mode(&n);
}
n.sign = 0;
return find_mode(&n);
}