From: Richard Henderson <richard.henderson@linaro.org>
To: Song Gao <gaosong@loongson.cn>, qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 21/43] target/loongarch: Implement vmskltz/vmskgez/vmsknz
Date: Sat, 24 Dec 2022 10:31:02 -0800 [thread overview]
Message-ID: <c49ab02d-ff0c-c17d-0215-f5e083fe3ce2@linaro.org> (raw)
In-Reply-To: <20221224081633.4185445-22-gaosong@loongson.cn>
On 12/24/22 00:16, Song Gao wrote:
> +static void do_vmskltz(vec_t *Vd, vec_t *Vj, int bit, int n)
> +{
> + switch (bit) {
> + case 8:
> + Vd->H[0] |= ((0x80 & Vj->B[n]) == 0) << n;
> + break;
> + case 16:
> + Vd->H[0] |= ((0x8000 & Vj->H[n]) == 0) << n;
> + break;
> + case 32:
> + Vd->H[0] |= ((0x80000000 & Vj->W[n]) == 0) << n;
> + break;
> + case 64:
> + Vd->H[0] |= ((0x8000000000000000 & Vj->D[n]) == 0) << n;
> + break;
> + default:
> + g_assert_not_reached();
> + }
> +}
> +
> +static void do_vmskgez(vec_t *Vd, vec_t *Vj, int bit, int n)
> +{
> + Vd->H[0] |= !((0x80 & Vj->B[n]) == 0) << n;
> +}
> +
> +static void do_vmsknz(vec_t *Vd, vec_t *Vj, int bit, int n)
> +{
> + Vd->H[0] |= (Vj->B[n] == 0) << n;
> +}
The bit collection and compaction can be done with a set of integer shifts.
E.g. helper_cmpbe0 in target/alpha/int_helper.c.
r~
next prev parent reply other threads:[~2022-12-24 18:31 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-24 8:15 [RFC PATCH 00/43] Add LoongArch LSX instructions Song Gao
2022-12-24 8:15 ` [RFC PATCH 01/43] target/loongarch: Add vector data type vec_t Song Gao
2022-12-24 17:07 ` Richard Henderson
2022-12-24 17:24 ` Richard Henderson
2022-12-28 2:34 ` gaosong
2022-12-28 17:30 ` Richard Henderson
2022-12-29 1:51 ` gaosong
2022-12-29 3:13 ` Richard Henderson
2022-12-29 3:54 ` gaosong
2022-12-24 17:32 ` Richard Henderson
2023-02-13 8:24 ` gaosong
2023-02-13 19:18 ` Richard Henderson
2022-12-24 8:15 ` [RFC PATCH 02/43] target/loongarch: CPUCFG support LSX Song Gao
2022-12-24 8:15 ` [RFC PATCH 03/43] target/loongarch: meson.build support build LSX Song Gao
2022-12-24 8:15 ` [RFC PATCH 04/43] target/loongarch: Add CHECK_SXE maccro for check LSX enable Song Gao
2022-12-24 8:15 ` [RFC PATCH 05/43] target/loongarch: Implement vadd/vsub Song Gao
2022-12-24 17:16 ` Richard Henderson
2022-12-24 8:15 ` [RFC PATCH 06/43] target/loongarch: Implement vaddi/vsubi Song Gao
2022-12-24 17:27 ` Richard Henderson
2022-12-24 8:15 ` [RFC PATCH 07/43] target/loongarch: Implement vneg Song Gao
2022-12-24 17:29 ` Richard Henderson
2022-12-24 8:15 ` [RFC PATCH 08/43] target/loongarch: Implement vsadd/vssub Song Gao
2022-12-24 17:31 ` Richard Henderson
2022-12-24 8:15 ` [RFC PATCH 09/43] target/loongarch: Implement vhaddw/vhsubw Song Gao
2022-12-24 17:41 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 10/43] target/loongarch: Implement vaddw/vsubw Song Gao
2022-12-24 17:48 ` Richard Henderson
2023-02-20 7:47 ` gaosong
2023-02-20 17:21 ` Richard Henderson
2023-02-23 8:23 ` gaosong
2023-02-23 15:22 ` Richard Henderson
2023-02-24 7:24 ` gaosong
2023-02-24 19:24 ` Richard Henderson
2023-02-27 9:14 ` gaosong
2023-02-27 9:20 ` Richard Henderson
2023-02-27 12:54 ` gaosong
2023-02-27 18:32 ` Richard Henderson
2023-02-27 12:55 ` gaosong
2023-02-27 18:40 ` Richard Henderson
2023-02-28 3:30 ` gaosong
2023-02-28 16:48 ` Richard Henderson
2023-02-24 23:01 ` Richard Henderson
2023-02-28 7:44 ` gaosong
2023-02-28 16:50 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 11/43] target/loongarch: Implement vavg/vavgr Song Gao
2022-12-24 17:52 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 12/43] target/loongarch: Implement vabsd Song Gao
2022-12-24 17:55 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 13/43] target/loongarch: Implement vadda Song Gao
2022-12-24 17:56 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 14/43] target/loongarch: Implement vmax/vmin Song Gao
2022-12-24 18:01 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 15/43] target/loongarch: Implement vmul/vmuh/vmulw{ev/od} Song Gao
2022-12-24 18:07 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 16/43] target/loongarch: Implement vmadd/vmsub/vmaddw{ev/od} Song Gao
2022-12-24 18:09 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 17/43] target/loongarch: Implement vdiv/vmod Song Gao
2022-12-24 8:16 ` [RFC PATCH 18/43] target/loongarch: Implement vsat Song Gao
2022-12-24 18:13 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 19/43] target/loongarch: Implement vexth Song Gao
2022-12-24 8:16 ` [RFC PATCH 20/43] target/loongarch: Implement vsigncov Song Gao
2022-12-24 18:18 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 21/43] target/loongarch: Implement vmskltz/vmskgez/vmsknz Song Gao
2022-12-24 18:31 ` Richard Henderson [this message]
2022-12-24 8:16 ` [RFC PATCH 22/43] target/loongarch: Implement LSX logic instructions Song Gao
2022-12-24 18:34 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 23/43] target/loongarch: Implement vsll vsrl vsra vrotr Song Gao
2022-12-24 18:36 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 24/43] target/loongarch: Implement vsllwil vextl Song Gao
2022-12-24 8:16 ` [RFC PATCH 25/43] target/loongarch: Implement vsrlr vsrar Song Gao
2022-12-24 8:16 ` [RFC PATCH 26/43] target/loongarch: Implement vsrln vsran Song Gao
2022-12-24 8:16 ` [RFC PATCH 27/43] target/loongarch: Implement vsrlrn vsrarn Song Gao
2022-12-24 8:16 ` [RFC PATCH 28/43] target/loongarch: Implement vssrln vssran Song Gao
2022-12-24 8:16 ` [RFC PATCH 29/43] target/loongarch: Implement vssrlrn vssrarn Song Gao
2022-12-24 8:16 ` [RFC PATCH 30/43] target/loongarch: Implement vclo vclz Song Gao
2022-12-24 8:16 ` [RFC PATCH 31/43] target/loongarch: Implement vpcnt Song Gao
2022-12-24 8:16 ` [RFC PATCH 32/43] target/loongarch: Implement vbitclr vbitset vbitrev Song Gao
2022-12-24 8:16 ` [RFC PATCH 33/43] target/loongarch: Implement vfrstp Song Gao
2022-12-24 8:16 ` [RFC PATCH 34/43] target/loongarch: Implement LSX fpu arith instructions Song Gao
2022-12-24 8:16 ` [RFC PATCH 35/43] target/loongarch: Implement LSX fpu fcvt instructions Song Gao
2022-12-24 8:16 ` [RFC PATCH 36/43] target/loongarch: Implement vseq vsle vslt Song Gao
2022-12-24 18:50 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 37/43] target/loongarch: Implement vfcmp Song Gao
2022-12-24 8:16 ` [RFC PATCH 38/43] target/loongarch: Implement vbitsel vset Song Gao
2022-12-24 19:15 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 39/43] target/loongarch: Implement vinsgr2vr vpickve2gr vreplgr2vr Song Gao
2022-12-24 20:34 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 40/43] target/loongarch: Implement vreplve vpack vpick Song Gao
2022-12-24 21:12 ` Richard Henderson
2023-03-21 11:31 ` gaosong
2023-03-21 15:55 ` Richard Henderson
2023-03-22 8:32 ` gaosong
2023-03-22 12:35 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 41/43] target/loongarch: Implement vilvl vilvh vextrins vshuf Song Gao
2022-12-24 8:16 ` [RFC PATCH 42/43] target/loongarch: Implement vld vst Song Gao
2022-12-24 21:15 ` Richard Henderson
2022-12-24 8:16 ` [RFC PATCH 43/43] target/loongarch: Implement vldi Song Gao
2022-12-24 21:18 ` Richard Henderson
2022-12-24 15:39 ` [RFC PATCH 00/43] Add LoongArch LSX instructions Richard Henderson
2022-12-28 0:55 ` gaosong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c49ab02d-ff0c-c17d-0215-f5e083fe3ce2@linaro.org \
--to=richard.henderson@linaro.org \
--cc=gaosong@loongson.cn \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).