RISC-V .align 3 - bug or feature?

Schweikhardt, Jens (TSPCE3-TL4) Jens.Schweikhardt at tesat.de
Mon Sep 7 10:05:19 UTC 2020


hello world\n

I'm looking at https://git.rtems.org/rtems/tree/bsps/riscv/shared/start/start.S  which contains near the end

                /* Wait for go issued by the boot processor (mhartid == 0) */
                LADDR  t0, .Lsecondary_processor_go

.Lwait_for_go_again:

                lw           t1, 0(t0)
                fence    iorw, iorw
                bnez      t1, .Lwait_for_go_again

                mv         a0, s1
                call         bsp_start_on_secondary_processor

#if __riscv_xlen == 32
                .align     2
#elif __riscv_xlen == 64
                .align     3                        <------------ Interesting.
#endif

.Lsecondary_processor_go:

                /*
                * These are ebreak instructions, just in case we end up here executing
                * code.
                */
                .word    0x00100073
#if __riscv_xlen == 64
                .word    0x00100073
#endif

I've never come across a situation where I would want alignment 3 on a 64bit CPU.
Is this alignment intended? Is it the base 2 log?

Jens Schweikhardt
-------------------------------------------------------
Tesat-Spacecom GmbH & Co. KG
Gerberstraße 49
D-71522 Backnang
Direct: +49 7191 930 2849

"This electronic message may contain highly confidential or privileged information from Tesat-Spacecom GmbH & Co. KG. Any of the information is only intended for the recipient and the use by any other party is not authorized. If you are not the intended recipient, be aware, that any disclosure, copying, distribution or use of the contents of this message is prohibited. If you have received this message by error please notify us immediately by telephone (+49 7191 930 2849) or by e-mail (Jens.Schweikhardt at Tesat.de). Thank you."


________________________________

Tesat-Spacecom GmbH & Co. KG
Sitz: Backnang; Registergericht: Amtsgericht Stuttgart HRA 270977
Persoenlich haftender Gesellschafter: Tesat-Spacecom Geschaeftsfuehrungs GmbH;
Sitz: Backnang; Registergericht: Amtsgericht Stuttgart HRB 271658;
Geschaeftsfuehrung: Dr. Marc Steckling, Kerstin Basche, Ralf Zimmermann

[banner]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20200907/b7defc2a/attachment-0001.html>


More information about the users mailing list