Skip to content

Commit e77598b

Browse files
sethmpkoning2
authored andcommitted
3B2: Address review comments
1 parent 9fc0751 commit e77598b

3 files changed

Lines changed: 28 additions & 35 deletions

File tree

3B2/3b2_mau.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,21 @@ static void sub_128(t_uint64 a0, t_uint64 a1,
144144
static void mul_64_to_128(t_uint64 a, t_uint64 b, t_uint64 *r_low, t_uint64 *r_high);
145145
static void mul_64_by_shifted_32_to_128(t_uint64 a, uint32 b, t_mau_128 *result);
146146
static t_uint64 estimate_div_128_to_64(t_uint64 a0, t_uint64 a1, t_uint64 b);
147-
static uint32 round_pack_int(t_bool sign, t_uint64 frac, RM rounding_mode);
148-
static t_int64 round_pack_int64(t_bool sign,
147+
static uint32 round_pack_int(uint32 sign, t_uint64 frac, RM rounding_mode);
148+
static t_int64 round_pack_int64(uint32 sign,
149149
t_uint64 abs_0, t_uint64 abs_1,
150150
RM rounding_mode);
151151

152-
static SFP round_pack_sfp(t_bool sign, int16 exp,
152+
static SFP round_pack_sfp(uint32 sign, int16 exp,
153153
uint32 frac, RM rounding_mode);
154-
static DFP round_pack_dfp(t_bool sign, int16 exp, t_uint64 frac,
154+
static DFP round_pack_dfp(uint32 sign, int16 exp, t_uint64 frac,
155155
t_bool xfp_sticky, RM rounding_mode);
156-
static void round_pack_xfp(t_bool sign, int32 exp,
156+
static void round_pack_xfp(uint32 sign, int32 exp,
157157
t_uint64 frac_a, t_uint64 frac_b,
158158
RM rounding_mode, XFP *result);
159159
static void propagate_xfp_nan(XFP *a, XFP *b, XFP *result);
160160
static void propagate_xfp_nan_128(XFP* a, XFP* b, t_mau_128* result);
161-
static void normalize_round_pack_xfp(t_bool sign, int32 exp,
161+
static void normalize_round_pack_xfp(uint32 sign, int32 exp,
162162
t_uint64 frac_0, t_uint64 frac_1,
163163
RM rounding_mode, XFP *result);
164164
static void normalize_sfp_subnormal(uint32 in_frac, int16 *out_exp, uint32 *out_frac);
@@ -926,7 +926,7 @@ static uint32 approx_recip_sqrt_32(uint32 oddExpA, uint32 a)
926926
*
927927
* Derived from the SoftFloat 2c package (see copyright notice above)
928928
*/
929-
static uint32 round_pack_int(t_bool sign, t_uint64 frac, RM rounding_mode)
929+
static uint32 round_pack_int(uint32 sign, t_uint64 frac, RM rounding_mode)
930930
{
931931
int8 round_increment, round_bits;
932932
int32 result;
@@ -980,7 +980,7 @@ static uint32 round_pack_int(t_bool sign, t_uint64 frac, RM rounding_mode)
980980
*
981981
* Derived from the SoftFloat 2c package (see copyright notice above)
982982
*/
983-
static t_int64 round_pack_int64(t_bool sign,
983+
static t_int64 round_pack_int64(uint32 sign,
984984
t_uint64 abs_0, t_uint64 abs_1,
985985
RM rounding_mode)
986986
{
@@ -1035,7 +1035,7 @@ static t_int64 round_pack_int64(t_bool sign,
10351035
*
10361036
* Derived from the SoftFloat 2c package (see copyright notice above)
10371037
*/
1038-
static SFP round_pack_sfp(t_bool sign, int16 exp, uint32 frac, RM rounding_mode)
1038+
static SFP round_pack_sfp(uint32 sign, int16 exp, uint32 frac, RM rounding_mode)
10391039
{
10401040
int8 round_increment, round_bits;
10411041
uint8 is_tiny;
@@ -1101,7 +1101,7 @@ static SFP round_pack_sfp(t_bool sign, int16 exp, uint32 frac, RM rounding_mode)
11011101
*
11021102
* Derived from the SoftFloat 2c package (see copyright notice above)
11031103
*/
1104-
static DFP round_pack_dfp(t_bool sign, int16 exp, t_uint64 frac,
1104+
static DFP round_pack_dfp(uint32 sign, int16 exp, t_uint64 frac,
11051105
t_bool xfp_sticky, RM rounding_mode)
11061106
{
11071107
int16 round_increment, round_bits;
@@ -1178,7 +1178,7 @@ static DFP round_pack_dfp(t_bool sign, int16 exp, t_uint64 frac,
11781178
*
11791179
* Derived from the SoftFloat 2c package (see copyright notice above)
11801180
*/
1181-
static void round_pack_xfp(t_bool sign, int32 exp,
1181+
static void round_pack_xfp(uint32 sign, int32 exp,
11821182
t_uint64 frac_a, t_uint64 frac_b,
11831183
RM rounding_mode, XFP *result)
11841184
{
@@ -1313,7 +1313,7 @@ static void propagate_xfp_nan_128(XFP* a, XFP* b, t_mau_128* result)
13131313
* Partially derived from the SoftFloat 2c package (see copyright
13141314
* notice above)
13151315
*/
1316-
static void normalize_round_pack_xfp(t_bool sign, int32 exp,
1316+
static void normalize_round_pack_xfp(uint32 sign, int32 exp,
13171317
t_uint64 frac_0, t_uint64 frac_1,
13181318
RM rounding_mode, XFP *result)
13191319
{
@@ -1412,7 +1412,7 @@ static T_NAN sfp_to_common_nan(SFP val)
14121412
mau_state.trapping_nan = TRUE;
14131413
}
14141414

1415-
nan.sign = val >> 31;
1415+
nan.sign = (val >> 31) & 1;
14161416
nan.low = 0;
14171417
nan.high = ((t_uint64) val) << 41;
14181418

@@ -1454,7 +1454,7 @@ static T_NAN xfp_to_common_nan(XFP *val)
14541454
mau_state.trapping_nan = TRUE;
14551455
}
14561456

1457-
nan.sign = val->sign_exp >> 15;
1457+
nan.sign = (val->sign_exp >> 15) & 1;
14581458
nan.low = 0;
14591459
nan.high = val->frac << 1;
14601460

@@ -1507,7 +1507,7 @@ static void common_nan_to_xfp(T_NAN nan, XFP *result)
15071507
*/
15081508
static void sfp_to_xfp(SFP val, XFP *result)
15091509
{
1510-
t_bool sign;
1510+
uint32 sign;
15111511
int16 exp;
15121512
uint32 frac;
15131513

@@ -1542,7 +1542,7 @@ static void sfp_to_xfp(SFP val, XFP *result)
15421542
*/
15431543
void dfp_to_xfp(DFP val, XFP *result)
15441544
{
1545-
t_bool sign;
1545+
uint32 sign;
15461546
int16 exp;
15471547
t_uint64 frac;
15481548

@@ -1580,7 +1580,7 @@ void dfp_to_xfp(DFP val, XFP *result)
15801580
*/
15811581
static SFP xfp_to_sfp(XFP *val, RM rounding_mode)
15821582
{
1583-
t_bool sign;
1583+
uint32 sign;
15841584
int32 exp;
15851585
t_uint64 frac;
15861586
uint32 dst_frac;
@@ -1615,7 +1615,7 @@ static SFP xfp_to_sfp(XFP *val, RM rounding_mode)
16151615
*/
16161616
static DFP xfp_to_dfp(XFP *val, RM rounding_mode)
16171617
{
1618-
t_bool sign;
1618+
uint32 sign;
16191619
int32 exp;
16201620
t_uint64 frac;
16211621

@@ -1711,7 +1711,7 @@ static uint32 xfp_lt(XFP *a, XFP *b)
17111711
void mau_int_to_xfp(int32 val, XFP *result)
17121712
{
17131713
int32 shift_width;
1714-
t_bool sign;
1714+
uint32 sign;
17151715
uint32 abs_val;
17161716
uint16 sign_exp = 0;
17171717
t_uint64 frac = 0;
@@ -1744,7 +1744,7 @@ void mau_int_to_xfp(int32 val, XFP *result)
17441744
*/
17451745
t_int64 xfp_to_int64(XFP *val, RM rounding_mode)
17461746
{
1747-
t_bool sign;
1747+
uint32 sign;
17481748
int32 exp, shift_count;
17491749
t_uint64 frac, frac_extra;
17501750

@@ -1770,7 +1770,7 @@ t_int64 xfp_to_int64(XFP *val, RM rounding_mode)
17701770

17711771
void mau_int64_to_xfp(t_uint64 val, XFP *result)
17721772
{
1773-
t_bool sign;
1773+
uint32 sign;
17741774
t_uint64 abs;
17751775
int8 shift_count;
17761776

@@ -1797,7 +1797,7 @@ void xfp_to_decimal(XFP *a, DEC *d, RM rounding_mode)
17971797
{
17981798
t_int64 tmp;
17991799
int i;
1800-
t_bool sign;
1800+
uint32 sign;
18011801
uint16 digits[19] = {0};
18021802

18031803
tmp = xfp_to_int64(a, rounding_mode);
@@ -1848,7 +1848,7 @@ void xfp_to_decimal(XFP *a, DEC *d, RM rounding_mode)
18481848
void mau_decimal_to_xfp(DEC *d, XFP *a)
18491849
{
18501850
int i;
1851-
t_bool sign;
1851+
uint32 sign;
18521852
uint16 digits[18] = {0};
18531853
t_uint64 multiplier = 1;
18541854
t_uint64 tmp;
@@ -1923,7 +1923,7 @@ void mau_decimal_to_xfp(DEC *d, XFP *a)
19231923
*/
19241924
uint32 xfp_to_int(XFP *val, RM rounding_mode)
19251925
{
1926-
t_bool sign;
1926+
uint32 sign;
19271927
int32 exp, shift_count;
19281928
t_uint64 frac;
19291929

@@ -1954,7 +1954,7 @@ uint32 xfp_to_int(XFP *val, RM rounding_mode)
19541954
*/
19551955
void mau_round_xfp_to_int(XFP *val, XFP *result, RM rounding_mode)
19561956
{
1957-
t_bool sign;
1957+
uint32 sign;
19581958
int32 exp;
19591959
t_uint64 last_bit_mask, round_bits_mask;
19601960

@@ -2042,7 +2042,7 @@ void mau_round_xfp_to_int(XFP *val, XFP *result, RM rounding_mode)
20422042
/*
20432043
* Derived from the SoftFloat 2c package (see copyright notice above)
20442044
*/
2045-
static void xfp_add_fracs(XFP *a, XFP *b, t_bool sign, XFP *result, RM rounding_mode)
2045+
static void xfp_add_fracs(XFP *a, XFP *b, uint32 sign, XFP *result, RM rounding_mode)
20462046
{
20472047
int32 a_exp, b_exp, r_exp;
20482048
t_uint64 a_frac, b_frac, r_frac_0, r_frac_1;
@@ -2129,7 +2129,7 @@ static void xfp_add_fracs(XFP *a, XFP *b, t_bool sign, XFP *result, RM rounding_
21292129
/*
21302130
* Derived from the SoftFloat 2c package (see copyright notice above)
21312131
*/
2132-
static void xfp_sub_fracs(XFP *a, XFP *b, t_bool sign, XFP *result, RM rounding_mode)
2132+
static void xfp_sub_fracs(XFP *a, XFP *b, uint32 sign, XFP *result, RM rounding_mode)
21332133
{
21342134
int32 a_exp, b_exp, r_exp;
21352135
t_uint64 a_frac, b_frac, r_frac_0, r_frac_1;

3B2/3b2_mau.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ typedef struct {
301301
* Not-a-Number Type
302302
*/
303303
typedef struct {
304-
t_bool sign;
304+
uint32 sign;
305305
t_uint64 high;
306306
t_uint64 low;
307307
} T_NAN;

3B2/3b2_scsi.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,7 @@ void ha_express(uint8 slot)
420420
cio_entry rqe;
421421
uint8 rapp_data[RAPP_LEN] = {0};
422422

423-
sim_debug(HA_TRACE, &ha_dev,
424-
"[ha_express] Handling Express Request. pump_state=%d, ha_state.frq=%d, subdev=%02x\n",
425-
ha_state.pump_state, ha_state.frq, rqe.subdevice);
426-
427423
if (ha_state.pump_state == PUMP_SYSGEN) {
428-
sim_debug(HA_TRACE, &ha_dev,
429-
"[ha_full] PUMP: NEW STATE = PUMP_COMPLETE\n");
430-
431424
ha_state.pump_state = PUMP_COMPLETE;
432425
}
433426

0 commit comments

Comments
 (0)