VAX: Another small GAS bug?

Jan-Benedict Glaw <[email protected]>
Newsgroups gmane.os.netbsd.ports.vax
Message-ID <[email protected]>
Hi!

While working on reproducible builds trying to get the exact same
output from a Linux-hosted build compared to a NetBSD build
environment, I found some issues with GAS.

  Three modules were not reproducible, which is most probably due to
qsort() being used in ./usr.bin/config, so the generated ioconf.c for
these modules (scmdi2c, sdtemp, spdmem), and probably also ioconf.c
generated for the kernel proper. (A similar issue arises with
./extern/bsd/file, where the magic.mgc file isn't reproducible
probably also due to qsort().)

  But one issue remains with GAS!  In unimpl_emul.S, we have these
three source areas which were disassembled to a different instruction stream:


The first two issues are in `emodd`, here:

[...]
464 emodd:  bsbw    touser
[...]
678 3:
679         cmpl %r8, $0x38
680         blss 1f
681         /*
682          * In the case where we have more than 55 bits in the integer,
683          * there aren't any bits left for the fraction.  Therefore we're
684          * done here;  TMPFRAC1 is equal to TMPFRACTGT and TMPFRAC2 is 0.
685          */
686         movq $0f0.0, TMPFRAC2
687         jmp 9f          /* we're done, move on */
688 1:      


--- netbsd.asm  2024-04-04 17:01:08.840403364 +0200
+++ linux.asm   2024-04-04 17:00:59.517135013 +0200
  47c:  d1 58 38        cmpl r8,$0x38
  47f:  19 0f           blss 490 <emodd+0x1e8>
- 481:  7d 8f 00 00     movq $0x00007f7f00000000,0x20(ap)
- 485:  00 00 7f 7f 
+ 481:  7d 8f 00 00     movq $0x0000000000000000,0x20(ap)
+ 485:  00 00 00 00 
  489:  00 00 ac 20 
  48d:  17 af 78        jmp 508 <emodd+0x260>


...and here:

725 8:      
726         /*
727          * We are less than 1.0; TMPFRAC1 should be 0, and TMPFRAC2 should
728          * be equal to TMPFRACTGT.
729          */
730         movd $0f0.0, TMPFRAC1
731         movd TMPFRACTGT, TMPFRAC2
732 9:                      

--- netbsd.asm  2024-04-04 17:01:08.840403364 +0200
+++ linux.asm   2024-04-04 17:00:59.517135013 +0200
  4f5:  17 af 10        jmp 508 <emodd+0x260>
- 4f8:  70 8f 00 00     movd $0x00007f7f00000000 [d-float],(ap)                 730
- 4fc:  00 00 7f 7f 
+ 4f8:  70 8f 00 00     movd $0x0000000000000000 [d-float],(ap)
+ 4fc:  00 00 00 00 
  500:  00 00 6c 
  503:  70 ac 40 ac     movd 0x40(ap),0x20(ap)
  507:  20 



...and the third is with `zeroexit`:

760 zeroexit:
761         /* Z == 1, everything else has been cleared already */
762         bisl2 $PSL_Z, S_PSL
763         bsbw getaddr_byte
764         movl $0x0, (%r0)
765         bsbw getaddr_byte
766         movd $0f0, (%r0)
767         brw goback


--- netbsd.asm  2024-04-04 17:01:08.840403364 +0200
+++ linux.asm   2024-04-04 17:00:59.517135013 +0200
 00000531 <zeroexit>:
  531:  c8 04 ad 40     bisl2 $0x4,0x40(fp)
  535:  30 85 fc        bsbw 1bd <getaddr_byte>
  538:  d0 00 60        movl $0x0,(r0)
  53b:  30 7f fc        bsbw 1bd <getaddr_byte>
- 53e:  70 8f 00 00     movd $0x00007f7f00000000 [d-float],(r0)
- 542:  00 00 7f 7f 
+ 53e:  70 8f 00 00     movd $0x0000000000000000 [d-float],(r0)
+ 542:  00 00 00 00 
  546:  00 00 60 
  549:  31 f8 fa        brw 44 <goback>



Who will find the GAS encoding issue first?

MfG, JBG

--
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCZg7JBAAKCRAdvV51g5nh
u5dDAJ90eu1MqP1j2BQqqABueYQggcHWyACgjuRnSIGkFjII4J0CiBtdym+nvL0=
=EYg4
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.