![]() |
![]() |
#1501 |
botcher
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 674
|
I just added the (requested) feature to optimize the shift instructions:
Superfluous signed/unsigned extensions are suppressed and the smallest possible shift is used. Have a look here: https://franke.ms/cex/z/3q19bh. |
![]() |
![]() |
#1502 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 52
Posts: 712
|
Something is not pushed to repository?
with -O2 -fomit-frame-pointer -mregparm -m68020 I get Code:
_lsl_ubb: and.l #255,d0 lsl.l d1,d0 rts _lsl_sbb: lsl.b d1,d0 rts _lsr_ubb: and.l #255,d0 asr.l d1,d0 rts _lsr_sbb: asr.b d1,d0 rts _lsl_usb: and.l #65535,d0 lsl.l d1,d0 rts _lsl_ssb: lsl.w d1,d0 rts _lsr_usb: and.l #65535,d0 asr.l d1,d0 rts _lsr_ssb: asr.w d1,d0 rts If I switch to -O3 I get the correct code for all cpus. So only for 68020 with -O2 there seems to be a glitch. (I've cleaned and rm'd the target directory. All compiled from scratch on pi400) |
![]() |
![]() |
#1503 | |
botcher
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 674
|
Quote:
did the same on an odroid and it's ok. gcc version 6.5.0b 230914152536 the result on the pi400 is still better than before :-) |
|
![]() |
![]() |
#1504 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,589
|
Bebbo something should be done for code short branches to the next instruction
Code:
bne.b 0f 0: |
![]() |
![]() |
#1505 | |
botcher
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 674
|
Quote:
example code please Code:
Disassembly of section .text: 00000000 .text: 0: 6600 0000 bne.w 0x2 Last edited by bebbo; 15 September 2023 at 15:53. |
|
![]() |
![]() |
#1506 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 818
|
I just stumbled into this shift discussion here, and possibly dancing into a minefield (especially at this hour), wouldn't you rather do
Code:
moveq #$3f,d1 and.b 11(sp),d1 |
![]() |
![]() |
#1507 | ||
botcher
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 674
|
Quote:
That AND is implicitly executed by the CPU, no need to add it into the asm code. Quote:
Code:
_lsr_sbb: move.b 7(sp),d1 ext.w d1 ext.l d1 move.b 11(sp),d0 ext.w d0 ext.l d0 asr.l d0,d1 move.l d1,d0 rts Code:
_lsr_sbb: move.b (7,sp),d0 move.b (11,sp),d1 asr.b d1,d0 rts Last edited by bebbo; 17 September 2023 at 08:46. |
||
![]() |
![]() |
#1508 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,589
|
Code:
main: bra.b 0f 0: rts Code:
SECTION S_0,CODE __stext: DC.W $6000 ;0 __etext: RTS ;2: 4e75 END GNU assembler (GNU Binutils) 2.39.0.230129-131808 Copyright (C) 2022 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `m68k-amigaos'. I also had a problem with add.b #1,a0 generating an illegal instruction without errors but now I can't reproduce it. not using any optimization, and using -m68000 flag. |
![]() |
![]() |
#1509 | |
botcher
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 674
|
Quote:
wow, msys2... ... fix is on the way - no idea when msys2 builds successfully again... |
|
![]() |
![]() |
#1510 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,589
|
Don't look at me, I positively hate MSYS2 and its fake linux compatibility
I always use python to control my toolchains, no damn fake shells that can call .bat files (called by .bat files). Take your time. I'm aware of this issue and I'm using jcc a lot anyway. |
![]() |
![]() |
#1511 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,589
|
Oh I found the other bug
Code:
main: subq.b #1,a1 rts disassembly: junk Code:
SECTION S_0,CODE __stext: DC.W $5309 ;0 __etext: RTS ;2: 4e75 END |
![]() |
![]() |
#1512 |
botcher
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 674
|
|
![]() |
![]() |
#1513 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,589
|
you rock!
where can it be downloaded? |
![]() |
![]() |
#1514 |
botcher
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 674
|
|
![]() |
![]() |
#1515 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,589
|
going to burn this on a CD
![]() |
![]() |
![]() |
#1516 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,589
|
bingo
bagman.68k:6737: Error: operands mismatch -- statement `subq.b #1,a2' ignored |
![]() |
Currently Active Users Viewing This Thread: 3 (0 members and 3 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New GCC based dev toolchain for AmigaOS 3.x | cla | Coders. Releases | 8 | 24 December 2017 10:18 |
Issue with photon/xxxx WinUAE Toolchain | arpz | Coders. Asm / Hardware | 2 | 26 September 2015 22:33 |
New 68k gcc toolchain | arti | Coders. C/C++ | 17 | 31 July 2015 03:59 |
Hannibal's WinUAE Demo Toolchain 5 | Bobic | Amiga scene | 1 | 23 July 2015 21:04 |
From gcc to vbcc. | Cowcat | Coders. General | 9 | 06 June 2014 14:45 |
|
|