RISC-V .align 3 - bug or feature?

Hesham Almatary heshamelmatary at gmail.com
Mon Sep 7 11:58:17 UTC 2020


On Mon, 7 Sep 2020 at 11:05, Schweikhardt, Jens (TSPCE3-TL4)
<Jens.Schweikhardt at tesat.de> wrote:
>
> 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?
>
It's 2^3 = 8. We should probably use balign instead to avoid such confusion.

>
>
> 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
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users

-- 
Hesham


More information about the users mailing list