// autogenerated from gen/RISCV.rules: do not edit!
// generated with: cd gen; go run *.go

package ssa

import "math"

var _ = math.MinInt8 // in case not otherwise used
func rewriteValueRISCV(v *Value, config *Config) bool {
	switch v.Op {
	case OpAdd16:
		return rewriteValueRISCV_OpAdd16(v, config)
	case OpAdd32:
		return rewriteValueRISCV_OpAdd32(v, config)
	case OpAdd32F:
		return rewriteValueRISCV_OpAdd32F(v, config)
	case OpAdd64:
		return rewriteValueRISCV_OpAdd64(v, config)
	case OpAdd64F:
		return rewriteValueRISCV_OpAdd64F(v, config)
	case OpAdd8:
		return rewriteValueRISCV_OpAdd8(v, config)
	case OpAddPtr:
		return rewriteValueRISCV_OpAddPtr(v, config)
	case OpAddr:
		return rewriteValueRISCV_OpAddr(v, config)
	case OpAnd16:
		return rewriteValueRISCV_OpAnd16(v, config)
	case OpAnd32:
		return rewriteValueRISCV_OpAnd32(v, config)
	case OpAnd64:
		return rewriteValueRISCV_OpAnd64(v, config)
	case OpAnd8:
		return rewriteValueRISCV_OpAnd8(v, config)
	case OpAndB:
		return rewriteValueRISCV_OpAndB(v, config)
	case OpAvg64u:
		return rewriteValueRISCV_OpAvg64u(v, config)
	case OpClosureCall:
		return rewriteValueRISCV_OpClosureCall(v, config)
	case OpCom16:
		return rewriteValueRISCV_OpCom16(v, config)
	case OpCom32:
		return rewriteValueRISCV_OpCom32(v, config)
	case OpCom64:
		return rewriteValueRISCV_OpCom64(v, config)
	case OpCom8:
		return rewriteValueRISCV_OpCom8(v, config)
	case OpConst16:
		return rewriteValueRISCV_OpConst16(v, config)
	case OpConst32:
		return rewriteValueRISCV_OpConst32(v, config)
	case OpConst32F:
		return rewriteValueRISCV_OpConst32F(v, config)
	case OpConst64:
		return rewriteValueRISCV_OpConst64(v, config)
	case OpConst64F:
		return rewriteValueRISCV_OpConst64F(v, config)
	case OpConst8:
		return rewriteValueRISCV_OpConst8(v, config)
	case OpConstBool:
		return rewriteValueRISCV_OpConstBool(v, config)
	case OpConstNil:
		return rewriteValueRISCV_OpConstNil(v, config)
	case OpConvert:
		return rewriteValueRISCV_OpConvert(v, config)
	case OpCvt32Fto32:
		return rewriteValueRISCV_OpCvt32Fto32(v, config)
	case OpCvt32Fto64:
		return rewriteValueRISCV_OpCvt32Fto64(v, config)
	case OpCvt32Fto64F:
		return rewriteValueRISCV_OpCvt32Fto64F(v, config)
	case OpCvt32to32F:
		return rewriteValueRISCV_OpCvt32to32F(v, config)
	case OpCvt32to64F:
		return rewriteValueRISCV_OpCvt32to64F(v, config)
	case OpCvt64Fto32:
		return rewriteValueRISCV_OpCvt64Fto32(v, config)
	case OpCvt64Fto32F:
		return rewriteValueRISCV_OpCvt64Fto32F(v, config)
	case OpCvt64Fto64:
		return rewriteValueRISCV_OpCvt64Fto64(v, config)
	case OpCvt64to32F:
		return rewriteValueRISCV_OpCvt64to32F(v, config)
	case OpCvt64to64F:
		return rewriteValueRISCV_OpCvt64to64F(v, config)
	case OpDeferCall:
		return rewriteValueRISCV_OpDeferCall(v, config)
	case OpDiv16:
		return rewriteValueRISCV_OpDiv16(v, config)
	case OpDiv16u:
		return rewriteValueRISCV_OpDiv16u(v, config)
	case OpDiv32:
		return rewriteValueRISCV_OpDiv32(v, config)
	case OpDiv32F:
		return rewriteValueRISCV_OpDiv32F(v, config)
	case OpDiv32u:
		return rewriteValueRISCV_OpDiv32u(v, config)
	case OpDiv64:
		return rewriteValueRISCV_OpDiv64(v, config)
	case OpDiv64F:
		return rewriteValueRISCV_OpDiv64F(v, config)
	case OpDiv64u:
		return rewriteValueRISCV_OpDiv64u(v, config)
	case OpDiv8:
		return rewriteValueRISCV_OpDiv8(v, config)
	case OpDiv8u:
		return rewriteValueRISCV_OpDiv8u(v, config)
	case OpEq16:
		return rewriteValueRISCV_OpEq16(v, config)
	case OpEq32:
		return rewriteValueRISCV_OpEq32(v, config)
	case OpEq32F:
		return rewriteValueRISCV_OpEq32F(v, config)
	case OpEq64:
		return rewriteValueRISCV_OpEq64(v, config)
	case OpEq64F:
		return rewriteValueRISCV_OpEq64F(v, config)
	case OpEq8:
		return rewriteValueRISCV_OpEq8(v, config)
	case OpEqB:
		return rewriteValueRISCV_OpEqB(v, config)
	case OpEqPtr:
		return rewriteValueRISCV_OpEqPtr(v, config)
	case OpGeq16:
		return rewriteValueRISCV_OpGeq16(v, config)
	case OpGeq16U:
		return rewriteValueRISCV_OpGeq16U(v, config)
	case OpGeq32:
		return rewriteValueRISCV_OpGeq32(v, config)
	case OpGeq32F:
		return rewriteValueRISCV_OpGeq32F(v, config)
	case OpGeq32U:
		return rewriteValueRISCV_OpGeq32U(v, config)
	case OpGeq64:
		return rewriteValueRISCV_OpGeq64(v, config)
	case OpGeq64F:
		return rewriteValueRISCV_OpGeq64F(v, config)
	case OpGeq64U:
		return rewriteValueRISCV_OpGeq64U(v, config)
	case OpGeq8:
		return rewriteValueRISCV_OpGeq8(v, config)
	case OpGeq8U:
		return rewriteValueRISCV_OpGeq8U(v, config)
	case OpGetClosurePtr:
		return rewriteValueRISCV_OpGetClosurePtr(v, config)
	case OpGoCall:
		return rewriteValueRISCV_OpGoCall(v, config)
	case OpGreater16:
		return rewriteValueRISCV_OpGreater16(v, config)
	case OpGreater16U:
		return rewriteValueRISCV_OpGreater16U(v, config)
	case OpGreater32:
		return rewriteValueRISCV_OpGreater32(v, config)
	case OpGreater32F:
		return rewriteValueRISCV_OpGreater32F(v, config)
	case OpGreater32U:
		return rewriteValueRISCV_OpGreater32U(v, config)
	case OpGreater64:
		return rewriteValueRISCV_OpGreater64(v, config)
	case OpGreater64F:
		return rewriteValueRISCV_OpGreater64F(v, config)
	case OpGreater64U:
		return rewriteValueRISCV_OpGreater64U(v, config)
	case OpGreater8:
		return rewriteValueRISCV_OpGreater8(v, config)
	case OpGreater8U:
		return rewriteValueRISCV_OpGreater8U(v, config)
	case OpHmul16:
		return rewriteValueRISCV_OpHmul16(v, config)
	case OpHmul16u:
		return rewriteValueRISCV_OpHmul16u(v, config)
	case OpHmul32:
		return rewriteValueRISCV_OpHmul32(v, config)
	case OpHmul32u:
		return rewriteValueRISCV_OpHmul32u(v, config)
	case OpHmul64:
		return rewriteValueRISCV_OpHmul64(v, config)
	case OpHmul64u:
		return rewriteValueRISCV_OpHmul64u(v, config)
	case OpHmul8:
		return rewriteValueRISCV_OpHmul8(v, config)
	case OpHmul8u:
		return rewriteValueRISCV_OpHmul8u(v, config)
	case OpInterCall:
		return rewriteValueRISCV_OpInterCall(v, config)
	case OpIsInBounds:
		return rewriteValueRISCV_OpIsInBounds(v, config)
	case OpIsNonNil:
		return rewriteValueRISCV_OpIsNonNil(v, config)
	case OpIsSliceInBounds:
		return rewriteValueRISCV_OpIsSliceInBounds(v, config)
	case OpLeq16:
		return rewriteValueRISCV_OpLeq16(v, config)
	case OpLeq16U:
		return rewriteValueRISCV_OpLeq16U(v, config)
	case OpLeq32:
		return rewriteValueRISCV_OpLeq32(v, config)
	case OpLeq32F:
		return rewriteValueRISCV_OpLeq32F(v, config)
	case OpLeq32U:
		return rewriteValueRISCV_OpLeq32U(v, config)
	case OpLeq64:
		return rewriteValueRISCV_OpLeq64(v, config)
	case OpLeq64F:
		return rewriteValueRISCV_OpLeq64F(v, config)
	case OpLeq64U:
		return rewriteValueRISCV_OpLeq64U(v, config)
	case OpLeq8:
		return rewriteValueRISCV_OpLeq8(v, config)
	case OpLeq8U:
		return rewriteValueRISCV_OpLeq8U(v, config)
	case OpLess16:
		return rewriteValueRISCV_OpLess16(v, config)
	case OpLess16U:
		return rewriteValueRISCV_OpLess16U(v, config)
	case OpLess32:
		return rewriteValueRISCV_OpLess32(v, config)
	case OpLess32F:
		return rewriteValueRISCV_OpLess32F(v, config)
	case OpLess32U:
		return rewriteValueRISCV_OpLess32U(v, config)
	case OpLess64:
		return rewriteValueRISCV_OpLess64(v, config)
	case OpLess64F:
		return rewriteValueRISCV_OpLess64F(v, config)
	case OpLess64U:
		return rewriteValueRISCV_OpLess64U(v, config)
	case OpLess8:
		return rewriteValueRISCV_OpLess8(v, config)
	case OpLess8U:
		return rewriteValueRISCV_OpLess8U(v, config)
	case OpLoad:
		return rewriteValueRISCV_OpLoad(v, config)
	case OpLsh16x16:
		return rewriteValueRISCV_OpLsh16x16(v, config)
	case OpLsh16x32:
		return rewriteValueRISCV_OpLsh16x32(v, config)
	case OpLsh16x64:
		return rewriteValueRISCV_OpLsh16x64(v, config)
	case OpLsh16x8:
		return rewriteValueRISCV_OpLsh16x8(v, config)
	case OpLsh32x16:
		return rewriteValueRISCV_OpLsh32x16(v, config)
	case OpLsh32x32:
		return rewriteValueRISCV_OpLsh32x32(v, config)
	case OpLsh32x64:
		return rewriteValueRISCV_OpLsh32x64(v, config)
	case OpLsh32x8:
		return rewriteValueRISCV_OpLsh32x8(v, config)
	case OpLsh64x16:
		return rewriteValueRISCV_OpLsh64x16(v, config)
	case OpLsh64x32:
		return rewriteValueRISCV_OpLsh64x32(v, config)
	case OpLsh64x64:
		return rewriteValueRISCV_OpLsh64x64(v, config)
	case OpLsh64x8:
		return rewriteValueRISCV_OpLsh64x8(v, config)
	case OpLsh8x16:
		return rewriteValueRISCV_OpLsh8x16(v, config)
	case OpLsh8x32:
		return rewriteValueRISCV_OpLsh8x32(v, config)
	case OpLsh8x64:
		return rewriteValueRISCV_OpLsh8x64(v, config)
	case OpLsh8x8:
		return rewriteValueRISCV_OpLsh8x8(v, config)
	case OpMod16:
		return rewriteValueRISCV_OpMod16(v, config)
	case OpMod16u:
		return rewriteValueRISCV_OpMod16u(v, config)
	case OpMod32:
		return rewriteValueRISCV_OpMod32(v, config)
	case OpMod32u:
		return rewriteValueRISCV_OpMod32u(v, config)
	case OpMod64:
		return rewriteValueRISCV_OpMod64(v, config)
	case OpMod64u:
		return rewriteValueRISCV_OpMod64u(v, config)
	case OpMod8:
		return rewriteValueRISCV_OpMod8(v, config)
	case OpMod8u:
		return rewriteValueRISCV_OpMod8u(v, config)
	case OpMove:
		return rewriteValueRISCV_OpMove(v, config)
	case OpMul16:
		return rewriteValueRISCV_OpMul16(v, config)
	case OpMul32:
		return rewriteValueRISCV_OpMul32(v, config)
	case OpMul32F:
		return rewriteValueRISCV_OpMul32F(v, config)
	case OpMul64:
		return rewriteValueRISCV_OpMul64(v, config)
	case OpMul64F:
		return rewriteValueRISCV_OpMul64F(v, config)
	case OpMul8:
		return rewriteValueRISCV_OpMul8(v, config)
	case OpNeg16:
		return rewriteValueRISCV_OpNeg16(v, config)
	case OpNeg32:
		return rewriteValueRISCV_OpNeg32(v, config)
	case OpNeg32F:
		return rewriteValueRISCV_OpNeg32F(v, config)
	case OpNeg64:
		return rewriteValueRISCV_OpNeg64(v, config)
	case OpNeg64F:
		return rewriteValueRISCV_OpNeg64F(v, config)
	case OpNeg8:
		return rewriteValueRISCV_OpNeg8(v, config)
	case OpNeq16:
		return rewriteValueRISCV_OpNeq16(v, config)
	case OpNeq32:
		return rewriteValueRISCV_OpNeq32(v, config)
	case OpNeq32F:
		return rewriteValueRISCV_OpNeq32F(v, config)
	case OpNeq64:
		return rewriteValueRISCV_OpNeq64(v, config)
	case OpNeq64F:
		return rewriteValueRISCV_OpNeq64F(v, config)
	case OpNeq8:
		return rewriteValueRISCV_OpNeq8(v, config)
	case OpNeqB:
		return rewriteValueRISCV_OpNeqB(v, config)
	case OpNeqPtr:
		return rewriteValueRISCV_OpNeqPtr(v, config)
	case OpNilCheck:
		return rewriteValueRISCV_OpNilCheck(v, config)
	case OpNot:
		return rewriteValueRISCV_OpNot(v, config)
	case OpOffPtr:
		return rewriteValueRISCV_OpOffPtr(v, config)
	case OpOr16:
		return rewriteValueRISCV_OpOr16(v, config)
	case OpOr32:
		return rewriteValueRISCV_OpOr32(v, config)
	case OpOr64:
		return rewriteValueRISCV_OpOr64(v, config)
	case OpOr8:
		return rewriteValueRISCV_OpOr8(v, config)
	case OpOrB:
		return rewriteValueRISCV_OpOrB(v, config)
	case OpRISCVADDI:
		return rewriteValueRISCV_OpRISCVADDI(v, config)
	case OpRISCVMOVBUload:
		return rewriteValueRISCV_OpRISCVMOVBUload(v, config)
	case OpRISCVMOVBload:
		return rewriteValueRISCV_OpRISCVMOVBload(v, config)
	case OpRISCVMOVBstore:
		return rewriteValueRISCV_OpRISCVMOVBstore(v, config)
	case OpRISCVMOVDconst:
		return rewriteValueRISCV_OpRISCVMOVDconst(v, config)
	case OpRISCVMOVDload:
		return rewriteValueRISCV_OpRISCVMOVDload(v, config)
	case OpRISCVMOVDstore:
		return rewriteValueRISCV_OpRISCVMOVDstore(v, config)
	case OpRISCVMOVHUload:
		return rewriteValueRISCV_OpRISCVMOVHUload(v, config)
	case OpRISCVMOVHload:
		return rewriteValueRISCV_OpRISCVMOVHload(v, config)
	case OpRISCVMOVHstore:
		return rewriteValueRISCV_OpRISCVMOVHstore(v, config)
	case OpRISCVMOVWUload:
		return rewriteValueRISCV_OpRISCVMOVWUload(v, config)
	case OpRISCVMOVWload:
		return rewriteValueRISCV_OpRISCVMOVWload(v, config)
	case OpRISCVMOVWstore:
		return rewriteValueRISCV_OpRISCVMOVWstore(v, config)
	case OpRsh16Ux16:
		return rewriteValueRISCV_OpRsh16Ux16(v, config)
	case OpRsh16Ux32:
		return rewriteValueRISCV_OpRsh16Ux32(v, config)
	case OpRsh16Ux64:
		return rewriteValueRISCV_OpRsh16Ux64(v, config)
	case OpRsh16Ux8:
		return rewriteValueRISCV_OpRsh16Ux8(v, config)
	case OpRsh16x16:
		return rewriteValueRISCV_OpRsh16x16(v, config)
	case OpRsh16x32:
		return rewriteValueRISCV_OpRsh16x32(v, config)
	case OpRsh16x64:
		return rewriteValueRISCV_OpRsh16x64(v, config)
	case OpRsh16x8:
		return rewriteValueRISCV_OpRsh16x8(v, config)
	case OpRsh32Ux16:
		return rewriteValueRISCV_OpRsh32Ux16(v, config)
	case OpRsh32Ux32:
		return rewriteValueRISCV_OpRsh32Ux32(v, config)
	case OpRsh32Ux64:
		return rewriteValueRISCV_OpRsh32Ux64(v, config)
	case OpRsh32Ux8:
		return rewriteValueRISCV_OpRsh32Ux8(v, config)
	case OpRsh32x16:
		return rewriteValueRISCV_OpRsh32x16(v, config)
	case OpRsh32x32:
		return rewriteValueRISCV_OpRsh32x32(v, config)
	case OpRsh32x64:
		return rewriteValueRISCV_OpRsh32x64(v, config)
	case OpRsh32x8:
		return rewriteValueRISCV_OpRsh32x8(v, config)
	case OpRsh64Ux16:
		return rewriteValueRISCV_OpRsh64Ux16(v, config)
	case OpRsh64Ux32:
		return rewriteValueRISCV_OpRsh64Ux32(v, config)
	case OpRsh64Ux64:
		return rewriteValueRISCV_OpRsh64Ux64(v, config)
	case OpRsh64Ux8:
		return rewriteValueRISCV_OpRsh64Ux8(v, config)
	case OpRsh64x16:
		return rewriteValueRISCV_OpRsh64x16(v, config)
	case OpRsh64x32:
		return rewriteValueRISCV_OpRsh64x32(v, config)
	case OpRsh64x64:
		return rewriteValueRISCV_OpRsh64x64(v, config)
	case OpRsh64x8:
		return rewriteValueRISCV_OpRsh64x8(v, config)
	case OpRsh8Ux16:
		return rewriteValueRISCV_OpRsh8Ux16(v, config)
	case OpRsh8Ux32:
		return rewriteValueRISCV_OpRsh8Ux32(v, config)
	case OpRsh8Ux64:
		return rewriteValueRISCV_OpRsh8Ux64(v, config)
	case OpRsh8Ux8:
		return rewriteValueRISCV_OpRsh8Ux8(v, config)
	case OpRsh8x16:
		return rewriteValueRISCV_OpRsh8x16(v, config)
	case OpRsh8x32:
		return rewriteValueRISCV_OpRsh8x32(v, config)
	case OpRsh8x64:
		return rewriteValueRISCV_OpRsh8x64(v, config)
	case OpRsh8x8:
		return rewriteValueRISCV_OpRsh8x8(v, config)
	case OpSignExt16to32:
		return rewriteValueRISCV_OpSignExt16to32(v, config)
	case OpSignExt16to64:
		return rewriteValueRISCV_OpSignExt16to64(v, config)
	case OpSignExt32to64:
		return rewriteValueRISCV_OpSignExt32to64(v, config)
	case OpSignExt8to16:
		return rewriteValueRISCV_OpSignExt8to16(v, config)
	case OpSignExt8to32:
		return rewriteValueRISCV_OpSignExt8to32(v, config)
	case OpSignExt8to64:
		return rewriteValueRISCV_OpSignExt8to64(v, config)
	case OpSlicemask:
		return rewriteValueRISCV_OpSlicemask(v, config)
	case OpSqrt:
		return rewriteValueRISCV_OpSqrt(v, config)
	case OpStaticCall:
		return rewriteValueRISCV_OpStaticCall(v, config)
	case OpStore:
		return rewriteValueRISCV_OpStore(v, config)
	case OpSub16:
		return rewriteValueRISCV_OpSub16(v, config)
	case OpSub32:
		return rewriteValueRISCV_OpSub32(v, config)
	case OpSub32F:
		return rewriteValueRISCV_OpSub32F(v, config)
	case OpSub64:
		return rewriteValueRISCV_OpSub64(v, config)
	case OpSub64F:
		return rewriteValueRISCV_OpSub64F(v, config)
	case OpSub8:
		return rewriteValueRISCV_OpSub8(v, config)
	case OpSubPtr:
		return rewriteValueRISCV_OpSubPtr(v, config)
	case OpTrunc16to8:
		return rewriteValueRISCV_OpTrunc16to8(v, config)
	case OpTrunc32to16:
		return rewriteValueRISCV_OpTrunc32to16(v, config)
	case OpTrunc32to8:
		return rewriteValueRISCV_OpTrunc32to8(v, config)
	case OpTrunc64to16:
		return rewriteValueRISCV_OpTrunc64to16(v, config)
	case OpTrunc64to32:
		return rewriteValueRISCV_OpTrunc64to32(v, config)
	case OpTrunc64to8:
		return rewriteValueRISCV_OpTrunc64to8(v, config)
	case OpXor16:
		return rewriteValueRISCV_OpXor16(v, config)
	case OpXor32:
		return rewriteValueRISCV_OpXor32(v, config)
	case OpXor64:
		return rewriteValueRISCV_OpXor64(v, config)
	case OpXor8:
		return rewriteValueRISCV_OpXor8(v, config)
	case OpZero:
		return rewriteValueRISCV_OpZero(v, config)
	case OpZeroExt16to32:
		return rewriteValueRISCV_OpZeroExt16to32(v, config)
	case OpZeroExt16to64:
		return rewriteValueRISCV_OpZeroExt16to64(v, config)
	case OpZeroExt32to64:
		return rewriteValueRISCV_OpZeroExt32to64(v, config)
	case OpZeroExt8to16:
		return rewriteValueRISCV_OpZeroExt8to16(v, config)
	case OpZeroExt8to32:
		return rewriteValueRISCV_OpZeroExt8to32(v, config)
	case OpZeroExt8to64:
		return rewriteValueRISCV_OpZeroExt8to64(v, config)
	}
	return false
}
func rewriteValueRISCV_OpAdd16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Add16 x y)
	// cond:
	// result: (ADD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVADD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAdd32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Add32 x y)
	// cond:
	// result: (ADD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVADD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAdd32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Add32F x y)
	// cond:
	// result: (FADDS x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFADDS)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAdd64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Add64 x y)
	// cond:
	// result: (ADD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVADD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAdd64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Add64F x y)
	// cond:
	// result: (FADDD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFADDD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAdd8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Add8 x y)
	// cond:
	// result: (ADD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVADD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAddPtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (AddPtr x y)
	// cond:
	// result: (ADD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVADD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAddr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Addr {sym} base)
	// cond:
	// result: (MOVaddr {sym} base)
	for {
		sym := v.Aux
		base := v.Args[0]
		v.reset(OpRISCVMOVaddr)
		v.Aux = sym
		v.AddArg(base)
		return true
	}
}
func rewriteValueRISCV_OpAnd16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (And16 x y)
	// cond:
	// result: (AND x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAnd32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (And32 x y)
	// cond:
	// result: (AND x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAnd64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (And64 x y)
	// cond:
	// result: (AND x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAnd8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (And8  x y)
	// cond:
	// result: (AND x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAndB(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (AndB x y)
	// cond:
	// result: (AND  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpAvg64u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Avg64u <t> x y)
	// cond:
	// result: (ADD (ADD <t> (SRLI <t> [1] x) (SRLI <t> [1] y)) (ANDI <t> [1] (AND <t> x y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVADD)
		v0 := b.NewValue0(v.Pos, OpRISCVADD, t)
		v1 := b.NewValue0(v.Pos, OpRISCVSRLI, t)
		v1.AuxInt = 1
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpRISCVSRLI, t)
		v2.AuxInt = 1
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		v3 := b.NewValue0(v.Pos, OpRISCVANDI, t)
		v3.AuxInt = 1
		v4 := b.NewValue0(v.Pos, OpRISCVAND, t)
		v4.AddArg(x)
		v4.AddArg(y)
		v3.AddArg(v4)
		v.AddArg(v3)
		return true
	}
}
func rewriteValueRISCV_OpClosureCall(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ClosureCall [argwid] entry closure mem)
	// cond:
	// result: (CALLclosure [argwid] entry closure mem)
	for {
		argwid := v.AuxInt
		entry := v.Args[0]
		closure := v.Args[1]
		mem := v.Args[2]
		v.reset(OpRISCVCALLclosure)
		v.AuxInt = argwid
		v.AddArg(entry)
		v.AddArg(closure)
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpCom16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Com16 x)
	// cond:
	// result: (XORI [int64(-1)] x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVXORI)
		v.AuxInt = int64(-1)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCom32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Com32 x)
	// cond:
	// result: (XORI [int64(-1)] x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVXORI)
		v.AuxInt = int64(-1)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCom64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Com64 x)
	// cond:
	// result: (XORI [int64(-1)] x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVXORI)
		v.AuxInt = int64(-1)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCom8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Com8  x)
	// cond:
	// result: (XORI [int64(-1)] x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVXORI)
		v.AuxInt = int64(-1)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpConst16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Const16 [val])
	// cond:
	// result: (MOVHconst [val])
	for {
		val := v.AuxInt
		v.reset(OpRISCVMOVHconst)
		v.AuxInt = val
		return true
	}
}
func rewriteValueRISCV_OpConst32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Const32 [val])
	// cond:
	// result: (MOVWconst [val])
	for {
		val := v.AuxInt
		v.reset(OpRISCVMOVWconst)
		v.AuxInt = val
		return true
	}
}
func rewriteValueRISCV_OpConst32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Const32F [val])
	// cond:
	// result: (FMVSX (MOVSconst [val]))
	for {
		val := v.AuxInt
		v.reset(OpRISCVFMVSX)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVSconst, config.fe.TypeFloat32())
		v0.AuxInt = val
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpConst64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Const64 [val])
	// cond:
	// result: (MOVDconst [val])
	for {
		val := v.AuxInt
		v.reset(OpRISCVMOVDconst)
		v.AuxInt = val
		return true
	}
}
func rewriteValueRISCV_OpConst64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Const64F [val])
	// cond:
	// result: (FMVDX (MOVDconst [val]))
	for {
		val := v.AuxInt
		v.reset(OpRISCVFMVDX)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v0.AuxInt = val
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpConst8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Const8 [val])
	// cond:
	// result: (MOVBconst [val])
	for {
		val := v.AuxInt
		v.reset(OpRISCVMOVBconst)
		v.AuxInt = val
		return true
	}
}
func rewriteValueRISCV_OpConstBool(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ConstBool [b])
	// cond:
	// result: (MOVBconst [b])
	for {
		b := v.AuxInt
		v.reset(OpRISCVMOVBconst)
		v.AuxInt = b
		return true
	}
}
func rewriteValueRISCV_OpConstNil(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ConstNil)
	// cond:
	// result: (MOVDconst [0])
	for {
		v.reset(OpRISCVMOVDconst)
		v.AuxInt = 0
		return true
	}
}
func rewriteValueRISCV_OpConvert(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Convert x mem)
	// cond:
	// result: (MOVconvert x mem)
	for {
		x := v.Args[0]
		mem := v.Args[1]
		v.reset(OpRISCVMOVconvert)
		v.AddArg(x)
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpCvt32Fto32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt32Fto32 x)
	// cond:
	// result: (FCVTWS x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTWS)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt32Fto64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt32Fto64 x)
	// cond:
	// result: (FCVTLS x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTLS)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt32Fto64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt32Fto64F x)
	// cond:
	// result: (FCVTDS x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTDS)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt32to32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt32to32F x)
	// cond:
	// result: (FCVTSW x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTSW)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt32to64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt32to64F x)
	// cond:
	// result: (FCVTDW x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTDW)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt64Fto32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt64Fto32 x)
	// cond:
	// result: (FCVTWD x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTWD)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt64Fto32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt64Fto32F x)
	// cond:
	// result: (FCVTSD x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTSD)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt64Fto64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt64Fto64 x)
	// cond:
	// result: (FCVTLD x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTLD)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt64to32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt64to32F x)
	// cond:
	// result: (FCVTSL x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTSL)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpCvt64to64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Cvt64to64F x)
	// cond:
	// result: (FCVTDL x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFCVTDL)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpDeferCall(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (DeferCall   [argwid]               mem)
	// cond:
	// result: (CALLdefer   [argwid]               mem)
	for {
		argwid := v.AuxInt
		mem := v.Args[0]
		v.reset(OpRISCVCALLdefer)
		v.AuxInt = argwid
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpDiv16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div16 x y)
	// cond:
	// result: (DIVW  (SignExt16to32 x) (SignExt16to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIVW)
		v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpDiv16u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div16u x y)
	// cond:
	// result: (DIVUW (ZeroExt16to32 x) (ZeroExt16to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIVUW)
		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpDiv32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div32 x y)
	// cond:
	// result: (DIVW  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIVW)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpDiv32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div32F x y)
	// cond:
	// result: (FDIVS x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFDIVS)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpDiv32u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div32u x y)
	// cond:
	// result: (DIVUW x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIVUW)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpDiv64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div64 x y)
	// cond:
	// result: (DIV   x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIV)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpDiv64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div64F x y)
	// cond:
	// result: (FDIVD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFDIVD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpDiv64u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div64u x y)
	// cond:
	// result: (DIVU  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIVU)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpDiv8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div8 x y)
	// cond:
	// result: (DIVW  (SignExt8to32 x)  (SignExt8to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIVW)
		v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpDiv8u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Div8u x y)
	// cond:
	// result: (DIVUW (ZeroExt8to32 x)  (ZeroExt8to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVDIVUW)
		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpEq16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Eq16  x y)
	// cond:
	// result: (SEQZ (ZeroExt16to64 (SUB <x.Type> x y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSEQZ)
		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v1 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v1.AddArg(x)
		v1.AddArg(y)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpEq32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Eq32  x y)
	// cond:
	// result: (SEQZ (ZeroExt32to64 (SUB <x.Type> x y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSEQZ)
		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v1.AddArg(x)
		v1.AddArg(y)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpEq32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Eq32F x y)
	// cond:
	// result: (FEQS x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFEQS)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpEq64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Eq64  x y)
	// cond:
	// result: (SEQZ (SUB <x.Type> x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSEQZ)
		v0 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpEq64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Eq64F x y)
	// cond:
	// result: (FEQD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFEQD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpEq8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Eq8   x y)
	// cond:
	// result: (SEQZ (ZeroExt8to64  (SUB <x.Type> x y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSEQZ)
		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v1 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v1.AddArg(x)
		v1.AddArg(y)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpEqB(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (EqB  x y)
	// cond:
	// result: (Eq8  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpEq8)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpEqPtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (EqPtr x y)
	// cond:
	// result: (SEQZ (SUB <x.Type> x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSEQZ)
		v0 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq16  x y)
	// cond:
	// result: (Not (Less16  x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess16, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq16U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq16U x y)
	// cond:
	// result: (Not (Less16U x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess16U, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq32  x y)
	// cond:
	// result: (Not (Less32  x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess32, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq32F x y)
	// cond:
	// result: (FLES y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLES)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGeq32U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq32U x y)
	// cond:
	// result: (Not (Less32U x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess32U, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq64  x y)
	// cond:
	// result: (Not (Less64  x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess64, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq64F x y)
	// cond:
	// result: (FLED y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLED)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGeq64U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq64U x y)
	// cond:
	// result: (Not (Less64U x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess64U, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq8   x y)
	// cond:
	// result: (Not (Less8   x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess8, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGeq8U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Geq8U  x y)
	// cond:
	// result: (Not (Less8U  x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess8U, config.fe.TypeBool())
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpGetClosurePtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (GetClosurePtr)
	// cond:
	// result: (LoweredGetClosurePtr)
	for {
		v.reset(OpRISCVLoweredGetClosurePtr)
		return true
	}
}
func rewriteValueRISCV_OpGoCall(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (GoCall      [argwid]               mem)
	// cond:
	// result: (CALLgo      [argwid]               mem)
	for {
		argwid := v.AuxInt
		mem := v.Args[0]
		v.reset(OpRISCVCALLgo)
		v.AuxInt = argwid
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpGreater16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater16  x y)
	// cond:
	// result: (Less16  y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess16)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater16U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater16U x y)
	// cond:
	// result: (Less16U y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess16U)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater32  x y)
	// cond:
	// result: (Less32  y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess32)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater32F x y)
	// cond:
	// result: (FLTS y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLTS)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater32U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater32U x y)
	// cond:
	// result: (Less32U y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess32U)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater64  x y)
	// cond:
	// result: (Less64  y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess64)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater64F x y)
	// cond:
	// result: (FLTD y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLTD)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater64U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater64U x y)
	// cond:
	// result: (Less64U y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess64U)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater8   x y)
	// cond:
	// result: (Less8   y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess8)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpGreater8U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Greater8U  x y)
	// cond:
	// result: (Less8U  y x)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpLess8U)
		v.AddArg(y)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpHmul16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul16 x y)
	// cond:
	// result: (SRAI [16] (MULW (SignExt16to32 x) (SignExt16to32 y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 16
		v0 := b.NewValue0(v.Pos, OpRISCVMULW, config.fe.TypeInt32())
		v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpHmul16u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul16u x y)
	// cond:
	// result: (SRLI [16] (MULW (ZeroExt16to32 x) (ZeroExt16to32 y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 16
		v0 := b.NewValue0(v.Pos, OpRISCVMULW, config.fe.TypeInt32())
		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpHmul32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul32 x y)
	// cond:
	// result: (SRAI [32] (MUL  (SignExt32to64 x) (SignExt32to64 y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 32
		v0 := b.NewValue0(v.Pos, OpRISCVMUL, config.fe.TypeInt64())
		v1 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpHmul32u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul32u x y)
	// cond:
	// result: (SRLI [32] (MUL  (ZeroExt32to64 x) (ZeroExt32to64 y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 32
		v0 := b.NewValue0(v.Pos, OpRISCVMUL, config.fe.TypeInt64())
		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpHmul64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul64 x y)
	// cond:
	// result: (MULH  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVMULH)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpHmul64u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul64u x y)
	// cond:
	// result: (MULHU x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVMULHU)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpHmul8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul8 x y)
	// cond:
	// result: (SRAI [8]  (MULW (SignExt8to32 x)  (SignExt8to32 y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 8
		v0 := b.NewValue0(v.Pos, OpRISCVMULW, config.fe.TypeInt32())
		v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpHmul8u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Hmul8u x y)
	// cond:
	// result: (SRLI [8]  (MULW (ZeroExt8to32 x)  (ZeroExt8to32 y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 8
		v0 := b.NewValue0(v.Pos, OpRISCVMULW, config.fe.TypeInt32())
		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
		v1.AddArg(x)
		v0.AddArg(v1)
		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
		v2.AddArg(y)
		v0.AddArg(v2)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpInterCall(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (InterCall   [argwid] entry         mem)
	// cond:
	// result: (CALLinter   [argwid] entry         mem)
	for {
		argwid := v.AuxInt
		entry := v.Args[0]
		mem := v.Args[1]
		v.reset(OpRISCVCALLinter)
		v.AuxInt = argwid
		v.AddArg(entry)
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpIsInBounds(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (IsInBounds idx len)
	// cond:
	// result: (Less64U idx len)
	for {
		idx := v.Args[0]
		len := v.Args[1]
		v.reset(OpLess64U)
		v.AddArg(idx)
		v.AddArg(len)
		return true
	}
}
func rewriteValueRISCV_OpIsNonNil(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (IsNonNil p)
	// cond:
	// result: (NeqPtr (MOVDconst) p)
	for {
		p := v.Args[0]
		v.reset(OpNeqPtr)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v.AddArg(v0)
		v.AddArg(p)
		return true
	}
}
func rewriteValueRISCV_OpIsSliceInBounds(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (IsSliceInBounds idx len)
	// cond:
	// result: (Leq64U idx len)
	for {
		idx := v.Args[0]
		len := v.Args[1]
		v.reset(OpLeq64U)
		v.AddArg(idx)
		v.AddArg(len)
		return true
	}
}
func rewriteValueRISCV_OpLeq16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq16  x y)
	// cond:
	// result: (Not (Less16  y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess16, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLeq16U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq16U x y)
	// cond:
	// result: (Not (Less16U y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess16U, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLeq32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq32  x y)
	// cond:
	// result: (Not (Less32  y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess32, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLeq32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq32F x y)
	// cond:
	// result: (FLES x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLES)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpLeq32U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq32U x y)
	// cond:
	// result: (Not (Less32U y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess32U, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLeq64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq64  x y)
	// cond:
	// result: (Not (Less64  y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess64, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLeq64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq64F x y)
	// cond:
	// result: (FLED x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLED)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpLeq64U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq64U x y)
	// cond:
	// result: (Not (Less64U y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess64U, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLeq8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq8   x y)
	// cond:
	// result: (Not (Less8   y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess8, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLeq8U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Leq8U  x y)
	// cond:
	// result: (Not (Less8U  y x))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNot)
		v0 := b.NewValue0(v.Pos, OpLess8U, config.fe.TypeBool())
		v0.AddArg(y)
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpLess16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less16  x y)
	// cond:
	// result: (SLT  (SignExt16to64 x) (SignExt16to64 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLT)
		v0 := b.NewValue0(v.Pos, OpSignExt16to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt16to64, config.fe.TypeInt64())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLess16U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less16U x y)
	// cond:
	// result: (SLTU (ZeroExt16to64 x) (ZeroExt16to64 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLTU)
		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLess32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less32  x y)
	// cond:
	// result: (SLT  (SignExt32to64 x) (SignExt32to64 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLT)
		v0 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLess32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less32F x y)
	// cond:
	// result: (FLTS x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLTS)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpLess32U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less32U x y)
	// cond:
	// result: (SLTU (ZeroExt32to64 x) (ZeroExt32to64 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLTU)
		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLess64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less64  x y)
	// cond:
	// result: (SLT  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLT)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpLess64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less64F x y)
	// cond:
	// result: (FLTD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFLTD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpLess64U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less64U x y)
	// cond:
	// result: (SLTU x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLTU)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpLess8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less8   x y)
	// cond:
	// result: (SLT  (SignExt8to64  x) (SignExt8to64  y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLT)
		v0 := b.NewValue0(v.Pos, OpSignExt8to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt8to64, config.fe.TypeInt64())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLess8U(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Less8U  x y)
	// cond:
	// result: (SLTU (ZeroExt8to64  x) (ZeroExt8to64  y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSLTU)
		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLoad(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Load <t> ptr mem)
	// cond: t.IsBoolean()
	// result: (MOVBUload ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(t.IsBoolean()) {
			break
		}
		v.reset(OpRISCVMOVBUload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: ( is8BitInt(t) &&  isSigned(t))
	// result: (MOVBload  ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is8BitInt(t) && isSigned(t)) {
			break
		}
		v.reset(OpRISCVMOVBload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: ( is8BitInt(t) && !isSigned(t))
	// result: (MOVBUload ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is8BitInt(t) && !isSigned(t)) {
			break
		}
		v.reset(OpRISCVMOVBUload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: (is16BitInt(t) &&  isSigned(t))
	// result: (MOVHload  ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is16BitInt(t) && isSigned(t)) {
			break
		}
		v.reset(OpRISCVMOVHload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: (is16BitInt(t) && !isSigned(t))
	// result: (MOVHUload ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is16BitInt(t) && !isSigned(t)) {
			break
		}
		v.reset(OpRISCVMOVHUload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: (is32BitInt(t) &&  isSigned(t))
	// result: (MOVWload  ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is32BitInt(t) && isSigned(t)) {
			break
		}
		v.reset(OpRISCVMOVWload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: (is32BitInt(t) && !isSigned(t))
	// result: (MOVWUload ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is32BitInt(t) && !isSigned(t)) {
			break
		}
		v.reset(OpRISCVMOVWUload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: (is64BitInt(t) || isPtr(t))
	// result: (MOVDload  ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is64BitInt(t) || isPtr(t)) {
			break
		}
		v.reset(OpRISCVMOVDload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: is32BitFloat(t)
	// result: (FMOVWload ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is32BitFloat(t)) {
			break
		}
		v.reset(OpRISCVFMOVWload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	// match: (Load <t> ptr mem)
	// cond: is64BitFloat(t)
	// result: (FMOVDload ptr mem)
	for {
		t := v.Type
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(is64BitFloat(t)) {
			break
		}
		v.reset(OpRISCVFMOVDload)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpLsh16x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh16x16 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg16 <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg16, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh16x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh16x32 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg16 <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg16, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh16x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh16x64 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg16 <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg16, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v2.AddArg(y)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh16x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh16x8  <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg16 <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg16, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh32x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh32x16 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg32 <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg32, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh32x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh32x32 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg32 <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg32, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh32x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh32x64 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg32 <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg32, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v2.AddArg(y)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh32x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh32x8  <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg32 <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg32, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh64x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh64x16 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg64 <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh64x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh64x32 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg64 <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh64x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh64x64 <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg64 <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v2.AddArg(y)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh64x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh64x8  <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg64 <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh8x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh8x16  <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg8  <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg8, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh8x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh8x32  <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg8  <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg8, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh8x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh8x64  <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg8  <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg8, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v2.AddArg(y)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpLsh8x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Lsh8x8   <t> x y)
	// cond:
	// result: (AND (SLL <t> x y) (Neg8  <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSLL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg8, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpMod16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod16 x y)
	// cond:
	// result: (REMW  (SignExt16to32 x) (SignExt16to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREMW)
		v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpMod16u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod16u x y)
	// cond:
	// result: (REMUW (ZeroExt16to32 x) (ZeroExt16to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREMUW)
		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpMod32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod32 x y)
	// cond:
	// result: (REMW  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREMW)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMod32u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod32u x y)
	// cond:
	// result: (REMUW x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREMUW)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMod64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod64 x y)
	// cond:
	// result: (REM   x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREM)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMod64u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod64u x y)
	// cond:
	// result: (REMU  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREMU)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMod8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod8 x y)
	// cond:
	// result: (REMW  (SignExt8to32 x)  (SignExt8to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREMW)
		v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpMod8u(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mod8u x y)
	// cond:
	// result: (REMUW (ZeroExt8to32 x)  (ZeroExt8to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVREMUW)
		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpMove(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Move [s]   _   _ mem)
	// cond: SizeAndAlign(s).Size() == 0
	// result: mem
	for {
		s := v.AuxInt
		mem := v.Args[2]
		if !(SizeAndAlign(s).Size() == 0) {
			break
		}
		v.reset(OpCopy)
		v.Type = mem.Type
		v.AddArg(mem)
		return true
	}
	// match: (Move [s] dst src mem)
	// cond: SizeAndAlign(s).Size() == 1
	// result: (MOVBstore dst (MOVBload src mem) mem)
	for {
		s := v.AuxInt
		dst := v.Args[0]
		src := v.Args[1]
		mem := v.Args[2]
		if !(SizeAndAlign(s).Size() == 1) {
			break
		}
		v.reset(OpRISCVMOVBstore)
		v.AddArg(dst)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVBload, config.fe.TypeInt8())
		v0.AddArg(src)
		v0.AddArg(mem)
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Move [s] dst src mem)
	// cond: SizeAndAlign(s).Size() == 2
	// result: (MOVHstore dst (MOVHload src mem) mem)
	for {
		s := v.AuxInt
		dst := v.Args[0]
		src := v.Args[1]
		mem := v.Args[2]
		if !(SizeAndAlign(s).Size() == 2) {
			break
		}
		v.reset(OpRISCVMOVHstore)
		v.AddArg(dst)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVHload, config.fe.TypeInt16())
		v0.AddArg(src)
		v0.AddArg(mem)
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Move [s] dst src mem)
	// cond: SizeAndAlign(s).Size() == 4
	// result: (MOVWstore dst (MOVWload src mem) mem)
	for {
		s := v.AuxInt
		dst := v.Args[0]
		src := v.Args[1]
		mem := v.Args[2]
		if !(SizeAndAlign(s).Size() == 4) {
			break
		}
		v.reset(OpRISCVMOVWstore)
		v.AddArg(dst)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVWload, config.fe.TypeInt32())
		v0.AddArg(src)
		v0.AddArg(mem)
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Move [s] dst src mem)
	// cond: SizeAndAlign(s).Size() == 8
	// result: (MOVDstore dst (MOVDload src mem) mem)
	for {
		s := v.AuxInt
		dst := v.Args[0]
		src := v.Args[1]
		mem := v.Args[2]
		if !(SizeAndAlign(s).Size() == 8) {
			break
		}
		v.reset(OpRISCVMOVDstore)
		v.AddArg(dst)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVDload, config.fe.TypeInt64())
		v0.AddArg(src)
		v0.AddArg(mem)
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Move [s] dst src mem)
	// cond:
	// result: (LoweredMove [SizeAndAlign(s).Align()] 		dst 		src 		(ADDI <src.Type> [SizeAndAlign(s).Size()-moveSize(SizeAndAlign(s).Align(), config)] src) 		mem)
	for {
		s := v.AuxInt
		dst := v.Args[0]
		src := v.Args[1]
		mem := v.Args[2]
		v.reset(OpRISCVLoweredMove)
		v.AuxInt = SizeAndAlign(s).Align()
		v.AddArg(dst)
		v.AddArg(src)
		v0 := b.NewValue0(v.Pos, OpRISCVADDI, src.Type)
		v0.AuxInt = SizeAndAlign(s).Size() - moveSize(SizeAndAlign(s).Align(), config)
		v0.AddArg(src)
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpMul16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mul16 x y)
	// cond:
	// result: (MULW (SignExt16to32 x) (SignExt16to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVMULW)
		v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpMul32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mul32 x y)
	// cond:
	// result: (MULW x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVMULW)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMul32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mul32F x y)
	// cond:
	// result: (FMULS x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFMULS)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMul64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mul64 x y)
	// cond:
	// result: (MUL  x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVMUL)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMul64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mul64F x y)
	// cond:
	// result: (FMULD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFMULD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpMul8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Mul8 x y)
	// cond:
	// result: (MULW (SignExt8to32 x)  (SignExt8to32 y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVMULW)
		v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
		v1.AddArg(y)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpNeg16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neg16 x)
	// cond:
	// result: (SUB (MOVHconst) x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVSUB)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVHconst, config.fe.TypeUInt16())
		v.AddArg(v0)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpNeg32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neg32 x)
	// cond:
	// result: (SUB (MOVWconst) x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVSUB)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVWconst, config.fe.TypeUInt32())
		v.AddArg(v0)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpNeg32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neg32F x)
	// cond:
	// result: (FNEGS x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFNEGS)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpNeg64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neg64 x)
	// cond:
	// result: (SUB (MOVDconst) x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVSUB)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v.AddArg(v0)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpNeg64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neg64F x)
	// cond:
	// result: (FNEGD x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFNEGD)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpNeg8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neg8  x)
	// cond:
	// result: (SUB (MOVBconst) x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVSUB)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVBconst, config.fe.TypeUInt8())
		v.AddArg(v0)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpNeq16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neq16  x y)
	// cond:
	// result: (SNEZ (ZeroExt16to64 (SUB <x.Type> x y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSNEZ)
		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v1 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v1.AddArg(x)
		v1.AddArg(y)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpNeq32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neq32  x y)
	// cond:
	// result: (SNEZ (ZeroExt32to64 (SUB <x.Type> x y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSNEZ)
		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v1.AddArg(x)
		v1.AddArg(y)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpNeq32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neq32F x y)
	// cond:
	// result: (FNES x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFNES)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpNeq64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neq64  x y)
	// cond:
	// result: (SNEZ (SUB <x.Type> x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSNEZ)
		v0 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpNeq64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neq64F x y)
	// cond:
	// result: (FNED x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFNED)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpNeq8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Neq8   x y)
	// cond:
	// result: (SNEZ (ZeroExt8to64  (SUB <x.Type> x y)))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSNEZ)
		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v1 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v1.AddArg(x)
		v1.AddArg(y)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpNeqB(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (NeqB x y)
	// cond:
	// result: (Neq8 x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpNeq8)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpNeqPtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (NeqPtr x y)
	// cond:
	// result: (SNEZ (SUB <x.Type> x y))
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSNEZ)
		v0 := b.NewValue0(v.Pos, OpRISCVSUB, x.Type)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpNilCheck(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (NilCheck ptr mem)
	// cond:
	// result: (LoweredNilCheck ptr mem)
	for {
		ptr := v.Args[0]
		mem := v.Args[1]
		v.reset(OpRISCVLoweredNilCheck)
		v.AddArg(ptr)
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpNot(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Not  x)
	// cond:
	// result: (XORI [1] x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVXORI)
		v.AuxInt = 1
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpOffPtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (OffPtr [off] ptr:(SP))
	// cond:
	// result: (MOVaddr [off] ptr)
	for {
		off := v.AuxInt
		ptr := v.Args[0]
		if ptr.Op != OpSP {
			break
		}
		v.reset(OpRISCVMOVaddr)
		v.AuxInt = off
		v.AddArg(ptr)
		return true
	}
	// match: (OffPtr [off] ptr)
	// cond:
	// result: (ADDI [off] ptr)
	for {
		off := v.AuxInt
		ptr := v.Args[0]
		v.reset(OpRISCVADDI)
		v.AuxInt = off
		v.AddArg(ptr)
		return true
	}
}
func rewriteValueRISCV_OpOr16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Or16 x y)
	// cond:
	// result: (OR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpOr32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Or32 x y)
	// cond:
	// result: (OR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpOr64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Or64 x y)
	// cond:
	// result: (OR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpOr8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Or8  x y)
	// cond:
	// result: (OR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpOrB(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (OrB  x y)
	// cond:
	// result: (OR   x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpRISCVADDI(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ADDI [c] (MOVaddr [d] {s} x))
	// cond: is32Bit(c+d)
	// result: (MOVaddr [c+d] {s} x)
	for {
		c := v.AuxInt
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		d := v_0.AuxInt
		s := v_0.Aux
		x := v_0.Args[0]
		if !(is32Bit(c + d)) {
			break
		}
		v.reset(OpRISCVMOVaddr)
		v.AuxInt = c + d
		v.Aux = s
		v.AddArg(x)
		return true
	}
	// match: (ADDI [0]  x)
	// cond:
	// result: x
	for {
		if v.AuxInt != 0 {
			break
		}
		x := v.Args[0]
		v.reset(OpCopy)
		v.Type = x.Type
		v.AddArg(x)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVBUload(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVBUload [off1] {sym1} (MOVaddr [off2] {sym2} base) mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVBUload [off1+off2] {mergeSym(sym1,sym2)} base mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVBUload)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	// match: (MOVBUload [off1] {sym} (ADDI [off2] base) mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVBUload [off1+off2] {sym} base mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVBUload)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVBload(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVBload  [off1] {sym1} (MOVaddr [off2] {sym2} base) mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVBload  [off1+off2] {mergeSym(sym1,sym2)} base mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVBload)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	// match: (MOVBload  [off1] {sym} (ADDI [off2] base) mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVBload  [off1+off2] {sym} base mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVBload)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVBstore(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVBstore [off1] {sym1} (MOVaddr [off2] {sym2} base) val mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVBstore)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (MOVBstore [off1] {sym} (ADDI [off2] base) val mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVBstore [off1+off2] {sym} base val mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVBstore)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVDconst(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVDconst <t> [c])
	// cond: !is32Bit(c) && int32(c) <  0
	// result: (ADD (SLLI <t> [32] (MOVDconst [c>>32+1])) (MOVDconst [int64(int32(c))]))
	for {
		t := v.Type
		c := v.AuxInt
		if !(!is32Bit(c) && int32(c) < 0) {
			break
		}
		v.reset(OpRISCVADD)
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 32
		v1 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v1.AuxInt = c>>32 + 1
		v0.AddArg(v1)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v2.AuxInt = int64(int32(c))
		v.AddArg(v2)
		return true
	}
	// match: (MOVDconst <t> [c])
	// cond: !is32Bit(c) && int32(c) >= 0
	// result: (ADD (SLLI <t> [32] (MOVDconst [c>>32+0])) (MOVDconst [int64(int32(c))]))
	for {
		t := v.Type
		c := v.AuxInt
		if !(!is32Bit(c) && int32(c) >= 0) {
			break
		}
		v.reset(OpRISCVADD)
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 32
		v1 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v1.AuxInt = c>>32 + 0
		v0.AddArg(v1)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v2.AuxInt = int64(int32(c))
		v.AddArg(v2)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVDload(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVDload  [off1] {sym1} (MOVaddr [off2] {sym2} base) mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVDload  [off1+off2] {mergeSym(sym1,sym2)} base mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVDload)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	// match: (MOVDload  [off1] {sym} (ADDI [off2] base) mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVDload  [off1+off2] {sym} base mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVDload)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVDstore(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVDstore [off1] {sym1} (MOVaddr [off2] {sym2} base) val mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVDstore)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (MOVDstore [off1] {sym} (ADDI [off2] base) val mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVDstore [off1+off2] {sym} base val mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVDstore)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVHUload(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVHUload [off1] {sym1} (MOVaddr [off2] {sym2} base) mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVHUload [off1+off2] {mergeSym(sym1,sym2)} base mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVHUload)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	// match: (MOVHUload [off1] {sym} (ADDI [off2] base) mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVHUload [off1+off2] {sym} base mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVHUload)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVHload(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVHload  [off1] {sym1} (MOVaddr [off2] {sym2} base) mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVHload  [off1+off2] {mergeSym(sym1,sym2)} base mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVHload)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	// match: (MOVHload  [off1] {sym} (ADDI [off2] base) mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVHload  [off1+off2] {sym} base mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVHload)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVHstore(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVHstore [off1] {sym1} (MOVaddr [off2] {sym2} base) val mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVHstore)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (MOVHstore [off1] {sym} (ADDI [off2] base) val mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVHstore [off1+off2] {sym} base val mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVHstore)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVWUload(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVWUload [off1] {sym1} (MOVaddr [off2] {sym2} base) mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVWUload [off1+off2] {mergeSym(sym1,sym2)} base mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVWUload)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	// match: (MOVWUload [off1] {sym} (ADDI [off2] base) mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVWUload [off1+off2] {sym} base mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVWUload)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVWload(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVWload  [off1] {sym1} (MOVaddr [off2] {sym2} base) mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVWload  [off1+off2] {mergeSym(sym1,sym2)} base mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVWload)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	// match: (MOVWload  [off1] {sym} (ADDI [off2] base) mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVWload  [off1+off2] {sym} base mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		mem := v.Args[1]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVWload)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRISCVMOVWstore(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (MOVWstore [off1] {sym1} (MOVaddr [off2] {sym2} base) val mem)
	// cond: is32Bit(off1+off2) && canMergeSym(sym1, sym2)
	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
	for {
		off1 := v.AuxInt
		sym1 := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVMOVaddr {
			break
		}
		off2 := v_0.AuxInt
		sym2 := v_0.Aux
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1+off2) && canMergeSym(sym1, sym2)) {
			break
		}
		v.reset(OpRISCVMOVWstore)
		v.AuxInt = off1 + off2
		v.Aux = mergeSym(sym1, sym2)
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (MOVWstore [off1] {sym} (ADDI [off2] base) val mem)
	// cond: is32Bit(off1+off2)
	// result: (MOVWstore [off1+off2] {sym} base val mem)
	for {
		off1 := v.AuxInt
		sym := v.Aux
		v_0 := v.Args[0]
		if v_0.Op != OpRISCVADDI {
			break
		}
		off2 := v_0.AuxInt
		base := v_0.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32Bit(off1 + off2)) {
			break
		}
		v.reset(OpRISCVMOVWstore)
		v.AuxInt = off1 + off2
		v.Aux = sym
		v.AddArg(base)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpRsh16Ux16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16Ux16 <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt16to64 x) y) (Neg16 <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg16, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh16Ux32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16Ux32 <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt16to64 x) y) (Neg16 <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg16, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh16Ux64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16Ux64 <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt16to64 x) y) (Neg16 <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg16, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v3.AddArg(y)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh16Ux8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16Ux8  <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt16to64 x) y) (Neg16 <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg16, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh16x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16x16 <t> x y)
	// cond:
	// result: (SRA <t> (SignExt16to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt16to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt16to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh16x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16x32 <t> x y)
	// cond:
	// result: (SRA <t> (SignExt16to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt32to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt16to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh16x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16x64 <t> x y)
	// cond:
	// result: (SRA <t> (SignExt16to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt16to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh16x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh16x8  <t> x y)
	// cond:
	// result: (SRA <t> (SignExt16to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt8to64  y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt16to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh32Ux16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32Ux16 <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt32to64 x) y) (Neg32 <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg32, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh32Ux32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32Ux32 <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt32to64 x) y) (Neg32 <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg32, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh32Ux64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32Ux64 <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt32to64 x) y) (Neg32 <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg32, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v3.AddArg(y)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh32Ux8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32Ux8  <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt32to64 x) y) (Neg32 <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg32, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh32x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32x16 <t> x y)
	// cond:
	// result: (SRA <t> (SignExt32to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt16to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh32x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32x32 <t> x y)
	// cond:
	// result: (SRA <t> (SignExt32to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt32to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh32x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32x64 <t> x y)
	// cond:
	// result: (SRA <t> (SignExt32to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh32x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh32x8  <t> x y)
	// cond:
	// result: (SRA <t> (SignExt32to64 x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt8to64  y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh64Ux16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64Ux16 <t> x y)
	// cond:
	// result: (AND (SRL <t> x                 y) (Neg64 <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh64Ux32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64Ux32 <t> x y)
	// cond:
	// result: (AND (SRL <t> x                 y) (Neg64 <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh64Ux64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64Ux64 <t> x y)
	// cond:
	// result: (AND (SRL <t> x                 y) (Neg64 <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v2.AddArg(y)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh64Ux8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64Ux8  <t> x y)
	// cond:
	// result: (AND (SRL <t> x                 y) (Neg64 <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v0.AddArg(x)
		v0.AddArg(y)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpNeg64, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh64x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64x16 <t> x y)
	// cond:
	// result: (SRA <t> x                 (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt16to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v.AddArg(x)
		v0 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v0.AddArg(y)
		v1 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v1.AuxInt = -1
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpRsh64x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64x32 <t> x y)
	// cond:
	// result: (SRA <t> x                 (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt32to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v.AddArg(x)
		v0 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v0.AddArg(y)
		v1 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v1.AuxInt = -1
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpRsh64x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64x64 <t> x y)
	// cond:
	// result: (SRA <t> x                 (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v.AddArg(x)
		v0 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v0.AddArg(y)
		v1 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v1.AuxInt = -1
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v2.AuxInt = 64
		v2.AddArg(y)
		v1.AddArg(v2)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpRsh64x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh64x8  <t> x y)
	// cond:
	// result: (SRA <t> x                 (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt8to64  y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v.AddArg(x)
		v0 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v0.AddArg(y)
		v1 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v1.AuxInt = -1
		v2 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v2.AuxInt = 64
		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v0.AddArg(v1)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpRsh8Ux16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8Ux16  <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt8to64  x) y) (Neg8  <t> (SLTIU <t> [64] (ZeroExt16to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg8, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh8Ux32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8Ux32  <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt8to64  x) y) (Neg8  <t> (SLTIU <t> [64] (ZeroExt32to64 y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg8, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh8Ux64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8Ux64  <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt8to64  x) y) (Neg8  <t> (SLTIU <t> [64] y)))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg8, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v3.AddArg(y)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh8Ux8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8Ux8   <t> x y)
	// cond:
	// result: (AND (SRL <t> (ZeroExt8to64  x) y) (Neg8  <t> (SLTIU <t> [64] (ZeroExt8to64  y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVAND)
		v0 := b.NewValue0(v.Pos, OpRISCVSRL, t)
		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v1.AddArg(x)
		v0.AddArg(v1)
		v0.AddArg(y)
		v.AddArg(v0)
		v2 := b.NewValue0(v.Pos, OpNeg8, t)
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, t)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v.AddArg(v2)
		return true
	}
}
func rewriteValueRISCV_OpRsh8x16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8x16  <t> x y)
	// cond:
	// result: (SRA <t> (SignExt8to64  x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt16to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt8to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh8x32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8x32  <t> x y)
	// cond:
	// result: (SRA <t> (SignExt8to64  x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt32to64 y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt8to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh8x64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8x64  <t> x y)
	// cond:
	// result: (SRA <t> (SignExt8to64  x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] y))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt8to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v3.AddArg(y)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpRsh8x8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Rsh8x8   <t> x y)
	// cond:
	// result: (SRA <t> (SignExt8to64  x) (OR <y.Type> y (ADDI <y.Type> [-1] (SLTIU <y.Type> [64] (ZeroExt8to64  y)))))
	for {
		t := v.Type
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSRA)
		v.Type = t
		v0 := b.NewValue0(v.Pos, OpSignExt8to64, config.fe.TypeInt64())
		v0.AddArg(x)
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVOR, y.Type)
		v1.AddArg(y)
		v2 := b.NewValue0(v.Pos, OpRISCVADDI, y.Type)
		v2.AuxInt = -1
		v3 := b.NewValue0(v.Pos, OpRISCVSLTIU, y.Type)
		v3.AuxInt = 64
		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
		v4.AddArg(y)
		v3.AddArg(v4)
		v2.AddArg(v3)
		v1.AddArg(v2)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpSignExt16to32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SignExt16to32 <t> x)
	// cond:
	// result: (SRAI [48] (SLLI <t> [48] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 48
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 48
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpSignExt16to64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SignExt16to64 <t> x)
	// cond:
	// result: (SRAI [48] (SLLI <t> [48] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 48
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 48
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpSignExt32to64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SignExt32to64 <t> x)
	// cond:
	// result: (SRAI [32] (SLLI <t> [32] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 32
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 32
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpSignExt8to16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SignExt8to16  <t> x)
	// cond:
	// result: (SRAI [56] (SLLI <t> [56] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 56
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 56
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpSignExt8to32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SignExt8to32  <t> x)
	// cond:
	// result: (SRAI [56] (SLLI <t> [56] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 56
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 56
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpSignExt8to64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SignExt8to64  <t> x)
	// cond:
	// result: (SRAI [56] (SLLI <t> [56] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRAI)
		v.AuxInt = 56
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 56
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpSlicemask(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Slicemask <t> x)
	// cond:
	// result: (XOR (MOVDconst [-1]) (SRA <t> (SUB <t> x (MOVDconst [1])) (MOVDconst [63])))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVXOR)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v0.AuxInt = -1
		v.AddArg(v0)
		v1 := b.NewValue0(v.Pos, OpRISCVSRA, t)
		v2 := b.NewValue0(v.Pos, OpRISCVSUB, t)
		v2.AddArg(x)
		v3 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v3.AuxInt = 1
		v2.AddArg(v3)
		v1.AddArg(v2)
		v4 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v4.AuxInt = 63
		v1.AddArg(v4)
		v.AddArg(v1)
		return true
	}
}
func rewriteValueRISCV_OpSqrt(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Sqrt x)
	// cond:
	// result: (FSQRTD x)
	for {
		x := v.Args[0]
		v.reset(OpRISCVFSQRTD)
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpStaticCall(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (StaticCall  [argwid] {target}      mem)
	// cond:
	// result: (CALLstatic  [argwid] {target}      mem)
	for {
		argwid := v.AuxInt
		target := v.Aux
		mem := v.Args[0]
		v.reset(OpRISCVCALLstatic)
		v.AuxInt = argwid
		v.Aux = target
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpStore(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Store [1] ptr val mem)
	// cond:
	// result: (MOVBstore ptr val mem)
	for {
		if v.AuxInt != 1 {
			break
		}
		ptr := v.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		v.reset(OpRISCVMOVBstore)
		v.AddArg(ptr)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (Store [2] ptr val mem)
	// cond:
	// result: (MOVHstore ptr val mem)
	for {
		if v.AuxInt != 2 {
			break
		}
		ptr := v.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		v.reset(OpRISCVMOVHstore)
		v.AddArg(ptr)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (Store [4] ptr val mem)
	// cond: !is32BitFloat(val.Type)
	// result: (MOVWstore ptr val mem)
	for {
		if v.AuxInt != 4 {
			break
		}
		ptr := v.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(!is32BitFloat(val.Type)) {
			break
		}
		v.reset(OpRISCVMOVWstore)
		v.AddArg(ptr)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (Store [8] ptr val mem)
	// cond: !is64BitFloat(val.Type)
	// result: (MOVDstore ptr val mem)
	for {
		if v.AuxInt != 8 {
			break
		}
		ptr := v.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(!is64BitFloat(val.Type)) {
			break
		}
		v.reset(OpRISCVMOVDstore)
		v.AddArg(ptr)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (Store [4] ptr val mem)
	// cond: is32BitFloat(val.Type)
	// result: (FMOVWstore ptr val mem)
	for {
		if v.AuxInt != 4 {
			break
		}
		ptr := v.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is32BitFloat(val.Type)) {
			break
		}
		v.reset(OpRISCVFMOVWstore)
		v.AddArg(ptr)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	// match: (Store [8] ptr val mem)
	// cond: is64BitFloat(val.Type)
	// result: (FMOVDstore ptr val mem)
	for {
		if v.AuxInt != 8 {
			break
		}
		ptr := v.Args[0]
		val := v.Args[1]
		mem := v.Args[2]
		if !(is64BitFloat(val.Type)) {
			break
		}
		v.reset(OpRISCVFMOVDstore)
		v.AddArg(ptr)
		v.AddArg(val)
		v.AddArg(mem)
		return true
	}
	return false
}
func rewriteValueRISCV_OpSub16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Sub16 x y)
	// cond:
	// result: (SUB x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSUB)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpSub32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Sub32 x y)
	// cond:
	// result: (SUB x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSUB)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpSub32F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Sub32F x y)
	// cond:
	// result: (FSUBS x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFSUBS)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpSub64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Sub64 x y)
	// cond:
	// result: (SUB x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSUB)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpSub64F(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Sub64F x y)
	// cond:
	// result: (FSUBD x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVFSUBD)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpSub8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Sub8 x y)
	// cond:
	// result: (SUB x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSUB)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpSubPtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SubPtr x y)
	// cond:
	// result: (SUB x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVSUB)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpTrunc16to8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Trunc16to8  x)
	// cond:
	// result: x
	for {
		x := v.Args[0]
		v.reset(OpCopy)
		v.Type = x.Type
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpTrunc32to16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Trunc32to16 x)
	// cond:
	// result: x
	for {
		x := v.Args[0]
		v.reset(OpCopy)
		v.Type = x.Type
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpTrunc32to8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Trunc32to8  x)
	// cond:
	// result: x
	for {
		x := v.Args[0]
		v.reset(OpCopy)
		v.Type = x.Type
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpTrunc64to16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Trunc64to16 x)
	// cond:
	// result: x
	for {
		x := v.Args[0]
		v.reset(OpCopy)
		v.Type = x.Type
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpTrunc64to32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Trunc64to32 x)
	// cond:
	// result: x
	for {
		x := v.Args[0]
		v.reset(OpCopy)
		v.Type = x.Type
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpTrunc64to8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Trunc64to8  x)
	// cond:
	// result: x
	for {
		x := v.Args[0]
		v.reset(OpCopy)
		v.Type = x.Type
		v.AddArg(x)
		return true
	}
}
func rewriteValueRISCV_OpXor16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Xor16 x y)
	// cond:
	// result: (XOR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVXOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpXor32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Xor32 x y)
	// cond:
	// result: (XOR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVXOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpXor64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Xor64 x y)
	// cond:
	// result: (XOR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVXOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpXor8(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Xor8  x y)
	// cond:
	// result: (XOR x y)
	for {
		x := v.Args[0]
		y := v.Args[1]
		v.reset(OpRISCVXOR)
		v.AddArg(x)
		v.AddArg(y)
		return true
	}
}
func rewriteValueRISCV_OpZero(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (Zero [s]   _ mem)
	// cond: SizeAndAlign(s).Size() == 0
	// result: mem
	for {
		s := v.AuxInt
		mem := v.Args[1]
		if !(SizeAndAlign(s).Size() == 0) {
			break
		}
		v.reset(OpCopy)
		v.Type = mem.Type
		v.AddArg(mem)
		return true
	}
	// match: (Zero [s] ptr mem)
	// cond: SizeAndAlign(s).Size() == 1
	// result: (MOVBstore ptr (MOVBconst) mem)
	for {
		s := v.AuxInt
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(SizeAndAlign(s).Size() == 1) {
			break
		}
		v.reset(OpRISCVMOVBstore)
		v.AddArg(ptr)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVBconst, config.fe.TypeUInt8())
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Zero [s] ptr mem)
	// cond: SizeAndAlign(s).Size() == 2
	// result: (MOVHstore ptr (MOVHconst) mem)
	for {
		s := v.AuxInt
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(SizeAndAlign(s).Size() == 2) {
			break
		}
		v.reset(OpRISCVMOVHstore)
		v.AddArg(ptr)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVHconst, config.fe.TypeUInt16())
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Zero [s] ptr mem)
	// cond: SizeAndAlign(s).Size() == 4
	// result: (MOVWstore ptr (MOVWconst) mem)
	for {
		s := v.AuxInt
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(SizeAndAlign(s).Size() == 4) {
			break
		}
		v.reset(OpRISCVMOVWstore)
		v.AddArg(ptr)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVWconst, config.fe.TypeUInt32())
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Zero [s] ptr mem)
	// cond: SizeAndAlign(s).Size() == 8
	// result: (MOVDstore ptr (MOVDconst) mem)
	for {
		s := v.AuxInt
		ptr := v.Args[0]
		mem := v.Args[1]
		if !(SizeAndAlign(s).Size() == 8) {
			break
		}
		v.reset(OpRISCVMOVDstore)
		v.AddArg(ptr)
		v0 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
	// match: (Zero [s] ptr mem)
	// cond:
	// result: (LoweredZero [SizeAndAlign(s).Align()] 		ptr 		(ADD <ptr.Type> ptr (MOVDconst [SizeAndAlign(s).Size()-moveSize(SizeAndAlign(s).Align(), config)])) 		mem)
	for {
		s := v.AuxInt
		ptr := v.Args[0]
		mem := v.Args[1]
		v.reset(OpRISCVLoweredZero)
		v.AuxInt = SizeAndAlign(s).Align()
		v.AddArg(ptr)
		v0 := b.NewValue0(v.Pos, OpRISCVADD, ptr.Type)
		v0.AddArg(ptr)
		v1 := b.NewValue0(v.Pos, OpRISCVMOVDconst, config.fe.TypeUInt64())
		v1.AuxInt = SizeAndAlign(s).Size() - moveSize(SizeAndAlign(s).Align(), config)
		v0.AddArg(v1)
		v.AddArg(v0)
		v.AddArg(mem)
		return true
	}
}
func rewriteValueRISCV_OpZeroExt16to32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ZeroExt16to32 <t> x)
	// cond:
	// result: (SRLI [48] (SLLI <t> [48] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 48
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 48
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpZeroExt16to64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ZeroExt16to64 <t> x)
	// cond:
	// result: (SRLI [48] (SLLI <t> [48] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 48
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 48
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpZeroExt32to64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ZeroExt32to64 <t> x)
	// cond:
	// result: (SRLI [32] (SLLI <t> [32] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 32
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 32
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpZeroExt8to16(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ZeroExt8to16  <t> x)
	// cond:
	// result: (SRLI [56] (SLLI <t> [56] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 56
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 56
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpZeroExt8to32(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ZeroExt8to32  <t> x)
	// cond:
	// result: (SRLI [56] (SLLI <t> [56] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 56
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 56
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteValueRISCV_OpZeroExt8to64(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (ZeroExt8to64  <t> x)
	// cond:
	// result: (SRLI [56] (SLLI <t> [56] x))
	for {
		t := v.Type
		x := v.Args[0]
		v.reset(OpRISCVSRLI)
		v.AuxInt = 56
		v0 := b.NewValue0(v.Pos, OpRISCVSLLI, t)
		v0.AuxInt = 56
		v0.AddArg(x)
		v.AddArg(v0)
		return true
	}
}
func rewriteBlockRISCV(b *Block, config *Config) bool {
	switch b.Kind {
	case BlockIf:
		// match: (If cond yes no)
		// cond:
		// result: (BNE cond yes no)
		for {
			v := b.Control
			_ = v
			cond := b.Control
			yes := b.Succs[0]
			no := b.Succs[1]
			b.Kind = BlockRISCVBNE
			b.SetControl(cond)
			_ = yes
			_ = no
			return true
		}
	}
	return false
}
