From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2079.outbound.protection.outlook.com [40.107.7.79]) by sourceware.org (Postfix) with ESMTPS id 0245C3857728 for ; Tue, 24 Oct 2023 08:55:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0245C3857728 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0245C3857728 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.79 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698137741; cv=pass; b=hg46urDTQZW3HbOOPKxXF+XsXuznLnyoZabLk1Y1gLb4xYfFVmrn9kQAKn7uUpctXSyk1AuTevBnnKG0IgzCDIoDZTY3GyVn67cTNUqMLKtB3kk4XKpN0pdnzvfDHeNEFm6jg1HmUAX9eQPOpiQyB5vXkMP5U9LJJ4RJwxP5jwE= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698137741; c=relaxed/simple; bh=1HdHyCjevqtzZmLvW6NqknBwcLB4oJCmMVx+I4PcBBk=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=Pm/9uC7fvEst0KJMIVoGN81Pi80JXpMBGgIOyXgAIVMCZMnfvMnuggzyt6Dpl7j/pnjoLGHwBFcH2Ie98Y8fzvxxcmSBpJuwtzinuuwgJ7RBfRbfqpoCxPkcUyIEmz3AvVBjJ4NL7iVp21lV7K+vK/g11wyapE/9TYiHTTVWdlA= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bCtdKw0YvZzNcAMFHO2/554hlH2QE1RfpGad2XhFkH93dRsstw+6F4EQlXAN3pyBZ70TIKRJ0QdUjKQoO058Nmr9stxy/F/2UnEDSsj4PFbBMBDFdfnx/gnWohWv5UermrbuArRD4lXgTgjNxRHZWj7q4901oIDj8nJj8yaTnNWPaf/tF6EnQ4ida15pijM0FwWaQEcA3ecbFS3lUMB5ora/vA7aI7mtEPZFkym8udOh6JNPTg1pg+DuM4hfyiPrkfZgldPYftgvH23YTjkzqzTrTDncKr7IoTN1SG73+o5Q9Rhy+4MTFJQPSKNoOpheGIdhYGsvdY5TJFI9BsIgSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/ITuDJVXMH9QlugqJLU+QOUEfMTXNxx1bkfyi2u77YA=; b=Qo/x9iKR7BRaWA8lUt/Zos//9Gd9ap8OZFTMkhfoVqThGDqlPwySMPpcmr335ccLe7aNVDc13/9fnR28Ws3qxWzgKiGtcvQfzKOwMTEN2We5ic+jzrcVCQNjPfOt/1rcpdCTWVecBedmzp/ChX7xNVcDfofsAa31bynWQZVT4/GsGrOLjs7oW6F6MYzrtIld6GuyAOJDUTOtoU25WlCiZgdL+VgBbd81g0dCe0BlgEXnPuWoabzIpXrIp2Pnzaza+n+/+XVEJ8S3cQyWhWZ2eQwlWMQeh/cXtcnUPjneQoCApMlztmU+23nNroJby1NLfhT0oBlxoopgAdBke6rwAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/ITuDJVXMH9QlugqJLU+QOUEfMTXNxx1bkfyi2u77YA=; b=Yh3flchpBCggKPuO1RZkcYOy7EvjXkJf8MYLX3N4upB5flwRjrK2e8tFo6A8ZtHZDKG9msAeVHUzFvuFwbTq8Um4LGp/P2f1c0cDDyyf4lx2tVmJ1TS1TbIn7eTzpHCRAS21dEIaoaTidLJnxVhr2aaAAda6KqQXYz5WX0tujjNj6rzH0jmkamIqzP8Qo/WzeiUKdnzN2TZXGSX7YhfhW4MBhIEbmpoKh3Y5TTeDEtWQVXvYuYUv7yb5Y2k/TDaZ+S73fFog9XPRbay7GkTEAtcJQKa8w26Kn2x8QC6k+7vTVRTSgg46IQsGY1qSOA3vzA1+S5DeQNt4giczjdxsuA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by PR3PR04MB7386.eurprd04.prod.outlook.com (2603:10a6:102:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.11; Tue, 24 Oct 2023 08:55:35 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::d924:b650:a2ad:7b25]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::d924:b650:a2ad:7b25%3]) with mapi id 15.20.6933.011; Tue, 24 Oct 2023 08:55:34 +0000 Message-ID: <1760f135-7d53-7922-17b9-8e44c1296247@suse.com> Date: Tue, 24 Oct 2023 10:55:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] Support Intel USER_MSR Content-Language: en-US To: "Hu, Lin1" , "Lu, Hongjiu" Cc: "binutils@sourceware.org" References: <20231010072401.1383177-1-lin1.hu@intel.com> <3504781c-a806-335f-a9df-615ed3565e5e@suse.com> From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR3P281CA0108.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::11) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|PR3PR04MB7386:EE_ X-MS-Office365-Filtering-Correlation-Id: 14b47ef4-98e7-456c-62dc-08dbd46efc48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oXnxto/SctXMi9a3rt5rqAshWDBkV74x8resBCtDqf6EALaDhj0Wa3Rhr2H7ohZ6bxCZY5gLbdiu9tAhkol5J6hhPsA0SQIhgGxiuVdsJ6MmFKlJw1tF4HfoM7ySIQewc+eOINoj2S5KC/OG4rsFwgO5o4zjYAJgYkRf1Ot0vmclPAKajLHl6jzwJuQ6dGif6jmmXgw8VU3Ft/n0GUL6vNvDPgkLPhysS/dgQAmY12yCQTkwssFK2fG87NkR8lXCfW/2AZ0r4iEBoXNBQxNNtPeOpSHh45GC4Dd0WUiFrO+XPpMS0yWhWc9J4lBgHSekrDO0iC4QZ20i6LqVeFSFp2+66af9QVs/zX+zaqfe8YpysVej1412ZuFDvodFsF2o+4XIibscO5iqQ3KjYur6kOxWPZ4OGDSqyGR7vTN80B+3V1S0rZ0HBgDDU7GLf7wlL4pvXTD0F9e8GN5wjIKEsnHyMRaacvxIzy1ZlwNEC0dKCFTnYwGxMI0shogaCGkaFOiVa/GYlSPi1UMX2FiSOA6aPG947qb/SyFD5dNZZF4c5expCxX41gLzQh2dhnTau9F9UoZZwwGANtpeW0yH9awlHGxqLjrCvn6HTy20o+8dITwFd81oYm/jz+fmckiJLnTfQ5ZYtCnq4pVa4zYNfQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(39860400002)(396003)(136003)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(26005)(2906002)(41300700001)(66899024)(2616005)(36756003)(86362001)(31696002)(38100700002)(83380400001)(5660300002)(6512007)(6506007)(53546011)(66476007)(316002)(478600001)(66556008)(66946007)(6486002)(110136005)(31686004)(4326008)(8936002)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N0tBTGQ1NGVRVEw5Ym9UT25LdkhKTDI1eEtEYjFDK2dwTGZkRFVNM0h6Q1hR?= =?utf-8?B?aUk1dlRnZkZXdDlsODFxRU9rSVBVMVRFK1RZQUhvK2xybEtKNk1BTFU5MXhB?= =?utf-8?B?bFBoUWp3VnZNS25YVEdFdC9ZcWFPSXlBZmZKcElyRC9PM0wrKzVMbm9GYk0x?= =?utf-8?B?WGdOaWNKSlNhZitTRSs4QWNHTXI5SjkwcjdUUVFGVmM4QjB6eDg2dXZEK3Rp?= =?utf-8?B?VkxhVnFsUHZzYkczQkJEOVNCWU5ycjAyV245NlNneUtNUUJUMzJDTzJUQllr?= =?utf-8?B?YVM0QXhYODZzS1U0WUhRaTNLRTdLWjlteG53YmZETmhTQkNFTFVMU3Mray8z?= =?utf-8?B?aG1CSWdabHdjSjJMZEI4WW9vYVlYU0VkQXZlZVFiaDROV0tXTkorTGI3cnFy?= =?utf-8?B?d29USWFXK1dpL3owanhDVWxBTEdxMmU0cDl6bURXSndJS1lpTDdrbHRrb0JX?= =?utf-8?B?UHJaVUxScTBkV05xRDZtVW5jaW4yTFNBdnJQWFphc2pWN1cybXhZOVZmU2NY?= =?utf-8?B?WnZIWVp4NlorMnFZTm02MkUrekMvdDFyRkJOTE5YbWNLSnViK0dXSTNiNWwv?= =?utf-8?B?NUdtYXZiSG11U0N4cGVmVkI0aGZOblRzWkljbmNsQWFLQjlCSmE4cEVIOTNQ?= =?utf-8?B?L21TemVnV2dwLy84T3NDblc0c0JsUlFFWjFKVTFYUG1Ubkl4c0M3ZnNrK2J6?= =?utf-8?B?WUx5eEpnL21RYzlCWXIzOEliZUF3YTlvQk5JVld2eEFZNi9pZG9NakI5eHRo?= =?utf-8?B?Y0VtSGpQY2NySnpJbk44b0RtSVNBUlZhU2c5dElxcUphK0w2YzdpRUNOUEtl?= =?utf-8?B?REs1WG9IbEpISkR2TlpiZWpnSXlWZkt3ZmNVZUNEdGhXMVJVTnpGM0VXM2to?= =?utf-8?B?dkFieDNoZmRiekxOdU9GbWd3cjdMSEE2NjFvOURHVjRJSWVHcWRhOE5STTBw?= =?utf-8?B?bTA1TW5aUThRS05zTkQ4S3kySkZJVUREL29Ud3RPUFA3aUtWdkdrWENmQkVj?= =?utf-8?B?STl0T0NBejVHVjQrK0FZUi9IZkVEb0FLNWFmU3NTcWh6NWxuSGRXREErUmpr?= =?utf-8?B?VDV5aUtjSHQ3QlhBSlhVSThmN2Zudm9SMGRLWEk3cS9FcUM5SmYwemdFbmE4?= =?utf-8?B?OXV6UktuNm5jeXpjSnBTNEtxenFGUkRkQnZDREZpamtVcXE3VUVmVHRQRTYv?= =?utf-8?B?bjlvVUFycHlPRTQxSXRKKzZmTUs4MVU4THBkclU1Sy8yMVBHd1VzK2ZHVmpl?= =?utf-8?B?dWh3aDRqMWU1MlV3WTk2LzJFVjhvVkJraWlUYWIyVG1iM3dQV3U1SkZQNEhO?= =?utf-8?B?OVROUTB0MGFpcmh6WG9GMWJqV3ZnZUlva0VvU0lrMldRak1vRjBVL0x6T0Vx?= =?utf-8?B?THlScDIxMXUraG5MK1V2QWIzeng5UkRIQXNYeGR5bUVYS0drTS9IamlLK1hI?= =?utf-8?B?WHhPazdyTjdCTE1RVkd1d1RWOUxmd0hsanUzV1JUeExIT1NQYjVzcXNvNERt?= =?utf-8?B?K2NIa1YwUC80U2M4U1EyYlEvN1JtakVKREZ1Y25FNU9jUXhwRGQ4MHhrdXpx?= =?utf-8?B?QWpoWHRucVU4ZkxncENkeVh4MmtlUy9JWStrTXdlcmUycTVaaWxtVVp4djdP?= =?utf-8?B?MUNLOGZRZ0piSGFXYXBHRWY4R1IybXUzbmxERkJManZ3VThDVmVoZXAxejVH?= =?utf-8?B?VzRiMUFNakwwTFJwNTJqcFBGZmFYQkkveCtyUFVxOS9kcjJhbkZIQ3ZrcHll?= =?utf-8?B?THdqcC9rdFZ0OEhkMTVRbVNjTkxXQ3c1VHRoak5XcE9yVE1PdjdBZ0RpWkxG?= =?utf-8?B?N3d6NlZHaG5NMnlIek80bWJyTXl1d3YxYzJYQkl6UHFDa28yT1ZwL2lMQlFG?= =?utf-8?B?RnZyMG84Y0ZybFJ4SVRwcWx4WHR5blZoYXJNUndPeWxzK2lYUUEzN3l2UUdE?= =?utf-8?B?bWJFTjFPY3ZBSjV6MEV0c0h3VGU0R0JPaGtlL2NDV2tBOUZSSDRITjVyaU9X?= =?utf-8?B?VW5WcERlWVVlTXpzWEpPRHUzWmN5a29JRFdFQmJ5bjIreld2YllDNENkWmVP?= =?utf-8?B?RllOOURPNEVGMFdyN3JobklFZXJQRFA0Um5JU2RJWjNhZVpYU1A1c1dPNlJB?= =?utf-8?Q?ZdNjFUn7EE27Jsu/snsTXANID?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14b47ef4-98e7-456c-62dc-08dbd46efc48 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2023 08:55:34.8496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3TQ8BymRQFTQlrygBmremR11I6Jp2HD1uVqGoxo4OXChY4tq3zQlDVVAYj7UnekAUB2V5z3lYVbMNnhyLu/UPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7386 X-Spam-Status: No, score=-3027.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LOTS_OF_MONEY,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 24.10.2023 10:38, Hu, Lin1 wrote: >> -----Original Message----- >> From: Jan Beulich >> Sent: Thursday, October 19, 2023 4:36 PM >> >> On 18.10.2023 09:51, Hu, Lin1 wrote: >>> -----Original Message----- >>> From: Jan Beulich >>> Sent: Monday, October 16, 2023 8:11 PM >>> >>> On 10.10.2023 09:24, Hu, Lin1 wrote: >>>> @@ -8752,6 +8755,18 @@ build_modrm_byte (void) >>>> source = v; >>>> v = tmp; >>>> } >>>> + if (i.tm.opcode_modifier.operandconstraint == SWAP_SOURCE_DEST) >>>> + { >>>> + if (dest == (unsigned int) ~0) >>>> + source = source ^ 1; >>>> + else >>>> + { >>>> + unsigned int tmp = source; >>>> + >>>> + source = dest; >>>> + dest = tmp; >>>> + } >>>> + } >>> >>>> Why is this needed? There's only a single register operand in both affected >> insn forms (see comment below on the 2-register form). >>> Furthermore I think it would be easier if you "canonicalized" the early >> immediate to be the 1st operand, such that for all other purposes immediates >> remain first. >>> >>>> As a cosmetic nit: Please have a blank line ahead of the if() block (if it needs >> to stay). >>> >>> Indeed, I've only kept the part that deals with a single register. Do you mean to >> complain to the person who designed the insn. Unfortunately, that's impossible. >> >> I'm having trouble connecting your reply to what I wrote. No, I do not mean to >> complain; I can certainly see why the immediate is wanted as first (Intel) / last >> (AT&T) operand. >> >> I'm also not happy about the new change to build_modrm_byte(). When asking >> to "canonicalize" operands, I meant to gave this generalized, with >> SWAP_SOURCE_DEST dropped completely. (This will then also save me from >> complaining about a missing blank in SwapSourceDest's >> #define.) >> > > OK, I implemented a basic logic to handle the current situation, and included remarks. > Like: > > /* If the last operand is an immediate number (ATT), we need to modify > the source operand accordingly. If any instructions use other immediate > (imm8, imm16, etc.) as the last operand, we must update the constraint. */ > if (i.types[source].bitfield.imm32 == 1) > source--; > > What's your opinion on this version? As before - build_modrm_byte() is the wrong place to make the intended (generalized) adjustment. You want to move the unusually placed imm operand to its usual place as soon as you're done with matching input against the respective template. >>>> --- /dev/null >>>> +++ b/gas/testsuite/gas/i386/x86-64-user_msr.s >>>> @@ -0,0 +1,15 @@ >>>> +# Check 64bit USER_MSR instructions >>>> + >>>> + .allow_index_reg >>>> + .text >>>> +_start: >>>> + urdmsr %r14, %r12 #USER_MSR >>>> + urdmsr $51515151, %r12 #USER_MSR >>>> + uwrmsr %r12, %r14 #USER_MSR >>>> + uwrmsr %r12, $51515151 #USER_MSR >>>> + >>>> +.intel_syntax noprefix >>> >>>> Nit: Please indent directives. >>> Have removed these comments. >> >> Neither does your reply fit here, nor did you what I've asked for here (in addition >> to the earlier, wider request of dropping meaningless comments). >> > > Perhaps there's an issue with my interface, but it seems to me that the > instruction now begins with a \t instead of two spaces for the updated patch. Not that you say "instruction" when I said "directive". My comment wasn't about any instruction, but about the ".intel_syntax noprefix" line. >>>> @@ -6791,6 +6839,297 @@ static const struct dis386 vex_table[][256] = { >>>> { Bad_Opcode }, >>>> { Bad_Opcode }, >>>> }, >>>> + /* VEX_MAP7 */ >>>> + { >>>> + /* 00 */ >>>> + { Bad_Opcode }, >>> >>>> I wonder whether adding a full new table (rather than some special >>>> case >>>> code) is really a god use of space. Of course if you know that more of it will >> be populated in the not too distant future ... >>> >>> I don't know, I'm just treating the new opcode_space MAP7 like other >> opcode_space. >> >> I'm afraid that "I don't know" is not an answer here. You can basically take two >> positions: Mine (waste of space) or you justify why the extra space used (and the >> extra runtime relocations added) aren't of concern. >> > > OK, I will skip MAP7 table. If vex_table_index = VEX_MAP7 and index == f8 > dp will be VEX_LEN_MAP7_F8. So I don't need to add a full new table untill other MAP7 > instructions raise. H.J., before we go this route, what's your view here? >>>> @@ -11248,6 +11609,20 @@ get32s (instr_info *ins, bfd_vma *res) >>>> return true; >>>> } >>>> >>>> +/* The function is used to get imm32, when imm32 is operand 0, and >>>> +ins only has 2 operands. */ static bool >>>> +get32_operand0 (instr_info *ins, bfd_vma *res) { >>>> + >>>> + if (!fetch_code (ins->info, ins->codep + 5)) >>>> + return false; >>>> + *res = *(ins->codep++ + 1) & (bfd_vma) 0xff; >>>> + *res |= (*(ins->codep++ + 1) & (bfd_vma) 0xff) << 8; >>>> + *res |= (*(ins->codep++ + 1) & (bfd_vma) 0xff) << 16; >>>> + *res |= (*(ins->codep++ + 1) & (bfd_vma) 0xff) << 24; >>>> + return true; >>>> +} >>> >>>> Instead of this (which assumes ModRM.mod == 3) I think you want to arrange >> for dealing with ModRM first. We already have OP_Skip_MODRM() for such >> needs, which you could use in a first "hidden" operand. >>> >>> I want to output imm32 first, but modrm byte is behind imm32, so I need to >> skip modrm for the moment. but I can't use OP_Skip_MODRM to deal with my >> problem, If I use it, I should add ins->codep-- at the end of get32_operand0. >> >> get32_operand0() should go away imo; at the very least I don't agree with >> special casing it being operand 0 (which, as you realize, is true only in the textual >> representation, and only in Intel syntax, but in particular not in the encoding). It >> may be necessary to special case it being an unsigned immediate, but get32() >> already fits that purpose. > > I've thought of it so far is I can use a Fixup function like > > static bool > uwrmsr_Fixup (instr_info *ins, int bytemode, int sizeflag) > { > if (bytemode == d_mode) > { > if (OP_Skip_MODRM (ins, 0, sizeflag)) > { > if (OP_I (ins, bytemode, sizeflag)) > { > ins->codep--; > } > return true; > } > } > return false; > } > > Then the uwrmsr's unit will be { "uwrmsr", { { uwrmsr_Fixup, d_mode }, Rq }, 0 }. > What‘s your opinion? Hmm, not very nice, but I can't exclude it simply won't get any better. My desire was for there to not be any new fixup function, and for OP_Skip_MODRM to be used directly in the table entry. (In any event, if you really need to keep this new function, please combine the three if()-s into a single one, helping readability quite a bit. Jan