Revision e1571908 target-ppc/op.c

b/target-ppc/op.c
26 26
#include "helper_regs.h"
27 27
#include "op_helper.h"
28 28

  
29
/* PowerPC state maintenance operations */
30
/* set_Rc0 */
31
void OPPROTO op_set_Rc0 (void)
32
{
33
    env->crf[0] = T0 | xer_so;
34
    RETURN();
35
}
36

  
37 29
/* Generate exceptions */
38 30
void OPPROTO op_raise_exception_err (void)
39 31
{
......
46 38
}
47 39

  
48 40
/* Load/store special registers */
49
void OPPROTO op_load_cr (void)
50
{
51
    do_load_cr();
52
    RETURN();
53
}
54

  
55
void OPPROTO op_store_cr (void)
56
{
57
    do_store_cr(PARAM1);
58
    RETURN();
59
}
60

  
61 41
#if defined(TARGET_PPC64)
62 42
void OPPROTO op_store_pri (void)
63 43
{
......
337 317
    RETURN();
338 318
}
339 319

  
340
void OPPROTO op_load_fpscr_T0 (void)
341
{
342
    T0 = (env->fpscr >> PARAM1) & 0xF;
343
    RETURN();
344
}
345

  
346
void OPPROTO op_load_fpcc (void)
347
{
348
    T0 = fpscr_fpcc;
349
    RETURN();
350
}
351

  
352 320
void OPPROTO op_fpscr_resetbit (void)
353 321
{
354 322
    env->fpscr &= PARAM1;
......
953 921
}
954 922
#endif
955 923

  
956
/***                           Integer comparison                          ***/
957
/* compare */
958
void OPPROTO op_cmp (void)
959
{
960
    if ((int32_t)T0 < (int32_t)T1) {
961
        T0 = 0x08;
962
    } else if ((int32_t)T0 > (int32_t)T1) {
963
        T0 = 0x04;
964
    } else {
965
        T0 = 0x02;
966
    }
967
    T0 |= xer_so;
968
    RETURN();
969
}
970

  
971
#if defined(TARGET_PPC64)
972
void OPPROTO op_cmp_64 (void)
973
{
974
    if ((int64_t)T0 < (int64_t)T1) {
975
        T0 = 0x08;
976
    } else if ((int64_t)T0 > (int64_t)T1) {
977
        T0 = 0x04;
978
    } else {
979
        T0 = 0x02;
980
    }
981
    T0 |= xer_so;
982
    RETURN();
983
}
984
#endif
985

  
986
/* compare immediate */
987
void OPPROTO op_cmpi (void)
988
{
989
    if ((int32_t)T0 < (int32_t)PARAM1) {
990
        T0 = 0x08;
991
    } else if ((int32_t)T0 > (int32_t)PARAM1) {
992
        T0 = 0x04;
993
    } else {
994
        T0 = 0x02;
995
    }
996
    T0 |= xer_so;
997
    RETURN();
998
}
999

  
1000
#if defined(TARGET_PPC64)
1001
void OPPROTO op_cmpi_64 (void)
1002
{
1003
    if ((int64_t)T0 < (int64_t)((int32_t)PARAM1)) {
1004
        T0 = 0x08;
1005
    } else if ((int64_t)T0 > (int64_t)((int32_t)PARAM1)) {
1006
        T0 = 0x04;
1007
    } else {
1008
        T0 = 0x02;
1009
    }
1010
    T0 |= xer_so;
1011
    RETURN();
1012
}
1013
#endif
1014

  
1015
/* compare logical */
1016
void OPPROTO op_cmpl (void)
1017
{
1018
    if ((uint32_t)T0 < (uint32_t)T1) {
1019
        T0 = 0x08;
1020
    } else if ((uint32_t)T0 > (uint32_t)T1) {
1021
        T0 = 0x04;
1022
    } else {
1023
        T0 = 0x02;
1024
    }
1025
    T0 |= xer_so;
1026
    RETURN();
1027
}
1028

  
1029
#if defined(TARGET_PPC64)
1030
void OPPROTO op_cmpl_64 (void)
1031
{
1032
    if ((uint64_t)T0 < (uint64_t)T1) {
1033
        T0 = 0x08;
1034
    } else if ((uint64_t)T0 > (uint64_t)T1) {
1035
        T0 = 0x04;
1036
    } else {
1037
        T0 = 0x02;
1038
    }
1039
    T0 |= xer_so;
1040
    RETURN();
1041
}
1042
#endif
1043

  
1044
/* compare logical immediate */
1045
void OPPROTO op_cmpli (void)
1046
{
1047
    if ((uint32_t)T0 < (uint32_t)PARAM1) {
1048
        T0 = 0x08;
1049
    } else if ((uint32_t)T0 > (uint32_t)PARAM1) {
1050
        T0 = 0x04;
1051
    } else {
1052
        T0 = 0x02;
1053
    }
1054
    T0 |= xer_so;
1055
    RETURN();
1056
}
1057

  
1058
#if defined(TARGET_PPC64)
1059
void OPPROTO op_cmpli_64 (void)
1060
{
1061
    if ((uint64_t)T0 < (uint64_t)PARAM1) {
1062
        T0 = 0x08;
1063
    } else if ((uint64_t)T0 > (uint64_t)PARAM1) {
1064
        T0 = 0x04;
1065
    } else {
1066
        T0 = 0x02;
1067
    }
1068
    T0 |= xer_so;
1069
    RETURN();
1070
}
1071
#endif
1072

  
1073
void OPPROTO op_isel (void)
1074
{
1075
    if (T0)
1076
        T0 = T1;
1077
    else
1078
        T0 = T2;
1079
    RETURN();
1080
}
1081

  
1082 924
void OPPROTO op_popcntb (void)
1083 925
{
1084 926
    do_popcntb();
......
1339 1181
    RETURN();
1340 1182
}
1341 1183

  
1342
void OPPROTO op_sli_T1 (void)
1343
{
1344
    T1 = T1 << PARAM1;
1345
    RETURN();
1346
}
1347

  
1348 1184
void OPPROTO op_srl_T0_T1 (void)
1349 1185
{
1350 1186
    T0 = (uint32_t)T0 >> T1;
......
1579 1415
    RETURN();
1580 1416
}
1581 1417

  
1582
/***                         Floating-Point compare                        ***/
1583
/* fcmpu */
1584
void OPPROTO op_fcmpu (void)
1585
{
1586
    do_fcmpu();
1587
    RETURN();
1588
}
1589

  
1590
/* fcmpo */
1591
void OPPROTO op_fcmpo (void)
1592
{
1593
    do_fcmpo();
1594
    RETURN();
1595
}
1596

  
1597 1418
/***                         Floating-point move                           ***/
1598 1419
/* fabs */
1599 1420
void OPPROTO op_fabs (void)

Also available in: Unified diff