aboutsummaryrefslogtreecommitdiff
path: root/opcodes/openrisc-ibld.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/openrisc-ibld.c')
-rw-r--r--opcodes/openrisc-ibld.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/opcodes/openrisc-ibld.c b/opcodes/openrisc-ibld.c
index 27f2ad6..29372a6 100644
--- a/opcodes/openrisc-ibld.c
+++ b/opcodes/openrisc-ibld.c
@@ -33,6 +33,7 @@
#include "symcat.h"
#include "openrisc-desc.h"
#include "openrisc-opc.h"
+#include "cgen/basic-modes.h"
#include "opintl.h"
#include "safe-ctype.h"
@@ -568,14 +569,14 @@ openrisc_cgen_insert_operand (CGEN_CPU_DESC cd,
case OPENRISC_OPERAND_ABS_26 :
{
long value = fields->f_abs26;
- value = ((int) (pc) >> (2));
+ value = ((SI) (pc) >> (2));
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_ABS_ADDR), 0, 25, 26, 32, total_length, buffer);
}
break;
case OPENRISC_OPERAND_DISP_26 :
{
long value = fields->f_disp26;
- value = ((int) (((value) - (pc))) >> (2));
+ value = ((SI) (((value) - (pc))) >> (2));
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 25, 26, 32, total_length, buffer);
}
break;
@@ -606,7 +607,7 @@ openrisc_cgen_insert_operand (CGEN_CPU_DESC cd,
case OPENRISC_OPERAND_UI16NC :
{
{
- FLD (f_i16_2) = ((((int) (FLD (f_i16nc)) >> (11))) & (31));
+ FLD (f_i16_2) = ((((HI) (FLD (f_i16nc)) >> (11))) & (31));
FLD (f_i16_1) = ((FLD (f_i16nc)) & (2047));
}
errmsg = insert_normal (cd, fields->f_i16_1, 0, 0, 10, 11, 32, total_length, buffer);