Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/44945 )
Change subject: arch-arm: Fix SMM* instructions
......................................................................
arch-arm: Fix SMM* instructions
A recent clean up patch [1] introduced some bugs in the instruction
implementation of:
SMMLA, SMMLAR, SMMLS, SMMLSR, SMMUL, SMMULR
[1]: https://gem5-review.googlesource.com/c/public/gem5/+/42387
Change-Id: I459fe99bd2711e00027e9ef0c7796af7a374a509
Signed-off-by: Giacomo Travaglini <[email protected]>
---
M src/arch/arm/isa/insts/mult.isa
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/arch/arm/isa/insts/mult.isa
b/src/arch/arm/isa/insts/mult.isa
index 528aa66..1fcf4a1 100644
--- a/src/arch/arm/isa/insts/mult.isa
+++ b/src/arch/arm/isa/insts/mult.isa
@@ -231,22 +231,26 @@
PInt1 = (uint32_t)(resTemp >> 32);
''')
buildMult4InstUnCc("smmla", '''
- PInt0 = PInt3.sw + ((PInt1.sw * PInt2.sw) >> 32);
+ PInt0 = ((int64_t)(PInt3.sw << 32) + (PInt1.sw * PInt2.sw)) >>
32;
''')
buildMult4InstUnCc("smmlar", '''
- PInt0 = PInt3.sw + ((PInt1.sw * PInt2.sw + (0x1ULL << 31)) >>
32);
+ PInt0 = ((int64_t)(PInt3.sw << 32) +
+ (PInt1.sw * PInt2.sw) +
+ (0x1ULL << 31)) >> 32;
''')
buildMult4InstUnCc("smmls", '''
- PInt0 = PInt3.sw - ((PInt1.sw * PInt2.sw) >> 32);
+ PInt0 = ((int64_t)(PInt3.sw << 32) - (PInt1.sw * PInt2.sw)) >>
32;
''')
buildMult4InstUnCc("smmlsr", '''
- PInt0 = PInt3.sw - ((PInt1.sw * PInt2.sw + (0x1ULL << 31)) >>
32);
+ PInt0 = ((int64_t)(PInt3.sw << 32) -
+ (PInt1.sw * PInt2.sw) +
+ (0x1ULL << 31)) >> 32;
''')
buildMult3InstUnCc("smmul", '''
- PInt0 = (PInt1.sw * PInt2.sw) >> 32;
+ PInt0 = (int64_t)(PInt1.sw * PInt2.sw) >> 32;
''')
buildMult3InstUnCc("smmulr", '''
- PInt0 = (PInt1.sw * PInt2.sw + (0x1ULL << 31)) >> 32;
+ PInt0 = ((int64_t)(PInt1.sw * PInt2.sw) + (0x1ULL << 31)) >>
32;
''')
buildMult3InstCc("smuad", '''
PInt0 = resTemp = PInt1.sh0 * PInt2.sh0 + PInt1.sh1 *
PInt2.sh1;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44945
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I459fe99bd2711e00027e9ef0c7796af7a374a509
Gerrit-Change-Number: 44945
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s