@@ -2339,83 +2339,6 @@ void C2_MacroAssembler::signum_fp_v(VectorRegister dst, VectorRegister one, Basi
23392339 vfsgnj_vv (dst, one, dst, v0_t );
23402340}
23412341
2342- void C2_MacroAssembler::compress_bits_v (Register dst, Register src, Register mask, bool is_long) {
2343- Assembler::SEW sew = is_long ? Assembler::e64 : Assembler::e32 ;
2344- // intrinsic is enabled when MaxVectorSize >= 16
2345- Assembler::LMUL lmul = is_long ? Assembler::m4 : Assembler::m2;
2346- long len = is_long ? 64 : 32 ;
2347-
2348- // load the src data(in bits) to be compressed.
2349- vsetivli (x0, 1 , sew, Assembler::m1);
2350- vmv_s_x (v0, src);
2351- // reset the src data(in bytes) to zero.
2352- mv (t0, len);
2353- vsetvli (x0, t0, Assembler::e8 , lmul);
2354- vmv_v_i (v4, 0 );
2355- // convert the src data from bits to bytes.
2356- vmerge_vim (v4, v4, 1 ); // v0 as the implicit mask register
2357- // reset the dst data(in bytes) to zero.
2358- vmv_v_i (v8, 0 );
2359- // load the mask data(in bits).
2360- vsetivli (x0, 1 , sew, Assembler::m1);
2361- vmv_s_x (v0, mask);
2362- // compress the src data(in bytes) to dst(in bytes).
2363- vsetvli (x0, t0, Assembler::e8 , lmul);
2364- vcompress_vm (v8, v4, v0);
2365- // convert the dst data from bytes to bits.
2366- vmseq_vi (v0, v8, 1 );
2367- // store result back.
2368- vsetivli (x0, 1 , sew, Assembler::m1);
2369- vmv_x_s (dst, v0);
2370- }
2371-
2372- void C2_MacroAssembler::compress_bits_i_v (Register dst, Register src, Register mask) {
2373- compress_bits_v (dst, src, mask, /* is_long */ false );
2374- }
2375-
2376- void C2_MacroAssembler::compress_bits_l_v (Register dst, Register src, Register mask) {
2377- compress_bits_v (dst, src, mask, /* is_long */ true );
2378- }
2379-
2380- void C2_MacroAssembler::expand_bits_v (Register dst, Register src, Register mask, bool is_long) {
2381- Assembler::SEW sew = is_long ? Assembler::e64 : Assembler::e32 ;
2382- // intrinsic is enabled when MaxVectorSize >= 16
2383- Assembler::LMUL lmul = is_long ? Assembler::m4 : Assembler::m2;
2384- long len = is_long ? 64 : 32 ;
2385-
2386- // load the src data(in bits) to be expanded.
2387- vsetivli (x0, 1 , sew, Assembler::m1);
2388- vmv_s_x (v0, src);
2389- // reset the src data(in bytes) to zero.
2390- mv (t0, len);
2391- vsetvli (x0, t0, Assembler::e8 , lmul);
2392- vmv_v_i (v4, 0 );
2393- // convert the src data from bits to bytes.
2394- vmerge_vim (v4, v4, 1 ); // v0 as implicit mask register
2395- // reset the dst data(in bytes) to zero.
2396- vmv_v_i (v12, 0 );
2397- // load the mask data(in bits).
2398- vsetivli (x0, 1 , sew, Assembler::m1);
2399- vmv_s_x (v0, mask);
2400- // expand the src data(in bytes) to dst(in bytes).
2401- vsetvli (x0, t0, Assembler::e8 , lmul);
2402- viota_m (v8, v0);
2403- vrgather_vv (v12, v4, v8, VectorMask::v0_t ); // v0 as implicit mask register
2404- // convert the dst data from bytes to bits.
2405- vmseq_vi (v0, v12, 1 );
2406- // store result back.
2407- vsetivli (x0, 1 , sew, Assembler::m1);
2408- vmv_x_s (dst, v0);
2409- }
2410-
2411- void C2_MacroAssembler::expand_bits_i_v (Register dst, Register src, Register mask) {
2412- expand_bits_v (dst, src, mask, /* is_long */ false );
2413- }
2414-
2415- void C2_MacroAssembler::expand_bits_l_v (Register dst, Register src, Register mask) {
2416- expand_bits_v (dst, src, mask, /* is_long */ true );
2417- }
2418-
24192342// j.l.Math.round(float)
24202343// Returns the closest int to the argument, with ties rounding to positive infinity.
24212344// We need to handle 3 special cases defined by java api spec:
0 commit comments