coderJeff wrote: ↑Nov 25, 2023 11:35
Do you know an '-march' that would be seen as 'generic' across many targets?
Thanks for your attention, but no, sorry. I just trial-and-error tested findings from the internet. The solution at least runs on a BeagleBoneBlack with TI am3358 CPU.
BTW, I found an other issue: this code (minimal extract from
https://github.com/dtjf/libpruio)
Code: Select all
#DEFINE PRUIO_DEF_AVRAGE 0
#DEFINE PRUIO_DEF_SDELAY 0
#DEFINE PRUIO_DEF_ODELAY 0
TYPE AS UBYTE UInt8
TYPE AS ULONG UInt32
TYPE AdcSteps
AS UInt32 _
Confg _ '*< Context for configuration register.
, Delay '*< Context for delay register.
END TYPE
TYPE AdcSet
'...
AS AdcSteps St_p(16)
'...
END TYPE
TYPE AdcUdt
'...
AS AdcSet PTR _
Init _ '*< Initial subsystem configuration, used in the destructor PruIo::~PruIo().
, Conf '*< Current subsystem configuration, used in PruIo::config().
'...
DECLARE FUNCTION setStep CDECL( _
BYVAL AS UInt8 _
, BYVAL AS UInt8 _
, BYVAL AS UInt8 = PRUIO_DEF_AVRAGE _
, BYVAL AS UInt8 = PRUIO_DEF_SDELAY _
, BYVAL AS UInt32 = PRUIO_DEF_ODELAY) AS ZSTRING PTR
END TYPE
FUNCTION AdcUdt.setStep CDECL( _
BYVAL Stp AS UInt8 _
, BYVAL ChN AS UInt8 _
, BYVAL Av AS UInt8 = PRUIO_DEF_AVRAGE _
, BYVAL SaD AS UInt8 = PRUIO_DEF_SDELAY _
, BYVAL OpD AS UInt32 = PRUIO_DEF_ODELAY) AS ZSTRING PTR
'...
WITH *Conf.St_p(Stp)
VAR a = ABS((Av > 1) + (Av > 2) + (Av > 4) + (Av > 8))
.Confg = (a SHL 2) + (ChN SHL 19)
.Delay = (OpD AND &h3FFFF) + (SaD SHL 24)
END WITH : RETURN 0
END FUNCTION
compiled with former versions but fails in 1.20 by message
$ fbc -Wc -march=armV7-a+fp 1-20.bas
1-20.bas(44) error 265: Symbol not a CLASS, ENUM, TYPE or UNION type, before '.' in 'WITH *Conf.St_p(Stp)'
1-20.bas(46) error 18: Element not defined, Confg in '.Confg = (a SHL 2) + (ChN SHL 19)'
1-20.bas(47) error 18: Element not defined, Delay in '.Delay = (OpD AND &h3FFFF) + (SaD SHL 24)'
But it's working when using nested WITH blocks like
Code: Select all
''WITH *Conf.St_p(Stp)
WITH *Conf
WITH .St_p(Stp)
'...
Regards