From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D20A22FE11 for ; Thu, 18 Sep 2025 10:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758191985; cv=none; b=DPx1d+50HwuKaIdy8FmHNx4ATnGaIwj9EoBKikrwpPg80cojF+cYxrr5aE0hRILXMPIVumSR+iu857G/pBdK8boPKT/BMDpm4GDPqCjW1Hy1Ik1EYy+dL5uPBPGspBf/cv9XSlMCOYz24OJZ0QalAASei3ghSpG3M6Rd9SH8Ybc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758191985; c=relaxed/simple; bh=9TI98rpj4UFyh8hjqIMELWi51RptK/NApBXVewrfIow=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FFP3LkHC3PL21rhlqylkAQLoAwt0Uoor5TeqD0jL+C3obsLLHH3Dk8o2IJLDhKLRTauD++UtXYBFhsP4x6m7P8EDQzRLWABoJzjbzEG4wcsLTDDKJNVt6D/RtpIhEI7qO1867wUJkTEgAuhmQz1CLKosGed6e8DlBPb4mLcbzdE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=X+atkIlB; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="X+atkIlB" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58I5k2df011456; Thu, 18 Sep 2025 10:39:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=003FqU kLnd1CLFmh8u9Ao2FHIDry7J7aMdlor11h0kw=; b=X+atkIlBMzqvfWBMgp0l1E VmQPhShhTHLtmDaePfVTsyCA0uSTNZ0TjVtAeUNbJ7tDmINe7AcTKotQyWYYST10 O8Fx0io+I3c3rPeyVA6nP2cacdLY5NVd+GZ65j+YRft0ft6My+q8k5wOXQXfg2Jr r+H1cNvapHDMurodt/IEYodRCMWwyCBSaju46PRN97Hl7/oHIo53yamyHTQh0Sws d1yDkxLbFPWTvzdkD2eVw0Tp+Eeedbgmxo4JkqT4zn0Z2dbVtzr5pmaleHzeB+cF N4Gv4H8sZxlA18vUjyDawZN4SQ6vROQQJ2oG6SKdLkMsLPsCWXwWiWmjbJWgmufA == Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 497g4j9ne6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Sep 2025 10:39:24 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 58IAdOBR011095; Thu, 18 Sep 2025 10:39:24 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 497g4j9ne4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Sep 2025 10:39:24 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 58I6q7ET018629; Thu, 18 Sep 2025 10:39:23 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 495n5mnyqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Sep 2025 10:39:23 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 58IAdJF635652046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Sep 2025 10:39:19 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77B2A2004B; Thu, 18 Sep 2025 10:39:19 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36BC620049; Thu, 18 Sep 2025 10:39:19 +0000 (GMT) Received: from [9.152.222.159] (unknown [9.152.222.159]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 18 Sep 2025 10:39:19 +0000 (GMT) Message-ID: <7549e3bb-a956-4706-8735-415df61ea1a1@linux.ibm.com> Date: Thu, 18 Sep 2025 12:39:18 +0200 Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Unaligned access trade-offs for SFrame FRE layout To: Steven Rostedt , Fangrui Song Cc: Indu Bhagat , Jan Beulich , Rainer Orth , "linux-toolchains@vger.kernel.org" , Sterling Augustine , Pavel Labath , Andrii Nakryiko , Josh Poimboeuf , Serhei Makarov , Binutils , Heiko Carstens , Vasily Gorbik References: <9d104c46-855c-4b36-8226-1f59b59e455c@suse.com> <26895e7a-5d54-4c89-aeb4-bcd094ba081d@suse.com> <1308e9fa-90c8-4c52-b53d-afd24542b4c8@suse.com> <76b8c89e-5d80-48da-aff1-580d539d1b87@oracle.com> <20250915120742.7ff2f781@gandalf.local.home> <20250916115801.622c629b@batman.local.home> Content-Language: en-US From: Jens Remus Organization: IBM Deutschland Research & Development GmbH In-Reply-To: <20250916115801.622c629b@batman.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=Qf5mvtbv c=1 sm=1 tr=0 ts=68cbe15d cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=VnNF1IyMAAAA:8 a=CCpqsmhAAAAA:8 a=0MvmVg10__VCTnNSAJcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 X-Proofpoint-ORIG-GUID: DB_wS9_tQ0PiEuZ_b8sDnS4Go1-57Rb0 X-Proofpoint-GUID: oLN3ikrTTINU0wg8ZydT_Nd9bc2plyav X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTE2MDIwNCBTYWx0ZWRfX0YzRjnOdDXkB 7J6rKKovc9syBYJ4Xx/z/jRIEtVYwJJ6061YWI2IjrKv4mlrS2WyZPNzd3Zl2u51OnrgB3PeUk2 8W06Oaa1MWr0LuFmEpDDj4mEdZFZf3AIWybcICzl81qQe2fKUlXIyu4qdmNlUcUTylY+mQMYbkZ 7Vkdd5bMVv52M4ULYYGhUnXeXdtnAC2kp+sqC41zjZkwkf00KFQ2XtSOfhWIrJGynwazuDGFb9S 64h9h4K+Szfr9r4AJ6hr0DqPk5NYI+9yVMyv6pVgEDRoydCoe+3b+BKL0U547pASVd/HNrb2idL ie9/GX2lRzoii2FRTAEHzz6uddrFEjJPBz82Alpqh1SzJVo2me1gUm85X9TmbRoWfOAh3aLag2Q t4+jHZZB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-17_01,2025-09-18_02,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1011 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509160204 On 9/16/2025 5:58 PM, Steven Rostedt wrote: > On Mon, 15 Sep 2025 23:05:09 -0700 > Fangrui Song wrote: > >> From a linker and binary utilities perspective, I'd even suggest >> adopting a universal little-endian format regardless of the target >> system's native endianness. >> This would eliminate the need for endianness templates in the C++ code >> and simplify toolchain implementation across platforms. >> >> On the big-endian z/Architecture, this is efficient: the LOAD REVERSED >> instructions are used by the bswap versions in the following program, >> not even requiring extra instructions. >> #define WIDTH(x) \ >> typedef __UINT##x##_TYPE__ [[gnu::aligned(1)]] uint##x; \ >> uint##x load_inc##x(uint##x *p) { return *p+1; } \ >> uint##x load_bswap_inc##x(uint##x *p) { return __builtin_bswap##x(*p)+1; }; \ >> uint##x load_eq##x(uint##x *p) { return *p==3; } \ >> uint##x load_bswap_eq##x(uint##x *p) { return __builtin_bswap##x(*p)==3; }; \ >> >> WIDTH(16); >> WIDTH(32); >> WIDTH(64); > > I would like to hear the comments from Jens on this, as he's adapting > SFrames for the s390 which I believe is big-endian. This would allow for endianness bugs for the native case only on s390 (and other big-endian architectures). Load Reversed takes longer than a normal Load, as it obviously needs to reverse the register contents. Regards, Jens -- Jens Remus Linux on Z Development (D3303) +49-7031-16-1128 Office jremus@de.ibm.com IBM IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294 IBM Data Privacy Statement: https://www.ibm.com/privacy/