mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
test/codegen: add a test for negation and conversion to int32
Codify the current code generation used on riscv64 in this case. Change-Id: If4152e3652fc19d0aa28b79dba08abee2486d5ae Reviewed-on: https://go-review.googlesource.com/c/go/+/652317 Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
e1f9013a58
commit
a8f2e63f2f
@ -173,6 +173,12 @@ func AddAddSubSimplify(a, b, c int) int {
|
||||
return r
|
||||
}
|
||||
|
||||
func NegToInt32(a int) int {
|
||||
// riscv64: "NEG","MOVW"
|
||||
r := int(int32(-a))
|
||||
return r
|
||||
}
|
||||
|
||||
// -------------------- //
|
||||
// Multiplication //
|
||||
// -------------------- //
|
||||
|
Loading…
x
Reference in New Issue
Block a user