conditionalSet sets the target register to 0 or 1 depending on the condition.
(register cpu.Register, op token.Kind, unsigned bool)
| 9 | |
| 10 | // conditionalSet sets the target register to 0 or 1 depending on the condition. |
| 11 | func (f *Function) conditionalSet(register cpu.Register, op token.Kind, unsigned bool) { |
| 12 | if f.build.Arch == config.X86 { |
| 13 | f.Assembler.Append(&asm.MoveNumber{ |
| 14 | Destination: register, |
| 15 | Number: 0, |
| 16 | }) |
| 17 | } |
| 18 | |
| 19 | f.Assembler.Append(&asm.ConditionalSet{ |
| 20 | Destination: register, |
| 21 | Condition: tokenToCondition(op, unsigned), |
| 22 | }) |
| 23 | } |
no test coverage detected