-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If SplitEmptyMask does not apply, fall back to normal split. Missing CmpFRISC. Renamed riscv flags. RetRISC handls FPR remove extra RegMask constructurs
- Loading branch information
1 parent
4cdb14b
commit b1756ef
Showing
10 changed files
with
74 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
chapter20/src/main/java/com/seaofnodes/simple/node/cpus/riscv/CmpFRISC.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.seaofnodes.simple.node.cpus.riscv; | ||
|
||
import com.seaofnodes.simple.*; | ||
import com.seaofnodes.simple.codegen.CodeGen; | ||
import com.seaofnodes.simple.codegen.RegMask; | ||
import com.seaofnodes.simple.node.*; | ||
import com.seaofnodes.simple.type.Type; | ||
import com.seaofnodes.simple.type.TypeFunPtr; | ||
import java.io.ByteArrayOutputStream; | ||
|
||
// Compare. Sets flags.(RFLAGS) | ||
public class CmpFRISC extends MachConcreteNode implements MachNode{ | ||
CmpFRISC( Node cmp ) { super(cmp); } | ||
|
||
// Encoding is appended into the byte array; size is returned | ||
@Override public int encoding(ByteArrayOutputStream bytes) { | ||
throw Utils.TODO(); | ||
} | ||
|
||
|
||
// General form: "cmp rs1, rs2" | ||
@Override public void asm(CodeGen code, SB sb) { | ||
String dst = code.reg(this); | ||
if( dst!="flags" ) sb.p(dst).p(" = "); | ||
sb.p(code.reg(in(1))).p(", ").p(code.reg(in(2))); | ||
} | ||
|
||
@Override public RegMask regmap(int i) { assert i==1 || i==2; return riscv.FMASK; } | ||
@Override public RegMask outregmap() { return riscv.FLAGS_MASK; } | ||
|
||
@Override public String op() { return "cmpf"; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters