MCPcopy Create free account
hub / github.com/google/gapid / NotEqual

Method NotEqual

core/codegen/arithmetic.go:115–131  ·  view source on GitHub ↗

NotEqual returns x != y. The types of the two values must be equal.

(x, y *Value)

Source from the content-addressed store, hash-verified

113
114// NotEqual returns x != y. The types of the two values must be equal.
115func (b *Builder) NotEqual(x, y *Value) *Value {
116 ty := x.Type()
117 if ty, ok := ty.(*Struct); ok {
118 assertTypesEqual(x.Type(), y.Type())
119 var neq *Value
120 for i, f := range ty.Fields() {
121 x, y := x.Extract(f.Name), y.Extract(f.Name)
122 if i == 0 {
123 neq = b.NotEqual(x, y)
124 } else {
125 neq = b.Or(neq, b.NotEqual(x, y))
126 }
127 }
128 return neq
129 }
130 return b.cmp(x, "!=", y, llvm.IntNE, llvm.IntNE, llvm.FloatONE)
131}
132
133// GreaterThan returns x > y. The types of the two values must be equal.
134func (b *Builder) GreaterThan(x, y *Value) *Value {

Callers 8

CastMethod · 0.80
iterationMethod · 0.80
sliceAssignMethod · 0.80
doBinaryOpMethod · 0.80
bitTestMethod · 0.80
unpackAnyMethod · 0.80
shouldEncodeMethod · 0.80
encodeValueMethod · 0.80

Calls 6

OrMethod · 0.95
cmpMethod · 0.95
assertTypesEqualFunction · 0.85
FieldsMethod · 0.80
ExtractMethod · 0.80
TypeMethod · 0.65

Tested by

no test coverage detected