[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two build fixes for watcom compiler:
From: |
Alexei Podtelezhnikov |
Subject: |
Re: Two build fixes for watcom compiler: |
Date: |
Fri, 14 Jan 2022 12:30:10 -0500 |
> -#if defined( __i386__ )
OMG, Watcom C/C++ defines it in every possible way. I will start from
if ( __WATCOMC__ ) then nothing. Otherwise, these look great. Thanks!
On Fri, Jan 14, 2022 at 11:38 AM Ozkan Sezer <sezeroz@gmail.com> wrote:
>
> On 1/14/22, Ozkan Sezer <sezeroz@gmail.com> wrote:
> > On 1/14/22, Alexei Podtelezhnikov <apodtele@gmail.com> wrote:
> >>> #if defined(_MSC_VER) && defined(_M_IX86)
> >>
> >> I think this is appropriate, it makes it clear which compiler is
> >> intended.
> >
> > OK, as you wish.
> >
> >> As for `near`, I found the undefine option
> >> https://users.pja.edu.pl/~jms/qnx/help/watcom/compiler-tools/cpopts.html#SWu
> >
> > Ah, nothing specific for near macro itself, but the standart '-U'
> > like many other compilers.
> >
> >> Do you use any special build tools/scripts to insert it?
> >
> > I use a makefile for os/2, so I can add -Unear to CFLAGS (tested
> > and works.)
> >
> >> Finally, does Watcom have 64-bit types these days? We could insert it in
> >> https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/include/freetype/config/integer-types.h
> >
> > As of version 11.0, it supports long long: You can check like:
> > #if (__WATCOMC__ >= 1100)
> >
> > It also supports __int64 but don't know as of which version.
> >
> >> Do you know of any fast most-significnat-bit functions, like
> >> __builtin_clz, for Watcom?
> >
> > You can inline-asm the bsr instruction with Watcom's aux pragma for
> > _BitScanReverse behavior, provided that you handle x==0 special case,
> > (replace uint32_t with unsigned long if you like). Like:
> >
> > #if defined(__WATCOMC__) && defined(__386__)
> > extern __inline int _bsr_watcom(uint32_t);
> > #pragma aux _bsr_watcom = \
> > "bsr eax, eax" \
> > parm [eax] nomemory \
> > value [eax] \
> > modify exact [eax] nomemory;
> > #endif
> >
> > Or, if you specifically want __builtin_clz-like behavior, here is a
> > version which xors the result with 31:
> > static __inline int _clz_watcom(uint32_t);
> > #pragma aux _clz_watcom = \
> > "bsr eax, eax" \
> > "xor eax, 31" \
> > parm [eax] nomemory \
> > value [eax] \
> > modify exact [eax] nomemory;
> > #endif
>
> Attaching new patches. Tell me if you need any changes.
--
Alexei A. Podtelezhnikov, PhD
- Two build fixes for watcom compiler:, Ozkan Sezer, 2022/01/13
- Re: Two build fixes for watcom compiler:, Alexei Podtelezhnikov, 2022/01/13
- Re: Two build fixes for watcom compiler:, Ozkan Sezer, 2022/01/13
- Re: Two build fixes for watcom compiler:, Ozkan Sezer, 2022/01/14
- Re: Two build fixes for watcom compiler:, Ozkan Sezer, 2022/01/14
- Re: Two build fixes for watcom compiler:, Alexei Podtelezhnikov, 2022/01/14
- Re: Two build fixes for watcom compiler:, Ozkan Sezer, 2022/01/14
- Re: Two build fixes for watcom compiler:, Ozkan Sezer, 2022/01/14
- Re: Two build fixes for watcom compiler:,
Alexei Podtelezhnikov <=
- Re: Two build fixes for watcom compiler:, Ozkan Sezer, 2022/01/14