@@ -779,3 +779,73 @@ def ROTW : RRR_Inst<0x00, 0x00, 0x04, (outs), (ins imm8n_7:$imm),
779779 let s = 0x0;
780780 let t = imm{3-0};
781781}
782+
783+ //===----------------------------------------------------------------------===//
784+ // Boolean Instructions
785+ //===----------------------------------------------------------------------===//
786+
787+ def ALL4 : RRR_Inst<0x00, 0x00, 0x00, (outs BR:$t), (ins BR:$s),
788+ "all4\t$t, $s", []>, Requires<[HasBoolean]> {
789+ let r = 0x9;
790+ }
791+
792+ def ALL8 : RRR_Inst<0x00, 0x00, 0x00, (outs BR:$t), (ins BR:$s),
793+ "all8\t$t, $s", []>, Requires<[HasBoolean]> {
794+ let r = 0xB;
795+ }
796+
797+ def ANDB : RRR_Inst<0x00, 0x02, 0x00, (outs BR:$r), (ins BR:$s, BR:$t),
798+ "andb\t$r, $s, $t", []>, Requires<[HasBoolean]>;
799+ def ANDBC : RRR_Inst<0x00, 0x02, 0x01, (outs BR:$r), (ins BR:$s, BR:$t),
800+ "andbc\t$r, $s, $t", []>, Requires<[HasBoolean]>;
801+ def ORB : RRR_Inst<0x00, 0x02, 0x02, (outs BR:$r), (ins BR:$s, BR:$t),
802+ "orb\t$r, $s, $t", []>, Requires<[HasBoolean]>;
803+ def ORBC : RRR_Inst<0x00, 0x02, 0x03, (outs BR:$r), (ins BR:$s, BR:$t),
804+ "orbc\t$r, $s, $t", []>, Requires<[HasBoolean]>;
805+ def XORB : RRR_Inst<0x00, 0x02, 0x04, (outs BR:$r), (ins BR:$s, BR:$t),
806+ "xorb\t$r, $s, $t", []>, Requires<[HasBoolean]>;
807+
808+ def ANY4 : RRR_Inst<0x00, 0x00, 0x00, (outs BR:$t), (ins BR:$s),
809+ "any4\t$t, $s", []>, Requires<[HasBoolean]> {
810+ let r = 0x8;
811+ }
812+
813+ def ANY8 : RRR_Inst<0x00, 0x00, 0x00, (outs BR:$t), (ins BR:$s),
814+ "any8\t$t, $s", []>, Requires<[HasBoolean]> {
815+ let r = 0xA;
816+ }
817+
818+ let isBranch = 1, isTerminator = 1, Predicates = [HasBoolean] in {
819+ def BT : RRI8_Inst<0x06, (outs), (ins BR:$b, brtarget:$target),
820+ "bt\t$b, $target", []> {
821+ bits<8> target;
822+ bits<4> b;
823+
824+ let r = 0x1;
825+ let s = b;
826+ let t = 0x7;
827+ let imm8 = target;
828+ }
829+
830+ def BF : RRI8_Inst<0x06, (outs), (ins BR:$b, brtarget:$target),
831+ "bf\t$b, $target", []> {
832+ bits<8> target;
833+ bits<4> b;
834+
835+ let r = 0x0;
836+ let s = b;
837+ let t = 0x7;
838+ let imm8 = target;
839+ }
840+ }
841+
842+ def : InstAlias<"_BT\t$b, $target", (BT BR:$b, brtarget:$target)>;
843+ def : InstAlias<"_BF\t$b, $target", (BF BR:$b, brtarget:$target)>;
844+
845+ let Constraints = "$dr = $r,@earlyclobber $dr" in {
846+ def MOVF : RRR_Inst<0x00, 0x03, 0x0C, (outs AR:$dr), (ins AR:$r, AR:$s, BR:$t),
847+ "movf\t$r, $s, $t", []>, Requires<[HasBoolean]>;
848+
849+ def MOVT : RRR_Inst<0x00, 0x03, 0x0D, (outs AR:$dr), (ins AR:$r, AR:$s, BR:$t),
850+ "movt\t$r, $s, $t", []>, Requires<[HasBoolean]>;
851+ }
0 commit comments