On Wed, 12 Aug 2020 17:35:17 +0300 Konstantin Belousov
<kostik...@gmail.com> wrote:
> On Wed, Aug 12, 2020 at 01:41:58PM +0200, Tijl Coosemans wrote:
>> StgWord64 is uint64_t which is unsigned long long which is 4 byte
>> aligned on i386.  Clang wants 8 byte alignment to use the fildll
>> instruction.  
> This all is very strange.
> 
> How could code use fildll to load 8 bytes as bit-value ?  FILDLL converts
> single and double precision fp into long-double fp, so it would change
> the bit-value.

FILDLL loads long long and converts it to long double which has 64 bit
mantissa so the value is unchanged.

> Also, both ISA and x86 psABI only require 4-byte alignment for the
> double precision fp variables.
> 
> If the variable memory spans over two cache lines, then SDM states that
> the access can be not atomic, but I believe it cannot happen for any
> existing CPU. It might be slow. For some future CPUs, Intel provides
> control which would cause such accesses to trap.

Well, it seems clang follows the SDM and assumes 8 byte alignment is
needed because then the variable never crosses a cache line boundary.
_______________________________________________
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"

Reply via email to