File tree Expand file tree Collapse file tree 2 files changed +2
-19
lines changed
Expand file tree Collapse file tree 2 files changed +2
-19
lines changed Original file line number Diff line number Diff line change 22VRM xrm = P .VU .get_vround_mode ();
33int64_t int_max = INT64_MAX >> (64 - P .VU .vsew );
44int64_t int_min = INT64_MIN >> (64 - P .VU .vsew );
5- int64_t sign_mask = uint64_t (1 ) << (P .VU .vsew - 1 );
65
76VI_VV_LOOP
87({
9- int64_t vs1_sign ;
10- int64_t vs2_sign ;
11- int64_t result_sign ;
12-
13- vs1_sign = vs1 & sign_mask ;
14- vs2_sign = vs2 & sign_mask ;
158 bool overflow = vs1 == vs2 && vs1 == int_min ;
16-
179 int128_t result = (int128_t )vs1 * (int128_t )vs2 ;
18- result_sign = (vs1_sign ^ vs2_sign ) & sign_mask ;
1910
2011 // rounding
2112 INT_ROUNDING (result , xrm , sew - 1 );
13+
2214 // remove guard bits
2315 result = result >> (sew - 1 );
2416
25- // saturation
17+ // max saturation
2618 if (overflow ) {
2719 result = int_max ;
2820 P_SET_OV (1 );
Original file line number Diff line number Diff line change 22VRM xrm = P .VU .get_vround_mode ();
33int64_t int_max = INT64_MAX >> (64 - P .VU .vsew );
44int64_t int_min = INT64_MIN >> (64 - P .VU .vsew );
5- int64_t sign_mask = uint64_t (1 ) << (P .VU .vsew - 1 );
65
76VI_VX_LOOP
87({
9- int64_t rs1_sign ;
10- int64_t vs2_sign ;
11- int64_t result_sign ;
12-
13- rs1_sign = rs1 & sign_mask ;
14- vs2_sign = vs2 & sign_mask ;
158 bool overflow = rs1 == vs2 && rs1 == int_min ;
16-
179 int128_t result = (int128_t )rs1 * (int128_t )vs2 ;
18- result_sign = (rs1_sign ^ vs2_sign ) & sign_mask ;
1910
2011 // rounding
2112 INT_ROUNDING (result , xrm , sew - 1 );
You can’t perform that action at this time.
0 commit comments