Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.compilers,comp.arch Subject: Re: Assembling span-dependent instructions Date: Thu, 28 Jul 2022 05:56:28 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 26 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-07-053@comp.compilers> References: <22-07-049@comp.compilers> <22-07-052@comp.compilers> Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="12712"; mail-complaints-to="abuse@iecc.com" Keywords: code, optimize Posted-Date: 29 Jul 2022 16:29:15 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:3140 comp.arch:76959 Kaz Kylheku <480-992-1380@kylheku.com> writes: >On 2022-07-27, Anton Ertl wrote: >> However, one can also construct cases where making the code larger can >> reduce the minimum size of the immediate operand, e.g.: >> >> foo: >> movl foo+133-bar(%rdi),%eax >> bar: > >That's weird; what is accessed this way, relative to the code, >and does it occur in compiler output? I designed this example based on the examples in the paper, not as something occuring in practice. The examples in the paper involved several span-dependent instructions and looked unusual to me, but I convinced myself that something like that could occur in practice, with data close to code addressed using some pointer into the code (like %rip-relative on AMD64, or the global pointer on various position-independent ABIs for other architectures). - anton -- M. Anton Ertl anton@mips.complang.tuwien.ac.at http://www.complang.tuwien.ac.at/anton/