This commit is contained in:
parent
bac5986425
commit
3ae47f93eb
45 changed files with 1417 additions and 0 deletions
17
src/arm/Compare.go
Normal file
17
src/arm/Compare.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package arm
|
||||
|
||||
import "git.urbach.dev/cli/q/src/cpu"
|
||||
|
||||
// CompareRegisterNumber is an alias for a subtraction that updates the conditional flags and discards the result.
|
||||
func CompareRegisterNumber(register cpu.Register, number int) (code uint32, encodable bool) {
|
||||
if number < 0 {
|
||||
return addRegisterNumber(ZR, register, -number, 1)
|
||||
}
|
||||
|
||||
return subRegisterNumber(ZR, register, number, 1)
|
||||
}
|
||||
|
||||
// CompareRegisterRegister is an alias for a subtraction that updates the conditional flags and discards the result.
|
||||
func CompareRegisterRegister(reg1 cpu.Register, reg2 cpu.Register) uint32 {
|
||||
return subRegisterRegister(ZR, reg1, reg2, 1)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue