From: David Laight <David.Laight@ACULAB.COM>
To: 'Youling Tang' <tangyouling@loongson.cn>,
WANG Xuerui <kernel@xen0n.name>
Cc: Huacai Chen <chenhuacai@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Peter Zijlstra <peterz@infradead.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Jason Baron <jbaron@akamai.com>, Zhangjin Wu <falcon@tinylab.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"loongarch@lists.linux.dev" <loongarch@lists.linux.dev>
Subject: RE: [PATCH v2] LoongArch: Add jump-label implementation
Date: Thu, 11 May 2023 10:21:17 +0000 [thread overview]
Message-ID: <644efa37967b4944aeb41d4ab9faeceb@AcuMS.aculab.com> (raw)
In-Reply-To: <72b6c81a-d4ee-575a-ff48-6be7e034ac96@loongson.cn>
From: Youling Tang
> Sent: 11 May 2023 02:34
...
> >> + if (type == JUMP_LABEL_JMP)
> >
> > Please use a switch for dealing with enum-typed values.
>
> Because the current type only has JUMP_LABEL_NOP and JUMP_LABEL_JMP,
> using if may be simpler than switch.
The generated code will be pretty much the same.
Even if the compiler is allowed generate a jump table
(which is almost certainly disabled) it won't if there
are only two cases.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2023-05-11 10:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 9:16 [PATCH v2] LoongArch: Add jump-label implementation Youling Tang
2023-05-10 9:27 ` Peter Zijlstra
2023-05-10 9:34 ` WANG Xuerui
2023-05-10 11:23 ` Peter Zijlstra
2023-05-11 1:32 ` Youling Tang
2023-05-10 9:28 ` WANG Xuerui
2023-05-11 1:33 ` Youling Tang
2023-05-11 7:43 ` Peter Zijlstra
2023-05-11 10:07 ` WANG Xuerui
2023-05-11 10:21 ` David Laight [this message]
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=644efa37967b4944aeb41d4ab9faeceb@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=chenhuacai@kernel.org \
--cc=corbet@lwn.net \
--cc=falcon@tinylab.org \
--cc=jbaron@akamai.com \
--cc=jpoimboe@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=tangyouling@loongson.cn \
/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