mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-29 00:11:34 +00:00
Fix register width test for risc-v, and improve operand slot type inference for risc-v
This commit is contained in:
@@ -260,8 +260,8 @@ main :: proc() {
|
||||
AliasSrc_ARG0, // user's 1st operand
|
||||
AliasSrc_ARG1, // user's 2nd operand
|
||||
AliasSrc_ARG2, // user's 3rd operand
|
||||
AliasSrc_X0, // hardwired zero (x0)
|
||||
AliasSrc_X1, // link register (ra / x1)
|
||||
AliasSrc_ZERO, // hardwired zero (x0)
|
||||
AliasSrc_LINK, // link register (ra / x1)
|
||||
AliasSrc_LIT, // the `lit` field below (immediate literal)
|
||||
AliasSrc_CSR_LIT, // the `csr` field below (fixed 12-bit CSR address)
|
||||
};
|
||||
@@ -425,7 +425,7 @@ main :: proc() {
|
||||
string_map_set(&mnemonic_map, mnemonic_strings[m], cast(Mnemonic)m);
|
||||
}
|
||||
|
||||
string_map_init(&mnemonic_map, PSEUDO_MNEMONIC_COUNT*2);
|
||||
string_map_init(&pseudo_mnemonic_map, PSEUDO_MNEMONIC_COUNT*2);
|
||||
for (u16 m = PM_INVALID+1; m < PSEUDO_MNEMONIC_COUNT; m++) {
|
||||
string_map_set(&pseudo_mnemonic_map, pseudo_mnemonic_strings[m], cast(PseudoMnemonic)m);
|
||||
}
|
||||
@@ -484,6 +484,10 @@ main :: proc() {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool integer_reg_width_is_exact() const {
|
||||
return false;
|
||||
}
|
||||
""")
|
||||
strings.write_string(&sb, "\n\n")
|
||||
|
||||
|
||||
@@ -341,7 +341,13 @@ main :: proc() {
|
||||
strings.write_string(&sb, "\n");
|
||||
strings.write_string(&sb, """
|
||||
enum AliasSrc : u8 {
|
||||
AliasSrc_NONE, // slot unused
|
||||
AliasSrc_NONE, // slot unused
|
||||
AliasSrc_ARG0, // user's 1st operand
|
||||
AliasSrc_ARG1, // user's 2nd operand
|
||||
AliasSrc_ARG2, // user's 3rd operand
|
||||
AliasSrc_ZERO, // hardwired zero
|
||||
AliasSrc_LINK, // link register
|
||||
AliasSrc_LIT,
|
||||
};
|
||||
|
||||
struct PseudoAlias {
|
||||
@@ -520,6 +526,10 @@ main :: proc() {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool integer_reg_width_is_exact() const {
|
||||
return true;
|
||||
}
|
||||
""")
|
||||
strings.write_string(&sb, "\n\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user