Re: [PATCH 08/39] don't use word-size specifiers

From: H. Peter Anvin
Date: Fri Jun 27 2008 - 19:19:09 EST


Glauber Costa wrote:
since the instructions refer to registers, they'll be able
to figure it out.

Signed-off-by: Glauber Costa <gcosta@xxxxxxxxxx>

diff --git a/arch/x86/lib/getuser_32.S b/arch/x86/lib/getuser_32.S
index 6d84b53..8200fde 100644
--- a/arch/x86/lib/getuser_32.S
+++ b/arch/x86/lib/getuser_32.S
@@ -29,44 +29,44 @@
ENTRY(__get_user_1)
CFI_STARTPROC
GET_THREAD_INFO(%edx)
- cmpl TI_addr_limit(%edx),%eax
+ cmp TI_addr_limit(%edx),%eax
jae bad_get_user
-1: movzbl (%eax),%edx
- xorl %eax,%eax
+1: movzb (%eax),%edx
+ xor %eax,%eax
ret
CFI_ENDPROC

I hate to say it, but I really think this is a step backwards in readability. Consistency is a good thing, and with the suffixes in place we are consistent between instructions that refer to memory and instructions that refer to registers. We also get one more check on things, where the assembler can tell the programmer he probably typoed.

So I would prefer if we *didn't* go down this route, except for explicit unification, but that's not the case here (since the size is still explicit in the register names.)

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/