aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir/mem2reg.c
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-12-31 11:13:15 +0100
committer lemon<lsof@mailbox.org>2025-12-31 11:13:15 +0100
commit97c6d5c44f30b29b52d1dc431ab9f2df4bb47fd2 (patch)
tree564615d402793491d545d612df31dd80451120ab /ir/mem2reg.c
parent3a46902b3ede49116522992793d3ececef53c5a8 (diff)
backend: separate instrs for integer/float store
Diffstat (limited to 'ir/mem2reg.c')
-rw-r--r--ir/mem2reg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ir/mem2reg.c b/ir/mem2reg.c
index 4b0b007..7a5874c 100644
--- a/ir/mem2reg.c
+++ b/ir/mem2reg.c
@@ -15,10 +15,18 @@ static const uchar load2ext[] = {
[Oloads32 - Oloads8] = Oexts32, [Oloadu32 - Oloads8] = Oextu32,
[Oloadi64 - Oloads8] = Ocopy,
};
+static const uchar storesz[] = {
+ [Ostorei8 - Ostorei8] = 1,
+ [Ostorei16 - Ostorei8] = 2,
+ [Ostorei32 - Ostorei8] = 4,
+ [Ostorei64 - Ostorei8] = 8,
+ [Ostoref32 - Ostorei8] = 4,
+ [Ostoref64 - Ostorei8] = 8,
+};
#define loadsz(o) (loadszcls[(o) - Oloads8] & 0xF)
#define loadcls(o) (loadszcls[(o) - Oloads8] >> 4)
#define load2ext(o) (load2ext[(o) - Oloads8])
-#define storesz(o) (1 << ((o) - Ostore8))
+#define storesz(o) (storesz[(o) - Ostorei8])
/* Implements algorithm in 'Simple and Efficient Construction of Static Single Assignment' (Braun et al) */