Open
Description
Global symbols are not treated as 32-bit immediates in arithmetic instructions. We are losing one move
.
Code:
#include <stdint.h>
uint8_t dpu_mram_buffer[(8 << 20)];
extern void bar(uint8_t *ptr);
void foo(uint32_t i) {
bar(dpu_mram_buffer+i);
}
Output:
foo: // @foo
sd r22, 0, d22
add r22, r22, 8
move r1, dpu_mram_buffer
add r0, r1, r0
call r23, bar
ld d22, r22, -8
jump r23