Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-13 Thread Dmitry Boyarintsev
On Saturday, October 13, 2018, Jonas Maebe wrote: > > A single test program compiled at a single optimization level does not > demonstrate how a particular compiler generates code in all possible > situations. In addition, the ABI specification trumps a particular > compiler's implementation in an

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-13 Thread Jonas Maebe
On 13/10/18 16:45, Dmitry Boyarintsev wrote: On Sat, Oct 13, 2018 at 9:55 AM Dmitry Boyarintsev mailto:skalogryz.li...@gmail.com>> wrote: ObjC language doesn't have its own boolean type. No. I'm convienced now: http://wiki.freepascal.org/ObjC_Bool It appears the the compiler is always cl

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-13 Thread Dmitry Boyarintsev
On Sat, Oct 13, 2018 at 9:55 AM Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > ObjC language doesn't have its own boolean type. > No. I'm convienced now: http://wiki.freepascal.org/ObjC_Bool It appears the the compiler is always clearing the entire register to pass the paramater. No mat

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-13 Thread Dmitry Boyarintsev
On Sat, Oct 13, 2018 at 3:08 AM Michael Van Canneyt wrote: > > Because introducing a type in a language and naming it after some library > is > not done. objcbool at least refers to another language. > ObjC language doesn't have its own boolean type. It's either C "_Bool" for ARM, or "a signed c

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-13 Thread Sven Barth via fpc-devel
Dmitry Boyarintsev schrieb am Sa., 13. Okt. 2018, 01:57: > On Fri, Oct 12, 2018 at 6:48 PM Sven Barth via fpc-devel < > fpc-devel@lists.freepascal.org> wrote: > >> Not quite: the Boolean16, Boolean32 and Boolean64 types were introduced >> because the libraries provided by GTK required a 4-Byte bo

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-13 Thread Michael Van Canneyt
On Fri, 12 Oct 2018, Dmitry Boyarintsev wrote: 2) why the were they named booleanN rather than gtkboolean or something? (I'm referring to the suggestion of using objcbool name. It seem to fit) Because introducing a type in a language and naming it after some library is not done. objcbool at

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 6:48 PM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote: > Not quite: the Boolean16, Boolean32 and Boolean64 types were introduced > because the libraries provided by GTK required a 4-Byte boolean type that > worked like Object Pascal's Boolean. > That's in

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Sven Barth via fpc-devel
Dmitry Boyarintsev schrieb am Fr., 12. Okt. 2018, 22:55: > On Fri, Oct 12, 2018 at 3:51 PM Sven Barth via fpc-devel < > fpc-devel@lists.freepascal.org> wrote: > >> All the Pascal Boolean types are not "Integer types". You can't assign >> any of them to a Integer or whatever without typecasting. T

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 3:51 PM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote: > All the Pascal Boolean types are not "Integer types". You can't assign > any of them to a Integer or whatever without typecasting. They *all* > behave like Boolean, because that was the way they wer

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Michael Van Canneyt
On Fri, 12 Oct 2018, Jonas Maebe wrote: On 12/10/18 22:00, Michael Van Canneyt wrote: What exactly is wrong ? Boolean8/16/32/64 are ordinal and boolean types, but not integer types. OK. I will rephrase the wording. Thanks! Michael. ___ fpc-dev

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Jonas Maebe
On 12/10/18 22:00, Michael Van Canneyt wrote: What exactly is wrong ? Boolean8/16/32/64 are ordinal and boolean types, but not integer types. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailma

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Michael Van Canneyt
On Fri, 12 Oct 2018, Sven Barth via fpc-devel wrote: On 10/12/18 7:21 PM, Dmitry Boyarintsev wrote: On Fri, Oct 12, 2018 at 1:07 PM Sven Barth via fpc-devel mailto:fpc-devel@lists.freepascal.org>> wrote: Dmitry Boyarintsev mailto:skalogryz.li...@gmail.com>> schrieb am Fr., 12. Okt. 2018,

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Sven Barth via fpc-devel
On 10/12/18 7:21 PM, Dmitry Boyarintsev wrote: > On Fri, Oct 12, 2018 at 1:07 PM Sven Barth via fpc-devel > mailto:fpc-devel@lists.freepascal.org>> > wrote: > > Dmitry Boyarintsev > schrieb am Fr., 12. Okt. 2018, > 17:26: > > Maybe "Boolean8"

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 2:31 PM Jonas Maebe wrote: > The documentation is wrong. > > Boolean8 is defined as an alias for Boolean in the RTL, so it won't > help. If the intent of BooleanN is to help interfacing C-libraries. Would it make sense to change BooleanN from being an alias to more consis

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Jonas Maebe
On 12/10/18 19:21, Dmitry Boyarintsev wrote: Boolean8 is not exactly an alias to Boolean, as it's expected to act as an integer, The documentation is wrong. rather than _Bool. (and would be expected? to be passed an Boolean8 is defined as an alias for Boolean in the RTL, so it won't help.

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 1:07 PM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote: > > Boolean8 is an alias to Boolean. But if you need to work with 1 and 0, but > have 4 Byte width then you could try Boolean32. > Indeed. It's scheduled for 3.2.0 release as alias for Boolean. Howev

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 1:07 PM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote: > Dmitry Boyarintsev schrieb am Fr., 12. Okt. > 2018, 17:26: > >> Maybe "Boolean8" type should help instead? >> David, could you please test with Boolean8 instead of ByteBool? >> > > Boolean8 is an

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Sven Barth via fpc-devel
Dmitry Boyarintsev schrieb am Fr., 12. Okt. 2018, 17:26: > > > On Fri, Oct 12, 2018 at 11:09 AM Dmitry Boyarintsev < > skalogryz.li...@gmail.com> wrote: > >> so, far the only reliable approach to fix the issue (for the current >> compiler version) is something like that: >> > > Maybe "Boolean8"

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 11:09 AM Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > so, far the only reliable approach to fix the issue (for the current > compiler version) is something like that: > Maybe "Boolean8" type should help instead? David, could you please test with Boolean8 inste

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 10:38 AM David Jenkins wrote: > The movsbl %dl, %edx is good. Unfortunately the value of %edx is > 0x not 0x0001. This is the same result I saw when I changed it > to LongBool. > I presume this is due to the definition of YES macro in objc, which is 1 (rathe

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread David Jenkins
Bug report is entered: Mantis #0034411 David ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread David Jenkins
On 10/12/18 8:17 AM, Dmitry Boyarintsev wrote: So, I'm wondering if it's actually a compiler issue or headers issue. and can ByteBool be used as a substitute for signed char. thanks, Dmitry ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-12 Thread Dmitry Boyarintsev
On Fri, Oct 12, 2018 at 1:51 AM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote: > Dmitry Boyarintsev schrieb am Fr., 12. Okt. > 2018, 02:07: > >> On Thu, Oct 11, 2018 at 4:16 PM Jonas Maebe wrote: >> >>> However, the Objective-C BOOL type does not map to _Bool on x86-64, but >>

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-11 Thread Sven Barth via fpc-devel
Dmitry Boyarintsev schrieb am Fr., 12. Okt. 2018, 02:07: > On Thu, Oct 11, 2018 at 4:16 PM Jonas Maebe wrote: > >> However, the Objective-C BOOL type does not map to _Bool on x86-64, but >> to signed char. And values of that type indeed do need to (sign) >> extended. >> > > Should use of ByteBoo

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-11 Thread Dmitry Boyarintsev
On Thu, Oct 11, 2018 at 4:16 PM Jonas Maebe wrote: > However, the Objective-C BOOL type does not map to _Bool on x86-64, but > to signed char. And values of that type indeed do need to (sign) > extended. > Should use of ByteBool resolve the problems for ObjC mapped headers for the current versio

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-11 Thread David Jenkins
Thanks.  I'll get a bug report in tomorrow morning. On 10/11/18 3:16 PM, Jonas Maebe wrote: On 11/10/18 21:41, David Jenkins wrote: Here is the assembly code generated by fpc (3.1.1) for just the section where .setEnabled(Enabled) is called ->  0x1001ba68d <+61>:  movq   -0x8(%rbp), %rdi    

Re: [fpc-devel] OSX: Setting up parameters to objc_msgSend()

2018-10-11 Thread Jonas Maebe
On 11/10/18 21:41, David Jenkins wrote: Here is the assembly code generated by fpc (3.1.1) for just the section where .setEnabled(Enabled) is called ->  0x1001ba68d <+61>:  movq   -0x8(%rbp), %rdi     0x1001ba691 <+65>:  callq  0x1002016d0   ; GETHANDLE at menuitem.inc:515