Skip to content

Commit fe8afbc

Browse files
committed
cpu/
* m32c.cpu (f-dsp-32-u24): Fix mode of extract handler. (f-dsp-40-u20, f-dsp-40-u24): Ditto. opcodes/ * cgen-ibld.in: #include "cgen/basic-modes.h". * fr30-ibld.c, * frv-ibld.c, * ip2k-ibld.c, * iq2000-ibld.c, * lm32-ibld.c, * m32c-ibld.c, * m32r-ibld.c, * mep-ibld.c, * mt-ibld.c, * openrisc-ibld.c, * xc16x-ibld.c, * xstormy16-ibld.c: Regenerate.
1 parent 7c5b2b7 commit fe8afbc

16 files changed

Lines changed: 227 additions & 200 deletions

cpu/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2010-01-05 Doug Evans <[email protected]>
2+
3+
* m32c.cpu (f-dsp-32-u24): Fix mode of extract handler.
4+
(f-dsp-40-u20, f-dsp-40-u24): Ditto.
5+
16
2010-01-02 Doug Evans <[email protected]>
27

38
* m32c.opc (parse_signed16): Fix typo.

cpu/m32c.cpu

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -617,37 +617,38 @@
617617
(or USI
618618
(and (srl value 16) #x0000ff)
619619
(and value #x00ff00))
620-
(and (sll value 16) #xff0000))) ; insert
620+
(and (sll value 16) #xff0000))) ; insert
621621
((value pc) (or USI
622622
(or USI
623-
(and USI (srl UHI value 16) #x0000ff)
624-
(and USI value #x00ff00))
625-
(and USI (sll UHI value 16) #xff0000))) ; extract
623+
(and USI (srl value 16) #x0000ff)
624+
(and USI value #x00ff00))
625+
(and USI (sll value 16) #xff0000))) ; extract
626626
)
627627

628628
(df f-dsp-40-u20 "20 bit unsigned" (all-isas) 40 20 UINT
629629
((value pc) (or USI
630630
(or USI
631631
(and (srl value 16) #x0000ff)
632632
(and value #x00ff00))
633-
(and (sll value 16) #x0f0000))) ; insert
633+
(and (sll value 16) #x0f0000))) ; insert
634634
((value pc) (or USI
635635
(or USI
636-
(and USI (srl UHI value 16) #x0000ff)
637-
(and USI value #x00ff00))
638-
(and USI (sll UHI value 16) #x0f0000))) ; extract
636+
(and USI (srl value 16) #x0000ff)
637+
(and USI value #x00ff00))
638+
(and USI (sll value 16) #x0f0000))) ; extract
639639
)
640+
640641
(df f-dsp-40-u24 "24 bit unsigned" (all-isas) 40 24 UINT
641642
((value pc) (or USI
642643
(or USI
643644
(and (srl value 16) #x0000ff)
644645
(and value #x00ff00))
645-
(and (sll value 16) #xff0000))) ; insert
646+
(and (sll value 16) #xff0000))) ; insert
646647
((value pc) (or USI
647648
(or USI
648-
(and USI (srl UHI value 16) #x0000ff)
649-
(and USI value #x00ff00))
650-
(and USI (sll UHI value 16) #xff0000))) ; extract
649+
(and USI (srl value 16) #x0000ff)
650+
(and USI value #x00ff00))
651+
(and USI (sll value 16) #xff0000))) ; extract
651652
)
652653

653654
(dnmf f-dsp-40-s32 "32 bit signed" (all-isas) INT

opcodes/ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2010-01-05 Doug Evans <[email protected]>
2+
3+
* cgen-ibld.in: #include "cgen/basic-modes.h".
4+
* fr30-ibld.c, * frv-ibld.c, * ip2k-ibld.c, * iq2000-ibld.c,
5+
* lm32-ibld.c, * m32c-ibld.c, * m32r-ibld.c, * mep-ibld.c,
6+
* mt-ibld.c, * openrisc-ibld.c, * xc16x-ibld.c,
7+
* xstormy16-ibld.c: Regenerate.
8+
19
2010-01-04 Nick Clifton <[email protected]>
210

311
PR 11123

opcodes/cgen-ibld.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "symcat.h"
3434
#include "@[email protected]"
3535
#include "@[email protected]"
36+
#include "cgen/basic-modes.h"
3637
#include "opintl.h"
3738
#include "safe-ctype.h"
3839

opcodes/fr30-ibld.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "symcat.h"
3434
#include "fr30-desc.h"
3535
#include "fr30-opc.h"
36+
#include "cgen/basic-modes.h"
3637
#include "opintl.h"
3738
#include "safe-ctype.h"
3839

@@ -604,7 +605,7 @@ fr30_cgen_insert_operand (CGEN_CPU_DESC cd,
604605
case FR30_OPERAND_DIR10 :
605606
{
606607
long value = fields->f_dir10;
607-
value = ((unsigned int) (value) >> (2));
608+
value = ((USI) (value) >> (2));
608609
errmsg = insert_normal (cd, value, 0, 0, 8, 8, 16, total_length, buffer);
609610
}
610611
break;
@@ -614,14 +615,14 @@ fr30_cgen_insert_operand (CGEN_CPU_DESC cd,
614615
case FR30_OPERAND_DIR9 :
615616
{
616617
long value = fields->f_dir9;
617-
value = ((unsigned int) (value) >> (1));
618+
value = ((USI) (value) >> (1));
618619
errmsg = insert_normal (cd, value, 0, 0, 8, 8, 16, total_length, buffer);
619620
}
620621
break;
621622
case FR30_OPERAND_DISP10 :
622623
{
623624
long value = fields->f_disp10;
624-
value = ((int) (value) >> (2));
625+
value = ((SI) (value) >> (2));
625626
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, buffer);
626627
}
627628
break;
@@ -631,14 +632,14 @@ fr30_cgen_insert_operand (CGEN_CPU_DESC cd,
631632
case FR30_OPERAND_DISP9 :
632633
{
633634
long value = fields->f_disp9;
634-
value = ((int) (value) >> (1));
635+
value = ((SI) (value) >> (1));
635636
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, buffer);
636637
}
637638
break;
638639
case FR30_OPERAND_I20 :
639640
{
640641
{
641-
FLD (f_i20_4) = ((unsigned int) (FLD (f_i20)) >> (16));
642+
FLD (f_i20_4) = ((UINT) (FLD (f_i20)) >> (16));
642643
FLD (f_i20_16) = ((FLD (f_i20)) & (65535));
643644
}
644645
errmsg = insert_normal (cd, fields->f_i20_4, 0, 0, 8, 4, 16, total_length, buffer);
@@ -658,14 +659,14 @@ fr30_cgen_insert_operand (CGEN_CPU_DESC cd,
658659
case FR30_OPERAND_LABEL12 :
659660
{
660661
long value = fields->f_rel12;
661-
value = ((int) (((value) - (((pc) + (2))))) >> (1));
662+
value = ((SI) (((value) - (((pc) + (2))))) >> (1));
662663
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 11, 16, total_length, buffer);
663664
}
664665
break;
665666
case FR30_OPERAND_LABEL9 :
666667
{
667668
long value = fields->f_rel9;
668-
value = ((int) (((value) - (((pc) + (2))))) >> (1));
669+
value = ((SI) (((value) - (((pc) + (2))))) >> (1));
669670
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 16, total_length, buffer);
670671
}
671672
break;
@@ -693,14 +694,14 @@ fr30_cgen_insert_operand (CGEN_CPU_DESC cd,
693694
case FR30_OPERAND_S10 :
694695
{
695696
long value = fields->f_s10;
696-
value = ((int) (value) >> (2));
697+
value = ((SI) (value) >> (2));
697698
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 16, total_length, buffer);
698699
}
699700
break;
700701
case FR30_OPERAND_U10 :
701702
{
702703
long value = fields->f_u10;
703-
value = ((unsigned int) (value) >> (2));
704+
value = ((USI) (value) >> (2));
704705
errmsg = insert_normal (cd, value, 0, 0, 8, 8, 16, total_length, buffer);
705706
}
706707
break;
@@ -716,7 +717,7 @@ fr30_cgen_insert_operand (CGEN_CPU_DESC cd,
716717
case FR30_OPERAND_UDISP6 :
717718
{
718719
long value = fields->f_udisp6;
719-
value = ((unsigned int) (value) >> (2));
720+
value = ((USI) (value) >> (2));
720721
errmsg = insert_normal (cd, value, 0, 0, 8, 4, 16, total_length, buffer);
721722
}
722723
break;

opcodes/frv-ibld.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "symcat.h"
3434
#include "frv-desc.h"
3535
#include "frv-opc.h"
36+
#include "cgen/basic-modes.h"
3637
#include "opintl.h"
3738
#include "safe-ctype.h"
3839

@@ -755,15 +756,15 @@ frv_cgen_insert_operand (CGEN_CPU_DESC cd,
755756
case FRV_OPERAND_LABEL16 :
756757
{
757758
long value = fields->f_label16;
758-
value = ((int) (((value) - (pc))) >> (2));
759+
value = ((SI) (((value) - (pc))) >> (2));
759760
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, buffer);
760761
}
761762
break;
762763
case FRV_OPERAND_LABEL24 :
763764
{
764765
{
765-
FLD (f_labelH6) = ((int) (((FLD (f_label24)) - (pc))) >> (20));
766-
FLD (f_labelL18) = ((((unsigned int) (((FLD (f_label24)) - (pc))) >> (2))) & (262143));
766+
FLD (f_labelH6) = ((SI) (((FLD (f_label24)) - (pc))) >> (20));
767+
FLD (f_labelL18) = ((((UINT) (((FLD (f_label24)) - (pc))) >> (2))) & (262143));
767768
}
768769
errmsg = insert_normal (cd, fields->f_labelH6, 0|(1<<CGEN_IFLD_SIGNED), 0, 30, 6, 32, total_length, buffer);
769770
if (errmsg)
@@ -809,7 +810,7 @@ frv_cgen_insert_operand (CGEN_CPU_DESC cd,
809810
case FRV_OPERAND_SPR :
810811
{
811812
{
812-
FLD (f_spr_h) = ((unsigned int) (FLD (f_spr)) >> (6));
813+
FLD (f_spr_h) = ((UINT) (FLD (f_spr)) >> (6));
813814
FLD (f_spr_l) = ((FLD (f_spr)) & (63));
814815
}
815816
errmsg = insert_normal (cd, fields->f_spr_h, 0, 0, 30, 6, 32, total_length, buffer);
@@ -823,7 +824,7 @@ frv_cgen_insert_operand (CGEN_CPU_DESC cd,
823824
case FRV_OPERAND_U12 :
824825
{
825826
{
826-
FLD (f_u12_h) = ((int) (FLD (f_u12)) >> (6));
827+
FLD (f_u12_h) = ((SI) (FLD (f_u12)) >> (6));
827828
FLD (f_u12_l) = ((FLD (f_u12)) & (63));
828829
}
829830
errmsg = insert_normal (cd, fields->f_u12_h, 0|(1<<CGEN_IFLD_SIGNED), 0, 17, 6, 32, total_length, buffer);

opcodes/ip2k-ibld.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "symcat.h"
3434
#include "ip2k-desc.h"
3535
#include "ip2k-opc.h"
36+
#include "cgen/basic-modes.h"
3637
#include "opintl.h"
3738
#include "safe-ctype.h"
3839

opcodes/iq2000-ibld.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "symcat.h"
3434
#include "iq2000-desc.h"
3535
#include "iq2000-opc.h"
36+
#include "cgen/basic-modes.h"
3637
#include "opintl.h"
3738
#include "safe-ctype.h"
3839

@@ -613,14 +614,14 @@ iq2000_cgen_insert_operand (CGEN_CPU_DESC cd,
613614
case IQ2000_OPERAND_JMPTARG :
614615
{
615616
long value = fields->f_jtarg;
616-
value = ((unsigned int) (((value) & (262143))) >> (2));
617+
value = ((USI) (((value) & (262143))) >> (2));
617618
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_ABS_ADDR), 0, 15, 16, 32, total_length, buffer);
618619
}
619620
break;
620621
case IQ2000_OPERAND_JMPTARGQ10 :
621622
{
622623
long value = fields->f_jtargq10;
623-
value = ((unsigned int) (((value) & (8388607))) >> (2));
624+
value = ((USI) (((value) & (8388607))) >> (2));
624625
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_ABS_ADDR), 0, 20, 21, 32, total_length, buffer);
625626
}
626627
break;
@@ -645,7 +646,7 @@ iq2000_cgen_insert_operand (CGEN_CPU_DESC cd,
645646
case IQ2000_OPERAND_OFFSET :
646647
{
647648
long value = fields->f_offset;
648-
value = ((int) (((value) - (pc))) >> (2));
649+
value = ((SI) (((value) - (pc))) >> (2));
649650
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, buffer);
650651
}
651652
break;

opcodes/lm32-ibld.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "symcat.h"
3434
#include "lm32-desc.h"
3535
#include "lm32-opc.h"
36+
#include "cgen/basic-modes.h"
3637
#include "opintl.h"
3738
#include "safe-ctype.h"
3839

@@ -568,14 +569,14 @@ lm32_cgen_insert_operand (CGEN_CPU_DESC cd,
568569
case LM32_OPERAND_BRANCH :
569570
{
570571
long value = fields->f_branch;
571-
value = ((int) (((value) - (pc))) >> (2));
572+
value = ((SI) (((value) - (pc))) >> (2));
572573
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, buffer);
573574
}
574575
break;
575576
case LM32_OPERAND_CALL :
576577
{
577578
long value = fields->f_call;
578-
value = ((int) (((value) - (pc))) >> (2));
579+
value = ((SI) (((value) - (pc))) >> (2));
579580
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 25, 26, 32, total_length, buffer);
580581
}
581582
break;
@@ -671,15 +672,15 @@ lm32_cgen_extract_operand (CGEN_CPU_DESC cd,
671672
{
672673
long value;
673674
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, pc, & value);
674-
value = ((pc) + (((int) (((value) << (16))) >> (14))));
675+
value = ((pc) + (((SI) (((value) << (16))) >> (14))));
675676
fields->f_branch = value;
676677
}
677678
break;
678679
case LM32_OPERAND_CALL :
679680
{
680681
long value;
681682
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 25, 26, 32, total_length, pc, & value);
682-
value = ((pc) + (((int) (((value) << (6))) >> (4))));
683+
value = ((pc) + (((SI) (((value) << (6))) >> (4))));
683684
fields->f_call = value;
684685
}
685686
break;

0 commit comments

Comments
 (0)