Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Michael Van Canneyt via fpc-devel
On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote: On Thu, Aug 11, 2022 at 9:37 PM Martin Frb via fpc-devel < fpc-devel@lists.freepascal.org> wrote: fpc code is still "unexpected". It takes into account the MinValue type TMyEnum = (a=5, b=7); GetEnumName(pt, 5) // a GetEnumName(pt, 6

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Martin Frb via fpc-devel
On 16/08/2022 09:37, Michael Van Canneyt via fpc-devel wrote: On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote: And function GetEnumValue() is buggy. It is not buggy. It does not support enumerateds with gaps, because RTTI does not support enumerateds with gaps. It never has. ...  

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Michael Van Canneyt via fpc-devel
On Tue, 16 Aug 2022, Martin Frb via fpc-devel wrote: On 16/08/2022 09:37, Michael Van Canneyt via fpc-devel wrote: On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote: And function GetEnumValue() is buggy. It is not buggy. It does not support enumerateds with gaps, because RTTI does n

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Ondrej Pokorny via fpc-devel
Am 16.08.2022 um 09:37 schrieb Michael Van Canneyt via fpc-devel: On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote: On Thu, Aug 11, 2022 at 9:37 PM Martin Frb via fpc-devel < fpc-devel@lists.freepascal.org> wrote: fpc code is still "unexpected". It takes into account the MinValue type T

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Michael Van Canneyt via fpc-devel
On Tue, 16 Aug 2022, Ondrej Pokorny via fpc-devel wrote: --- code end Run it in Delphi and FPC and compare the outputs: Delphi output: PropCount: 0 Property info is null FPC output: PropCount: 1 Property name: Fruit Property kind: tkEnumeration As you can see FPC creates a valid PropInfo

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Ondrej Pokorny via fpc-devel
Am 16.08.2022 um 13:19 schrieb Michael Van Canneyt via fpc-devel: On Tue, 16 Aug 2022, Ondrej Pokorny via fpc-devel wrote: --- code end Run it in Delphi and FPC and compare the outputs: Delphi output: PropCount: 0 Property info is null FPC output: PropCount: 1 Property name: Fruit Property ki

Re: [fpc-devel] Gaps in a non-contiguous enum

2022-08-16 Thread Michael Van Canneyt via fpc-devel
On Tue, 16 Aug 2022, Ondrej Pokorny via fpc-devel wrote: Am 16.08.2022 um 13:19 schrieb Michael Van Canneyt via fpc-devel: On Tue, 16 Aug 2022, Ondrej Pokorny via fpc-devel wrote: --- code end Run it in Delphi and FPC and compare the outputs: Delphi output: PropCount: 0 Property info is nu

[fpc-devel] Question about memory alignment (again!)

2022-08-16 Thread J. Gareth Moreton via fpc-devel
Hi everyone, Recently I've made some optimisations centred around the SHR instruction on x86, and there was one pair of instructions that caught my attention: movl (%rbx),%eax shrl $24,%eax Is it permissible to optimise this to (x86 is little-endian): movzbl 3(%rbx),%eax? (You could also op