summaryrefslogtreecommitdiff
path: root/opcodes/or1k-ibld.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/or1k-ibld.c')
-rw-r--r--opcodes/or1k-ibld.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/opcodes/or1k-ibld.c b/opcodes/or1k-ibld.c
index 139457c080a..acfede76393 100644
--- a/opcodes/or1k-ibld.c
+++ b/opcodes/or1k-ibld.c
@@ -573,10 +573,17 @@ or1k_cgen_insert_operand (CGEN_CPU_DESC cd,
switch (opindex)
{
+ case OR1K_OPERAND_DISP21 :
+ {
+ long value = fields->f_disp21;
+ value = ((((DI) (value) >> (13))) - (((DI) (pc) >> (13))));
+ errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_ABS_ADDR), 0, 20, 21, 32, total_length, buffer);
+ }
+ break;
case OR1K_OPERAND_DISP26 :
{
long value = fields->f_disp26;
- value = ((SI) (((value) - (pc))) >> (2));
+ value = ((DI) (((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;
@@ -688,6 +695,14 @@ or1k_cgen_extract_operand (CGEN_CPU_DESC cd,
switch (opindex)
{
+ case OR1K_OPERAND_DISP21 :
+ {
+ long value;
+ length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_ABS_ADDR), 0, 20, 21, 32, total_length, pc, & value);
+ value = ((((value) + (((DI) (pc) >> (13))))) << (13));
+ fields->f_disp21 = value;
+ }
+ break;
case OR1K_OPERAND_DISP26 :
{
long value;
@@ -789,6 +804,9 @@ or1k_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
switch (opindex)
{
+ case OR1K_OPERAND_DISP21 :
+ value = fields->f_disp21;
+ break;
case OR1K_OPERAND_DISP26 :
value = fields->f_disp26;
break;
@@ -855,6 +873,9 @@ or1k_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
switch (opindex)
{
+ case OR1K_OPERAND_DISP21 :
+ value = fields->f_disp21;
+ break;
case OR1K_OPERAND_DISP26 :
value = fields->f_disp26;
break;
@@ -928,6 +949,9 @@ or1k_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{
switch (opindex)
{
+ case OR1K_OPERAND_DISP21 :
+ fields->f_disp21 = value;
+ break;
case OR1K_OPERAND_DISP26 :
fields->f_disp26 = value;
break;
@@ -991,6 +1015,9 @@ or1k_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{
switch (opindex)
{
+ case OR1K_OPERAND_DISP21 :
+ fields->f_disp21 = value;
+ break;
case OR1K_OPERAND_DISP26 :
fields->f_disp26 = value;
break;