MCPcopy Create free account
hub / github.com/akyoto/q / conditionalSet

Method conditionalSet

src/codegen/conditionalSet.go:11–23  ·  view source on GitHub ↗

conditionalSet sets the target register to 0 or 1 depending on the condition.

(register cpu.Register, op token.Kind, unsigned bool)

Source from the content-addressed store, hash-verified

9
10// conditionalSet sets the target register to 0 or 1 depending on the condition.
11func (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}

Callers 2

executeBinaryOpMethod · 0.95
executeUnaryOpMethod · 0.95

Calls 2

tokenToConditionFunction · 0.85
AppendMethod · 0.45

Tested by

no test coverage detected