[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 2/8] riscv: Generate payload scripts
From: |
Richard Henderson |
Subject: |
Re: [RFC PATCH 2/8] riscv: Generate payload scripts |
Date: |
Mon, 11 May 2020 10:40:58 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 4/30/20 12:21 AM, LIU Zhiwei wrote:
> + # sequence of li rd, 0x1234567887654321
> + #
> + # 0: 002471b7 lui rd,0x247
> + # 4: 8ad1819b addiw rd,rd,-1875
> + # 8: 00c19193 slli rd,rd,0xc
> + # c: f1118193 addi rd,rd,-239 # 0x246f11
> + # 10: 00d19193 slli rd,rd,0xd
> + # 14: d9518193 addi rd,rd,-619
> + # 18: 00e19193 slli rd,rd,0xe
> + # 1c: 32118193 addi rd,rd,801
You don't really need to use addiw. Removing that special case would really
simplify this.
> +sub write_memblock_setup()
> +{
> + # Write code which sets up the memory block for loads and stores.
> + # We set r0 to point to a block of 16K length
> + # of random data, aligned to the maximum desired alignment.
> +
> + my $align = $MAXALIGN;
> + my $datalen = 16384 + $align;
risu.h:#define MEMBLOCKLEN 8192
Why are you using 16384?
Also, typo -- you're setting r10 not r0, obviously.
The rest looks fine.
r~
- Re: [RFC PATCH 2/8] riscv: Generate payload scripts,
Richard Henderson <=