MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / widen

Method widen

chapter22/src/main/java/com/seaofnodes/simple/node/Node.java:632–640  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

630 // If any input is a float, flip to a float-flavored opcode and widen any
631 // non-float input.
632 public final Node widen() {
633 if( !hasFloatInput() ) return this;
634 Node flt = copyF();
635 if( flt==null ) return this;
636 for( int i=1; i<nIns(); i++ )
637 flt.setDef(i, in(i)._type instanceof TypeFloat ? in(i) : new ToFloatNode(in(i)).peephole());
638 kill();
639 return flt;
640 }
641 private boolean hasFloatInput() {
642 for( int i=1; i<nIns(); i++ )
643 if( in(i)._type instanceof TypeFloat )

Callers 6

parseShiftMethod · 0.95
parseAdditionMethod · 0.95
opAssignMethod · 0.95
parseComparisonMethod · 0.45
parseMultiplicationMethod · 0.45
parseUnaryMethod · 0.45

Calls 7

hasFloatInputMethod · 0.95
copyFMethod · 0.95
nInsMethod · 0.95
setDefMethod · 0.95
inMethod · 0.95
killMethod · 0.95
peepholeMethod · 0.45

Tested by

no test coverage detected