| // autogenerated from gen/S390X.rules: do not edit! |
| // generated with: cd gen; go run *.go |
| |
| package ssa |
| |
| import "math" |
| |
| var _ = math.MinInt8 // in case not otherwise used |
| func rewriteValueS390X(v *Value, config *Config) bool { |
| switch v.Op { |
| case OpAdd16: |
| return rewriteValueS390X_OpAdd16(v, config) |
| case OpAdd32: |
| return rewriteValueS390X_OpAdd32(v, config) |
| case OpAdd32F: |
| return rewriteValueS390X_OpAdd32F(v, config) |
| case OpAdd64: |
| return rewriteValueS390X_OpAdd64(v, config) |
| case OpAdd64F: |
| return rewriteValueS390X_OpAdd64F(v, config) |
| case OpAdd8: |
| return rewriteValueS390X_OpAdd8(v, config) |
| case OpAddPtr: |
| return rewriteValueS390X_OpAddPtr(v, config) |
| case OpAddr: |
| return rewriteValueS390X_OpAddr(v, config) |
| case OpAnd16: |
| return rewriteValueS390X_OpAnd16(v, config) |
| case OpAnd32: |
| return rewriteValueS390X_OpAnd32(v, config) |
| case OpAnd64: |
| return rewriteValueS390X_OpAnd64(v, config) |
| case OpAnd8: |
| return rewriteValueS390X_OpAnd8(v, config) |
| case OpAndB: |
| return rewriteValueS390X_OpAndB(v, config) |
| case OpAtomicAdd32: |
| return rewriteValueS390X_OpAtomicAdd32(v, config) |
| case OpAtomicAdd64: |
| return rewriteValueS390X_OpAtomicAdd64(v, config) |
| case OpAtomicCompareAndSwap32: |
| return rewriteValueS390X_OpAtomicCompareAndSwap32(v, config) |
| case OpAtomicCompareAndSwap64: |
| return rewriteValueS390X_OpAtomicCompareAndSwap64(v, config) |
| case OpAtomicExchange32: |
| return rewriteValueS390X_OpAtomicExchange32(v, config) |
| case OpAtomicExchange64: |
| return rewriteValueS390X_OpAtomicExchange64(v, config) |
| case OpAtomicLoad32: |
| return rewriteValueS390X_OpAtomicLoad32(v, config) |
| case OpAtomicLoad64: |
| return rewriteValueS390X_OpAtomicLoad64(v, config) |
| case OpAtomicLoadPtr: |
| return rewriteValueS390X_OpAtomicLoadPtr(v, config) |
| case OpAtomicStore32: |
| return rewriteValueS390X_OpAtomicStore32(v, config) |
| case OpAtomicStore64: |
| return rewriteValueS390X_OpAtomicStore64(v, config) |
| case OpAtomicStorePtrNoWB: |
| return rewriteValueS390X_OpAtomicStorePtrNoWB(v, config) |
| case OpAvg64u: |
| return rewriteValueS390X_OpAvg64u(v, config) |
| case OpBswap32: |
| return rewriteValueS390X_OpBswap32(v, config) |
| case OpBswap64: |
| return rewriteValueS390X_OpBswap64(v, config) |
| case OpClosureCall: |
| return rewriteValueS390X_OpClosureCall(v, config) |
| case OpCom16: |
| return rewriteValueS390X_OpCom16(v, config) |
| case OpCom32: |
| return rewriteValueS390X_OpCom32(v, config) |
| case OpCom64: |
| return rewriteValueS390X_OpCom64(v, config) |
| case OpCom8: |
| return rewriteValueS390X_OpCom8(v, config) |
| case OpConst16: |
| return rewriteValueS390X_OpConst16(v, config) |
| case OpConst32: |
| return rewriteValueS390X_OpConst32(v, config) |
| case OpConst32F: |
| return rewriteValueS390X_OpConst32F(v, config) |
| case OpConst64: |
| return rewriteValueS390X_OpConst64(v, config) |
| case OpConst64F: |
| return rewriteValueS390X_OpConst64F(v, config) |
| case OpConst8: |
| return rewriteValueS390X_OpConst8(v, config) |
| case OpConstBool: |
| return rewriteValueS390X_OpConstBool(v, config) |
| case OpConstNil: |
| return rewriteValueS390X_OpConstNil(v, config) |
| case OpConvert: |
| return rewriteValueS390X_OpConvert(v, config) |
| case OpCtz32: |
| return rewriteValueS390X_OpCtz32(v, config) |
| case OpCtz64: |
| return rewriteValueS390X_OpCtz64(v, config) |
| case OpCvt32Fto32: |
| return rewriteValueS390X_OpCvt32Fto32(v, config) |
| case OpCvt32Fto64: |
| return rewriteValueS390X_OpCvt32Fto64(v, config) |
| case OpCvt32Fto64F: |
| return rewriteValueS390X_OpCvt32Fto64F(v, config) |
| case OpCvt32to32F: |
| return rewriteValueS390X_OpCvt32to32F(v, config) |
| case OpCvt32to64F: |
| return rewriteValueS390X_OpCvt32to64F(v, config) |
| case OpCvt64Fto32: |
| return rewriteValueS390X_OpCvt64Fto32(v, config) |
| case OpCvt64Fto32F: |
| return rewriteValueS390X_OpCvt64Fto32F(v, config) |
| case OpCvt64Fto64: |
| return rewriteValueS390X_OpCvt64Fto64(v, config) |
| case OpCvt64to32F: |
| return rewriteValueS390X_OpCvt64to32F(v, config) |
| case OpCvt64to64F: |
| return rewriteValueS390X_OpCvt64to64F(v, config) |
| case OpDeferCall: |
| return rewriteValueS390X_OpDeferCall(v, config) |
| case OpDiv16: |
| return rewriteValueS390X_OpDiv16(v, config) |
| case OpDiv16u: |
| return rewriteValueS390X_OpDiv16u(v, config) |
| case OpDiv32: |
| return rewriteValueS390X_OpDiv32(v, config) |
| case OpDiv32F: |
| return rewriteValueS390X_OpDiv32F(v, config) |
| case OpDiv32u: |
| return rewriteValueS390X_OpDiv32u(v, config) |
| case OpDiv64: |
| return rewriteValueS390X_OpDiv64(v, config) |
| case OpDiv64F: |
| return rewriteValueS390X_OpDiv64F(v, config) |
| case OpDiv64u: |
| return rewriteValueS390X_OpDiv64u(v, config) |
| case OpDiv8: |
| return rewriteValueS390X_OpDiv8(v, config) |
| case OpDiv8u: |
| return rewriteValueS390X_OpDiv8u(v, config) |
| case OpEq16: |
| return rewriteValueS390X_OpEq16(v, config) |
| case OpEq32: |
| return rewriteValueS390X_OpEq32(v, config) |
| case OpEq32F: |
| return rewriteValueS390X_OpEq32F(v, config) |
| case OpEq64: |
| return rewriteValueS390X_OpEq64(v, config) |
| case OpEq64F: |
| return rewriteValueS390X_OpEq64F(v, config) |
| case OpEq8: |
| return rewriteValueS390X_OpEq8(v, config) |
| case OpEqB: |
| return rewriteValueS390X_OpEqB(v, config) |
| case OpEqPtr: |
| return rewriteValueS390X_OpEqPtr(v, config) |
| case OpGeq16: |
| return rewriteValueS390X_OpGeq16(v, config) |
| case OpGeq16U: |
| return rewriteValueS390X_OpGeq16U(v, config) |
| case OpGeq32: |
| return rewriteValueS390X_OpGeq32(v, config) |
| case OpGeq32F: |
| return rewriteValueS390X_OpGeq32F(v, config) |
| case OpGeq32U: |
| return rewriteValueS390X_OpGeq32U(v, config) |
| case OpGeq64: |
| return rewriteValueS390X_OpGeq64(v, config) |
| case OpGeq64F: |
| return rewriteValueS390X_OpGeq64F(v, config) |
| case OpGeq64U: |
| return rewriteValueS390X_OpGeq64U(v, config) |
| case OpGeq8: |
| return rewriteValueS390X_OpGeq8(v, config) |
| case OpGeq8U: |
| return rewriteValueS390X_OpGeq8U(v, config) |
| case OpGetClosurePtr: |
| return rewriteValueS390X_OpGetClosurePtr(v, config) |
| case OpGetG: |
| return rewriteValueS390X_OpGetG(v, config) |
| case OpGoCall: |
| return rewriteValueS390X_OpGoCall(v, config) |
| case OpGreater16: |
| return rewriteValueS390X_OpGreater16(v, config) |
| case OpGreater16U: |
| return rewriteValueS390X_OpGreater16U(v, config) |
| case OpGreater32: |
| return rewriteValueS390X_OpGreater32(v, config) |
| case OpGreater32F: |
| return rewriteValueS390X_OpGreater32F(v, config) |
| case OpGreater32U: |
| return rewriteValueS390X_OpGreater32U(v, config) |
| case OpGreater64: |
| return rewriteValueS390X_OpGreater64(v, config) |
| case OpGreater64F: |
| return rewriteValueS390X_OpGreater64F(v, config) |
| case OpGreater64U: |
| return rewriteValueS390X_OpGreater64U(v, config) |
| case OpGreater8: |
| return rewriteValueS390X_OpGreater8(v, config) |
| case OpGreater8U: |
| return rewriteValueS390X_OpGreater8U(v, config) |
| case OpHmul16: |
| return rewriteValueS390X_OpHmul16(v, config) |
| case OpHmul16u: |
| return rewriteValueS390X_OpHmul16u(v, config) |
| case OpHmul32: |
| return rewriteValueS390X_OpHmul32(v, config) |
| case OpHmul32u: |
| return rewriteValueS390X_OpHmul32u(v, config) |
| case OpHmul64: |
| return rewriteValueS390X_OpHmul64(v, config) |
| case OpHmul64u: |
| return rewriteValueS390X_OpHmul64u(v, config) |
| case OpHmul8: |
| return rewriteValueS390X_OpHmul8(v, config) |
| case OpHmul8u: |
| return rewriteValueS390X_OpHmul8u(v, config) |
| case OpITab: |
| return rewriteValueS390X_OpITab(v, config) |
| case OpInterCall: |
| return rewriteValueS390X_OpInterCall(v, config) |
| case OpIsInBounds: |
| return rewriteValueS390X_OpIsInBounds(v, config) |
| case OpIsNonNil: |
| return rewriteValueS390X_OpIsNonNil(v, config) |
| case OpIsSliceInBounds: |
| return rewriteValueS390X_OpIsSliceInBounds(v, config) |
| case OpLeq16: |
| return rewriteValueS390X_OpLeq16(v, config) |
| case OpLeq16U: |
| return rewriteValueS390X_OpLeq16U(v, config) |
| case OpLeq32: |
| return rewriteValueS390X_OpLeq32(v, config) |
| case OpLeq32F: |
| return rewriteValueS390X_OpLeq32F(v, config) |
| case OpLeq32U: |
| return rewriteValueS390X_OpLeq32U(v, config) |
| case OpLeq64: |
| return rewriteValueS390X_OpLeq64(v, config) |
| case OpLeq64F: |
| return rewriteValueS390X_OpLeq64F(v, config) |
| case OpLeq64U: |
| return rewriteValueS390X_OpLeq64U(v, config) |
| case OpLeq8: |
| return rewriteValueS390X_OpLeq8(v, config) |
| case OpLeq8U: |
| return rewriteValueS390X_OpLeq8U(v, config) |
| case OpLess16: |
| return rewriteValueS390X_OpLess16(v, config) |
| case OpLess16U: |
| return rewriteValueS390X_OpLess16U(v, config) |
| case OpLess32: |
| return rewriteValueS390X_OpLess32(v, config) |
| case OpLess32F: |
| return rewriteValueS390X_OpLess32F(v, config) |
| case OpLess32U: |
| return rewriteValueS390X_OpLess32U(v, config) |
| case OpLess64: |
| return rewriteValueS390X_OpLess64(v, config) |
| case OpLess64F: |
| return rewriteValueS390X_OpLess64F(v, config) |
| case OpLess64U: |
| return rewriteValueS390X_OpLess64U(v, config) |
| case OpLess8: |
| return rewriteValueS390X_OpLess8(v, config) |
| case OpLess8U: |
| return rewriteValueS390X_OpLess8U(v, config) |
| case OpLoad: |
| return rewriteValueS390X_OpLoad(v, config) |
| case OpLrot32: |
| return rewriteValueS390X_OpLrot32(v, config) |
| case OpLrot64: |
| return rewriteValueS390X_OpLrot64(v, config) |
| case OpLsh16x16: |
| return rewriteValueS390X_OpLsh16x16(v, config) |
| case OpLsh16x32: |
| return rewriteValueS390X_OpLsh16x32(v, config) |
| case OpLsh16x64: |
| return rewriteValueS390X_OpLsh16x64(v, config) |
| case OpLsh16x8: |
| return rewriteValueS390X_OpLsh16x8(v, config) |
| case OpLsh32x16: |
| return rewriteValueS390X_OpLsh32x16(v, config) |
| case OpLsh32x32: |
| return rewriteValueS390X_OpLsh32x32(v, config) |
| case OpLsh32x64: |
| return rewriteValueS390X_OpLsh32x64(v, config) |
| case OpLsh32x8: |
| return rewriteValueS390X_OpLsh32x8(v, config) |
| case OpLsh64x16: |
| return rewriteValueS390X_OpLsh64x16(v, config) |
| case OpLsh64x32: |
| return rewriteValueS390X_OpLsh64x32(v, config) |
| case OpLsh64x64: |
| return rewriteValueS390X_OpLsh64x64(v, config) |
| case OpLsh64x8: |
| return rewriteValueS390X_OpLsh64x8(v, config) |
| case OpLsh8x16: |
| return rewriteValueS390X_OpLsh8x16(v, config) |
| case OpLsh8x32: |
| return rewriteValueS390X_OpLsh8x32(v, config) |
| case OpLsh8x64: |
| return rewriteValueS390X_OpLsh8x64(v, config) |
| case OpLsh8x8: |
| return rewriteValueS390X_OpLsh8x8(v, config) |
| case OpMod16: |
| return rewriteValueS390X_OpMod16(v, config) |
| case OpMod16u: |
| return rewriteValueS390X_OpMod16u(v, config) |
| case OpMod32: |
| return rewriteValueS390X_OpMod32(v, config) |
| case OpMod32u: |
| return rewriteValueS390X_OpMod32u(v, config) |
| case OpMod64: |
| return rewriteValueS390X_OpMod64(v, config) |
| case OpMod64u: |
| return rewriteValueS390X_OpMod64u(v, config) |
| case OpMod8: |
| return rewriteValueS390X_OpMod8(v, config) |
| case OpMod8u: |
| return rewriteValueS390X_OpMod8u(v, config) |
| case OpMove: |
| return rewriteValueS390X_OpMove(v, config) |
| case OpMul16: |
| return rewriteValueS390X_OpMul16(v, config) |
| case OpMul32: |
| return rewriteValueS390X_OpMul32(v, config) |
| case OpMul32F: |
| return rewriteValueS390X_OpMul32F(v, config) |
| case OpMul64: |
| return rewriteValueS390X_OpMul64(v, config) |
| case OpMul64F: |
| return rewriteValueS390X_OpMul64F(v, config) |
| case OpMul8: |
| return rewriteValueS390X_OpMul8(v, config) |
| case OpNeg16: |
| return rewriteValueS390X_OpNeg16(v, config) |
| case OpNeg32: |
| return rewriteValueS390X_OpNeg32(v, config) |
| case OpNeg32F: |
| return rewriteValueS390X_OpNeg32F(v, config) |
| case OpNeg64: |
| return rewriteValueS390X_OpNeg64(v, config) |
| case OpNeg64F: |
| return rewriteValueS390X_OpNeg64F(v, config) |
| case OpNeg8: |
| return rewriteValueS390X_OpNeg8(v, config) |
| case OpNeq16: |
| return rewriteValueS390X_OpNeq16(v, config) |
| case OpNeq32: |
| return rewriteValueS390X_OpNeq32(v, config) |
| case OpNeq32F: |
| return rewriteValueS390X_OpNeq32F(v, config) |
| case OpNeq64: |
| return rewriteValueS390X_OpNeq64(v, config) |
| case OpNeq64F: |
| return rewriteValueS390X_OpNeq64F(v, config) |
| case OpNeq8: |
| return rewriteValueS390X_OpNeq8(v, config) |
| case OpNeqB: |
| return rewriteValueS390X_OpNeqB(v, config) |
| case OpNeqPtr: |
| return rewriteValueS390X_OpNeqPtr(v, config) |
| case OpNilCheck: |
| return rewriteValueS390X_OpNilCheck(v, config) |
| case OpNot: |
| return rewriteValueS390X_OpNot(v, config) |
| case OpOffPtr: |
| return rewriteValueS390X_OpOffPtr(v, config) |
| case OpOr16: |
| return rewriteValueS390X_OpOr16(v, config) |
| case OpOr32: |
| return rewriteValueS390X_OpOr32(v, config) |
| case OpOr64: |
| return rewriteValueS390X_OpOr64(v, config) |
| case OpOr8: |
| return rewriteValueS390X_OpOr8(v, config) |
| case OpOrB: |
| return rewriteValueS390X_OpOrB(v, config) |
| case OpRsh16Ux16: |
| return rewriteValueS390X_OpRsh16Ux16(v, config) |
| case OpRsh16Ux32: |
| return rewriteValueS390X_OpRsh16Ux32(v, config) |
| case OpRsh16Ux64: |
| return rewriteValueS390X_OpRsh16Ux64(v, config) |
| case OpRsh16Ux8: |
| return rewriteValueS390X_OpRsh16Ux8(v, config) |
| case OpRsh16x16: |
| return rewriteValueS390X_OpRsh16x16(v, config) |
| case OpRsh16x32: |
| return rewriteValueS390X_OpRsh16x32(v, config) |
| case OpRsh16x64: |
| return rewriteValueS390X_OpRsh16x64(v, config) |
| case OpRsh16x8: |
| return rewriteValueS390X_OpRsh16x8(v, config) |
| case OpRsh32Ux16: |
| return rewriteValueS390X_OpRsh32Ux16(v, config) |
| case OpRsh32Ux32: |
| return rewriteValueS390X_OpRsh32Ux32(v, config) |
| case OpRsh32Ux64: |
| return rewriteValueS390X_OpRsh32Ux64(v, config) |
| case OpRsh32Ux8: |
| return rewriteValueS390X_OpRsh32Ux8(v, config) |
| case OpRsh32x16: |
| return rewriteValueS390X_OpRsh32x16(v, config) |
| case OpRsh32x32: |
| return rewriteValueS390X_OpRsh32x32(v, config) |
| case OpRsh32x64: |
| return rewriteValueS390X_OpRsh32x64(v, config) |
| case OpRsh32x8: |
| return rewriteValueS390X_OpRsh32x8(v, config) |
| case OpRsh64Ux16: |
| return rewriteValueS390X_OpRsh64Ux16(v, config) |
| case OpRsh64Ux32: |
| return rewriteValueS390X_OpRsh64Ux32(v, config) |
| case OpRsh64Ux64: |
| return rewriteValueS390X_OpRsh64Ux64(v, config) |
| case OpRsh64Ux8: |
| return rewriteValueS390X_OpRsh64Ux8(v, config) |
| case OpRsh64x16: |
| return rewriteValueS390X_OpRsh64x16(v, config) |
| case OpRsh64x32: |
| return rewriteValueS390X_OpRsh64x32(v, config) |
| case OpRsh64x64: |
| return rewriteValueS390X_OpRsh64x64(v, config) |
| case OpRsh64x8: |
| return rewriteValueS390X_OpRsh64x8(v, config) |
| case OpRsh8Ux16: |
| return rewriteValueS390X_OpRsh8Ux16(v, config) |
| case OpRsh8Ux32: |
| return rewriteValueS390X_OpRsh8Ux32(v, config) |
| case OpRsh8Ux64: |
| return rewriteValueS390X_OpRsh8Ux64(v, config) |
| case OpRsh8Ux8: |
| return rewriteValueS390X_OpRsh8Ux8(v, config) |
| case OpRsh8x16: |
| return rewriteValueS390X_OpRsh8x16(v, config) |
| case OpRsh8x32: |
| return rewriteValueS390X_OpRsh8x32(v, config) |
| case OpRsh8x64: |
| return rewriteValueS390X_OpRsh8x64(v, config) |
| case OpRsh8x8: |
| return rewriteValueS390X_OpRsh8x8(v, config) |
| case OpS390XADD: |
| return rewriteValueS390X_OpS390XADD(v, config) |
| case OpS390XADDW: |
| return rewriteValueS390X_OpS390XADDW(v, config) |
| case OpS390XADDWconst: |
| return rewriteValueS390X_OpS390XADDWconst(v, config) |
| case OpS390XADDconst: |
| return rewriteValueS390X_OpS390XADDconst(v, config) |
| case OpS390XAND: |
| return rewriteValueS390X_OpS390XAND(v, config) |
| case OpS390XANDW: |
| return rewriteValueS390X_OpS390XANDW(v, config) |
| case OpS390XANDWconst: |
| return rewriteValueS390X_OpS390XANDWconst(v, config) |
| case OpS390XANDconst: |
| return rewriteValueS390X_OpS390XANDconst(v, config) |
| case OpS390XCMP: |
| return rewriteValueS390X_OpS390XCMP(v, config) |
| case OpS390XCMPU: |
| return rewriteValueS390X_OpS390XCMPU(v, config) |
| case OpS390XCMPUconst: |
| return rewriteValueS390X_OpS390XCMPUconst(v, config) |
| case OpS390XCMPW: |
| return rewriteValueS390X_OpS390XCMPW(v, config) |
| case OpS390XCMPWU: |
| return rewriteValueS390X_OpS390XCMPWU(v, config) |
| case OpS390XCMPWUconst: |
| return rewriteValueS390X_OpS390XCMPWUconst(v, config) |
| case OpS390XCMPWconst: |
| return rewriteValueS390X_OpS390XCMPWconst(v, config) |
| case OpS390XCMPconst: |
| return rewriteValueS390X_OpS390XCMPconst(v, config) |
| case OpS390XFMOVDload: |
| return rewriteValueS390X_OpS390XFMOVDload(v, config) |
| case OpS390XFMOVDloadidx: |
| return rewriteValueS390X_OpS390XFMOVDloadidx(v, config) |
| case OpS390XFMOVDstore: |
| return rewriteValueS390X_OpS390XFMOVDstore(v, config) |
| case OpS390XFMOVDstoreidx: |
| return rewriteValueS390X_OpS390XFMOVDstoreidx(v, config) |
| case OpS390XFMOVSload: |
| return rewriteValueS390X_OpS390XFMOVSload(v, config) |
| case OpS390XFMOVSloadidx: |
| return rewriteValueS390X_OpS390XFMOVSloadidx(v, config) |
| case OpS390XFMOVSstore: |
| return rewriteValueS390X_OpS390XFMOVSstore(v, config) |
| case OpS390XFMOVSstoreidx: |
| return rewriteValueS390X_OpS390XFMOVSstoreidx(v, config) |
| case OpS390XMOVBZload: |
| return rewriteValueS390X_OpS390XMOVBZload(v, config) |
| case OpS390XMOVBZloadidx: |
| return rewriteValueS390X_OpS390XMOVBZloadidx(v, config) |
| case OpS390XMOVBZreg: |
| return rewriteValueS390X_OpS390XMOVBZreg(v, config) |
| case OpS390XMOVBload: |
| return rewriteValueS390X_OpS390XMOVBload(v, config) |
| case OpS390XMOVBreg: |
| return rewriteValueS390X_OpS390XMOVBreg(v, config) |
| case OpS390XMOVBstore: |
| return rewriteValueS390X_OpS390XMOVBstore(v, config) |
| case OpS390XMOVBstoreconst: |
| return rewriteValueS390X_OpS390XMOVBstoreconst(v, config) |
| case OpS390XMOVBstoreidx: |
| return rewriteValueS390X_OpS390XMOVBstoreidx(v, config) |
| case OpS390XMOVDEQ: |
| return rewriteValueS390X_OpS390XMOVDEQ(v, config) |
| case OpS390XMOVDGE: |
| return rewriteValueS390X_OpS390XMOVDGE(v, config) |
| case OpS390XMOVDGT: |
| return rewriteValueS390X_OpS390XMOVDGT(v, config) |
| case OpS390XMOVDLE: |
| return rewriteValueS390X_OpS390XMOVDLE(v, config) |
| case OpS390XMOVDLT: |
| return rewriteValueS390X_OpS390XMOVDLT(v, config) |
| case OpS390XMOVDNE: |
| return rewriteValueS390X_OpS390XMOVDNE(v, config) |
| case OpS390XMOVDaddridx: |
| return rewriteValueS390X_OpS390XMOVDaddridx(v, config) |
| case OpS390XMOVDload: |
| return rewriteValueS390X_OpS390XMOVDload(v, config) |
| case OpS390XMOVDloadidx: |
| return rewriteValueS390X_OpS390XMOVDloadidx(v, config) |
| case OpS390XMOVDstore: |
| return rewriteValueS390X_OpS390XMOVDstore(v, config) |
| case OpS390XMOVDstoreconst: |
| return rewriteValueS390X_OpS390XMOVDstoreconst(v, config) |
| case OpS390XMOVDstoreidx: |
| return rewriteValueS390X_OpS390XMOVDstoreidx(v, config) |
| case OpS390XMOVHBRstore: |
| return rewriteValueS390X_OpS390XMOVHBRstore(v, config) |
| case OpS390XMOVHBRstoreidx: |
| return rewriteValueS390X_OpS390XMOVHBRstoreidx(v, config) |
| case OpS390XMOVHZload: |
| return rewriteValueS390X_OpS390XMOVHZload(v, config) |
| case OpS390XMOVHZloadidx: |
| return rewriteValueS390X_OpS390XMOVHZloadidx(v, config) |
| case OpS390XMOVHZreg: |
| return rewriteValueS390X_OpS390XMOVHZreg(v, config) |
| case OpS390XMOVHload: |
| return rewriteValueS390X_OpS390XMOVHload(v, config) |
| case OpS390XMOVHreg: |
| return rewriteValueS390X_OpS390XMOVHreg(v, config) |
| case OpS390XMOVHstore: |
| return rewriteValueS390X_OpS390XMOVHstore(v, config) |
| case OpS390XMOVHstoreconst: |
| return rewriteValueS390X_OpS390XMOVHstoreconst(v, config) |
| case OpS390XMOVHstoreidx: |
| return rewriteValueS390X_OpS390XMOVHstoreidx(v, config) |
| case OpS390XMOVWBRstore: |
| return rewriteValueS390X_OpS390XMOVWBRstore(v, config) |
| case OpS390XMOVWBRstoreidx: |
| return rewriteValueS390X_OpS390XMOVWBRstoreidx(v, config) |
| case OpS390XMOVWZload: |
| return rewriteValueS390X_OpS390XMOVWZload(v, config) |
| case OpS390XMOVWZloadidx: |
| return rewriteValueS390X_OpS390XMOVWZloadidx(v, config) |
| case OpS390XMOVWZreg: |
| return rewriteValueS390X_OpS390XMOVWZreg(v, config) |
| case OpS390XMOVWload: |
| return rewriteValueS390X_OpS390XMOVWload(v, config) |
| case OpS390XMOVWreg: |
| return rewriteValueS390X_OpS390XMOVWreg(v, config) |
| case OpS390XMOVWstore: |
| return rewriteValueS390X_OpS390XMOVWstore(v, config) |
| case OpS390XMOVWstoreconst: |
| return rewriteValueS390X_OpS390XMOVWstoreconst(v, config) |
| case OpS390XMOVWstoreidx: |
| return rewriteValueS390X_OpS390XMOVWstoreidx(v, config) |
| case OpS390XMULLD: |
| return rewriteValueS390X_OpS390XMULLD(v, config) |
| case OpS390XMULLDconst: |
| return rewriteValueS390X_OpS390XMULLDconst(v, config) |
| case OpS390XMULLW: |
| return rewriteValueS390X_OpS390XMULLW(v, config) |
| case OpS390XMULLWconst: |
| return rewriteValueS390X_OpS390XMULLWconst(v, config) |
| case OpS390XNEG: |
| return rewriteValueS390X_OpS390XNEG(v, config) |
| case OpS390XNEGW: |
| return rewriteValueS390X_OpS390XNEGW(v, config) |
| case OpS390XNOT: |
| return rewriteValueS390X_OpS390XNOT(v, config) |
| case OpS390XNOTW: |
| return rewriteValueS390X_OpS390XNOTW(v, config) |
| case OpS390XOR: |
| return rewriteValueS390X_OpS390XOR(v, config) |
| case OpS390XORW: |
| return rewriteValueS390X_OpS390XORW(v, config) |
| case OpS390XORWconst: |
| return rewriteValueS390X_OpS390XORWconst(v, config) |
| case OpS390XORconst: |
| return rewriteValueS390X_OpS390XORconst(v, config) |
| case OpS390XSLD: |
| return rewriteValueS390X_OpS390XSLD(v, config) |
| case OpS390XSLW: |
| return rewriteValueS390X_OpS390XSLW(v, config) |
| case OpS390XSRAD: |
| return rewriteValueS390X_OpS390XSRAD(v, config) |
| case OpS390XSRADconst: |
| return rewriteValueS390X_OpS390XSRADconst(v, config) |
| case OpS390XSRAW: |
| return rewriteValueS390X_OpS390XSRAW(v, config) |
| case OpS390XSRAWconst: |
| return rewriteValueS390X_OpS390XSRAWconst(v, config) |
| case OpS390XSRD: |
| return rewriteValueS390X_OpS390XSRD(v, config) |
| case OpS390XSRW: |
| return rewriteValueS390X_OpS390XSRW(v, config) |
| case OpS390XSTM2: |
| return rewriteValueS390X_OpS390XSTM2(v, config) |
| case OpS390XSTMG2: |
| return rewriteValueS390X_OpS390XSTMG2(v, config) |
| case OpS390XSUB: |
| return rewriteValueS390X_OpS390XSUB(v, config) |
| case OpS390XSUBEWcarrymask: |
| return rewriteValueS390X_OpS390XSUBEWcarrymask(v, config) |
| case OpS390XSUBEcarrymask: |
| return rewriteValueS390X_OpS390XSUBEcarrymask(v, config) |
| case OpS390XSUBW: |
| return rewriteValueS390X_OpS390XSUBW(v, config) |
| case OpS390XSUBWconst: |
| return rewriteValueS390X_OpS390XSUBWconst(v, config) |
| case OpS390XSUBconst: |
| return rewriteValueS390X_OpS390XSUBconst(v, config) |
| case OpS390XXOR: |
| return rewriteValueS390X_OpS390XXOR(v, config) |
| case OpS390XXORW: |
| return rewriteValueS390X_OpS390XXORW(v, config) |
| case OpS390XXORWconst: |
| return rewriteValueS390X_OpS390XXORWconst(v, config) |
| case OpS390XXORconst: |
| return rewriteValueS390X_OpS390XXORconst(v, config) |
| case OpSelect0: |
| return rewriteValueS390X_OpSelect0(v, config) |
| case OpSelect1: |
| return rewriteValueS390X_OpSelect1(v, config) |
| case OpSignExt16to32: |
| return rewriteValueS390X_OpSignExt16to32(v, config) |
| case OpSignExt16to64: |
| return rewriteValueS390X_OpSignExt16to64(v, config) |
| case OpSignExt32to64: |
| return rewriteValueS390X_OpSignExt32to64(v, config) |
| case OpSignExt8to16: |
| return rewriteValueS390X_OpSignExt8to16(v, config) |
| case OpSignExt8to32: |
| return rewriteValueS390X_OpSignExt8to32(v, config) |
| case OpSignExt8to64: |
| return rewriteValueS390X_OpSignExt8to64(v, config) |
| case OpSlicemask: |
| return rewriteValueS390X_OpSlicemask(v, config) |
| case OpSqrt: |
| return rewriteValueS390X_OpSqrt(v, config) |
| case OpStaticCall: |
| return rewriteValueS390X_OpStaticCall(v, config) |
| case OpStore: |
| return rewriteValueS390X_OpStore(v, config) |
| case OpSub16: |
| return rewriteValueS390X_OpSub16(v, config) |
| case OpSub32: |
| return rewriteValueS390X_OpSub32(v, config) |
| case OpSub32F: |
| return rewriteValueS390X_OpSub32F(v, config) |
| case OpSub64: |
| return rewriteValueS390X_OpSub64(v, config) |
| case OpSub64F: |
| return rewriteValueS390X_OpSub64F(v, config) |
| case OpSub8: |
| return rewriteValueS390X_OpSub8(v, config) |
| case OpSubPtr: |
| return rewriteValueS390X_OpSubPtr(v, config) |
| case OpTrunc16to8: |
| return rewriteValueS390X_OpTrunc16to8(v, config) |
| case OpTrunc32to16: |
| return rewriteValueS390X_OpTrunc32to16(v, config) |
| case OpTrunc32to8: |
| return rewriteValueS390X_OpTrunc32to8(v, config) |
| case OpTrunc64to16: |
| return rewriteValueS390X_OpTrunc64to16(v, config) |
| case OpTrunc64to32: |
| return rewriteValueS390X_OpTrunc64to32(v, config) |
| case OpTrunc64to8: |
| return rewriteValueS390X_OpTrunc64to8(v, config) |
| case OpXor16: |
| return rewriteValueS390X_OpXor16(v, config) |
| case OpXor32: |
| return rewriteValueS390X_OpXor32(v, config) |
| case OpXor64: |
| return rewriteValueS390X_OpXor64(v, config) |
| case OpXor8: |
| return rewriteValueS390X_OpXor8(v, config) |
| case OpZero: |
| return rewriteValueS390X_OpZero(v, config) |
| case OpZeroExt16to32: |
| return rewriteValueS390X_OpZeroExt16to32(v, config) |
| case OpZeroExt16to64: |
| return rewriteValueS390X_OpZeroExt16to64(v, config) |
| case OpZeroExt32to64: |
| return rewriteValueS390X_OpZeroExt32to64(v, config) |
| case OpZeroExt8to16: |
| return rewriteValueS390X_OpZeroExt8to16(v, config) |
| case OpZeroExt8to32: |
| return rewriteValueS390X_OpZeroExt8to32(v, config) |
| case OpZeroExt8to64: |
| return rewriteValueS390X_OpZeroExt8to64(v, config) |
| } |
| return false |
| } |
| func rewriteValueS390X_OpAdd16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add16 x y) |
| // cond: |
| // result: (ADDW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XADDW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAdd32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add32 x y) |
| // cond: |
| // result: (ADDW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XADDW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XFADDS) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XADD) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAdd64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add64F x y) |
| // cond: |
| // result: (FADD x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XFADD) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAdd8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add8 x y) |
| // cond: |
| // result: (ADDW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XADDW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XADD) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAddr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Addr {sym} base) |
| // cond: |
| // result: (MOVDaddr {sym} base) |
| for { |
| sym := v.Aux |
| base := v.Args[0] |
| v.reset(OpS390XMOVDaddr) |
| v.Aux = sym |
| v.AddArg(base) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAnd16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (And16 x y) |
| // cond: |
| // result: (ANDW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAnd32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (And32 x y) |
| // cond: |
| // result: (ANDW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XAND) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAnd8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (And8 x y) |
| // cond: |
| // result: (ANDW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAndB(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AndB x y) |
| // cond: |
| // result: (ANDW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicAdd32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicAdd32 ptr val mem) |
| // cond: |
| // result: (AddTupleFirst32 (LAA ptr val mem) val) |
| for { |
| ptr := v.Args[0] |
| val := v.Args[1] |
| mem := v.Args[2] |
| v.reset(OpS390XAddTupleFirst32) |
| v0 := b.NewValue0(v.Line, OpS390XLAA, MakeTuple(config.fe.TypeUInt32(), TypeMem)) |
| v0.AddArg(ptr) |
| v0.AddArg(val) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v.AddArg(val) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicAdd64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicAdd64 ptr val mem) |
| // cond: |
| // result: (AddTupleFirst64 (LAAG ptr val mem) val) |
| for { |
| ptr := v.Args[0] |
| val := v.Args[1] |
| mem := v.Args[2] |
| v.reset(OpS390XAddTupleFirst64) |
| v0 := b.NewValue0(v.Line, OpS390XLAAG, MakeTuple(config.fe.TypeUInt64(), TypeMem)) |
| v0.AddArg(ptr) |
| v0.AddArg(val) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v.AddArg(val) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicCompareAndSwap32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicCompareAndSwap32 ptr old new_ mem) |
| // cond: |
| // result: (LoweredAtomicCas32 ptr old new_ mem) |
| for { |
| ptr := v.Args[0] |
| old := v.Args[1] |
| new_ := v.Args[2] |
| mem := v.Args[3] |
| v.reset(OpS390XLoweredAtomicCas32) |
| v.AddArg(ptr) |
| v.AddArg(old) |
| v.AddArg(new_) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicCompareAndSwap64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicCompareAndSwap64 ptr old new_ mem) |
| // cond: |
| // result: (LoweredAtomicCas64 ptr old new_ mem) |
| for { |
| ptr := v.Args[0] |
| old := v.Args[1] |
| new_ := v.Args[2] |
| mem := v.Args[3] |
| v.reset(OpS390XLoweredAtomicCas64) |
| v.AddArg(ptr) |
| v.AddArg(old) |
| v.AddArg(new_) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicExchange32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicExchange32 ptr val mem) |
| // cond: |
| // result: (LoweredAtomicExchange32 ptr val mem) |
| for { |
| ptr := v.Args[0] |
| val := v.Args[1] |
| mem := v.Args[2] |
| v.reset(OpS390XLoweredAtomicExchange32) |
| v.AddArg(ptr) |
| v.AddArg(val) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicExchange64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicExchange64 ptr val mem) |
| // cond: |
| // result: (LoweredAtomicExchange64 ptr val mem) |
| for { |
| ptr := v.Args[0] |
| val := v.Args[1] |
| mem := v.Args[2] |
| v.reset(OpS390XLoweredAtomicExchange64) |
| v.AddArg(ptr) |
| v.AddArg(val) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicLoad32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicLoad32 ptr mem) |
| // cond: |
| // result: (MOVWZatomicload ptr mem) |
| for { |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| v.reset(OpS390XMOVWZatomicload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicLoad64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicLoad64 ptr mem) |
| // cond: |
| // result: (MOVDatomicload ptr mem) |
| for { |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| v.reset(OpS390XMOVDatomicload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicLoadPtr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicLoadPtr ptr mem) |
| // cond: |
| // result: (MOVDatomicload ptr mem) |
| for { |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| v.reset(OpS390XMOVDatomicload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicStore32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicStore32 ptr val mem) |
| // cond: |
| // result: (MOVWatomicstore ptr val mem) |
| for { |
| ptr := v.Args[0] |
| val := v.Args[1] |
| mem := v.Args[2] |
| v.reset(OpS390XMOVWatomicstore) |
| v.AddArg(ptr) |
| v.AddArg(val) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicStore64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicStore64 ptr val mem) |
| // cond: |
| // result: (MOVDatomicstore ptr val mem) |
| for { |
| ptr := v.Args[0] |
| val := v.Args[1] |
| mem := v.Args[2] |
| v.reset(OpS390XMOVDatomicstore) |
| v.AddArg(ptr) |
| v.AddArg(val) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAtomicStorePtrNoWB(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (AtomicStorePtrNoWB ptr val mem) |
| // cond: |
| // result: (MOVDatomicstore ptr val mem) |
| for { |
| ptr := v.Args[0] |
| val := v.Args[1] |
| mem := v.Args[2] |
| v.reset(OpS390XMOVDatomicstore) |
| v.AddArg(ptr) |
| v.AddArg(val) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpAvg64u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Avg64u <t> x y) |
| // cond: |
| // result: (ADD (ADD <t> (SRDconst <t> x [1]) (SRDconst <t> y [1])) (ANDconst <t> (AND <t> x y) [1])) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XADD) |
| v0 := b.NewValue0(v.Line, OpS390XADD, t) |
| v1 := b.NewValue0(v.Line, OpS390XSRDconst, t) |
| v1.AuxInt = 1 |
| v1.AddArg(x) |
| v0.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XSRDconst, t) |
| v2.AuxInt = 1 |
| v2.AddArg(y) |
| v0.AddArg(v2) |
| v.AddArg(v0) |
| v3 := b.NewValue0(v.Line, OpS390XANDconst, t) |
| v3.AuxInt = 1 |
| v4 := b.NewValue0(v.Line, OpS390XAND, t) |
| v4.AddArg(x) |
| v4.AddArg(y) |
| v3.AddArg(v4) |
| v.AddArg(v3) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpBswap32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Bswap32 x) |
| // cond: |
| // result: (MOVWBR x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XMOVWBR) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpBswap64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Bswap64 x) |
| // cond: |
| // result: (MOVDBR x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XMOVDBR) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XCALLclosure) |
| v.AuxInt = argwid |
| v.AddArg(entry) |
| v.AddArg(closure) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCom16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com16 x) |
| // cond: |
| // result: (NOTW x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XNOTW) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCom32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com32 x) |
| // cond: |
| // result: (NOTW x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XNOTW) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCom64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com64 x) |
| // cond: |
| // result: (NOT x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XNOT) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCom8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com8 x) |
| // cond: |
| // result: (NOTW x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XNOTW) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConst16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Const16 [val]) |
| // cond: |
| // result: (MOVDconst [val]) |
| for { |
| val := v.AuxInt |
| v.reset(OpS390XMOVDconst) |
| v.AuxInt = val |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConst32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Const32 [val]) |
| // cond: |
| // result: (MOVDconst [val]) |
| for { |
| val := v.AuxInt |
| v.reset(OpS390XMOVDconst) |
| v.AuxInt = val |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConst32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Const32F [val]) |
| // cond: |
| // result: (FMOVSconst [val]) |
| for { |
| val := v.AuxInt |
| v.reset(OpS390XFMOVSconst) |
| v.AuxInt = val |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConst64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Const64 [val]) |
| // cond: |
| // result: (MOVDconst [val]) |
| for { |
| val := v.AuxInt |
| v.reset(OpS390XMOVDconst) |
| v.AuxInt = val |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConst64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Const64F [val]) |
| // cond: |
| // result: (FMOVDconst [val]) |
| for { |
| val := v.AuxInt |
| v.reset(OpS390XFMOVDconst) |
| v.AuxInt = val |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConst8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Const8 [val]) |
| // cond: |
| // result: (MOVDconst [val]) |
| for { |
| val := v.AuxInt |
| v.reset(OpS390XMOVDconst) |
| v.AuxInt = val |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConstBool(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ConstBool [b]) |
| // cond: |
| // result: (MOVDconst [b]) |
| for { |
| b := v.AuxInt |
| v.reset(OpS390XMOVDconst) |
| v.AuxInt = b |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConstNil(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ConstNil) |
| // cond: |
| // result: (MOVDconst [0]) |
| for { |
| v.reset(OpS390XMOVDconst) |
| v.AuxInt = 0 |
| return true |
| } |
| } |
| func rewriteValueS390X_OpConvert(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Convert <t> x mem) |
| // cond: |
| // result: (MOVDconvert <t> x mem) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| mem := v.Args[1] |
| v.reset(OpS390XMOVDconvert) |
| v.Type = t |
| v.AddArg(x) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCtz32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Ctz32 <t> x) |
| // cond: |
| // result: (SUB (MOVDconst [64]) (FLOGR (MOVWZreg (ANDW <t> (SUBWconst <t> [1] x) (NOTW <t> x))))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| v.reset(OpS390XSUB) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 64 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XFLOGR, config.fe.TypeUInt64()) |
| v2 := b.NewValue0(v.Line, OpS390XMOVWZreg, config.fe.TypeUInt64()) |
| v3 := b.NewValue0(v.Line, OpS390XANDW, t) |
| v4 := b.NewValue0(v.Line, OpS390XSUBWconst, t) |
| v4.AuxInt = 1 |
| v4.AddArg(x) |
| v3.AddArg(v4) |
| v5 := b.NewValue0(v.Line, OpS390XNOTW, t) |
| v5.AddArg(x) |
| v3.AddArg(v5) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCtz64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Ctz64 <t> x) |
| // cond: |
| // result: (SUB (MOVDconst [64]) (FLOGR (AND <t> (SUBconst <t> [1] x) (NOT <t> x)))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| v.reset(OpS390XSUB) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 64 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XFLOGR, config.fe.TypeUInt64()) |
| v2 := b.NewValue0(v.Line, OpS390XAND, t) |
| v3 := b.NewValue0(v.Line, OpS390XSUBconst, t) |
| v3.AuxInt = 1 |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XNOT, t) |
| v4.AddArg(x) |
| v2.AddArg(v4) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt32Fto32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt32Fto32 x) |
| // cond: |
| // result: (CFEBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCFEBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt32Fto64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt32Fto64 x) |
| // cond: |
| // result: (CGEBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCGEBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt32Fto64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt32Fto64F x) |
| // cond: |
| // result: (LDEBR x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XLDEBR) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt32to32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt32to32F x) |
| // cond: |
| // result: (CEFBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCEFBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt32to64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt32to64F x) |
| // cond: |
| // result: (CDFBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCDFBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt64Fto32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt64Fto32 x) |
| // cond: |
| // result: (CFDBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCFDBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt64Fto32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt64Fto32F x) |
| // cond: |
| // result: (LEDBR x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XLEDBR) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt64Fto64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt64Fto64 x) |
| // cond: |
| // result: (CGDBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCGDBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt64to32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt64to32F x) |
| // cond: |
| // result: (CEGBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCEGBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpCvt64to64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Cvt64to64F x) |
| // cond: |
| // result: (CDGBRA x) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XCDGBRA) |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XCALLdefer) |
| v.AuxInt = argwid |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div16 x y) |
| // cond: |
| // result: (DIVW (MOVHreg x) (MOVHreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVW) |
| v0 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv16u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div16u x y) |
| // cond: |
| // result: (DIVWU (MOVHZreg x) (MOVHZreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVWU) |
| v0 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div32 x y) |
| // cond: |
| // result: (DIVW (MOVWreg x) y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVW) |
| v0 := b.NewValue0(v.Line, OpS390XMOVWreg, config.fe.TypeInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XFDIVS) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv32u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div32u x y) |
| // cond: |
| // result: (DIVWU (MOVWZreg x) y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVWU) |
| v0 := b.NewValue0(v.Line, OpS390XMOVWZreg, config.fe.TypeUInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div64 x y) |
| // cond: |
| // result: (DIVD x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVD) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div64F x y) |
| // cond: |
| // result: (FDIV x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XFDIV) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv64u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div64u x y) |
| // cond: |
| // result: (DIVDU x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVDU) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div8 x y) |
| // cond: |
| // result: (DIVW (MOVBreg x) (MOVBreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVW) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpDiv8u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Div8u x y) |
| // cond: |
| // result: (DIVWU (MOVBZreg x) (MOVBZreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XDIVWU) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEq16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq16 x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVHreg x) (MOVHreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEq32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq32 x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMPW x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPW, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEq32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq32F x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMPS, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEq64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq64 x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEq64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq64F x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (FCMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEq8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq8 x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVBreg x) (MOVBreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEqB(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (EqB x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVBreg x) (MOVBreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpEqPtr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (EqPtr x y) |
| // cond: |
| // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDEQ) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq16 x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVHreg x) (MOVHreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq16U x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVHZreg x) (MOVHZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq32 x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPW, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq32F x y) |
| // cond: |
| // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGEnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMPS, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq32U x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq64 x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq64F x y) |
| // cond: |
| // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGEnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq64U x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq8 x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVBreg x) (MOVBreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGeq8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq8U x y) |
| // cond: |
| // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVBZreg x) (MOVBZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGetClosurePtr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (GetClosurePtr) |
| // cond: |
| // result: (LoweredGetClosurePtr) |
| for { |
| v.reset(OpS390XLoweredGetClosurePtr) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGetG(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (GetG mem) |
| // cond: |
| // result: (LoweredGetG mem) |
| for { |
| mem := v.Args[0] |
| v.reset(OpS390XLoweredGetG) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XCALLgo) |
| v.AuxInt = argwid |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater16 x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVHreg x) (MOVHreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater16U x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVHZreg x) (MOVHZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater32 x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPW x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPW, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater32F x y) |
| // cond: |
| // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGTnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMPS, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater32U x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater64 x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater64F x y) |
| // cond: |
| // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGTnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater64U x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater8 x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVBreg x) (MOVBreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpGreater8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater8U x y) |
| // cond: |
| // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVBZreg x) (MOVBZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul16 x y) |
| // cond: |
| // result: (SRDconst [16] (MULLW (MOVHreg x) (MOVHreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XSRDconst) |
| v.AuxInt = 16 |
| v0 := b.NewValue0(v.Line, OpS390XMULLW, config.fe.TypeInt32()) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v1.AddArg(x) |
| v0.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v2.AddArg(y) |
| v0.AddArg(v2) |
| v.AddArg(v0) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul16u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul16u x y) |
| // cond: |
| // result: (SRDconst [16] (MULLW (MOVHZreg x) (MOVHZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XSRDconst) |
| v.AuxInt = 16 |
| v0 := b.NewValue0(v.Line, OpS390XMULLW, config.fe.TypeInt32()) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v1.AddArg(x) |
| v0.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v2.AddArg(y) |
| v0.AddArg(v2) |
| v.AddArg(v0) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul32 x y) |
| // cond: |
| // result: (SRDconst [32] (MULLD (MOVWreg x) (MOVWreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XSRDconst) |
| v.AuxInt = 32 |
| v0 := b.NewValue0(v.Line, OpS390XMULLD, config.fe.TypeInt64()) |
| v1 := b.NewValue0(v.Line, OpS390XMOVWreg, config.fe.TypeInt64()) |
| v1.AddArg(x) |
| v0.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XMOVWreg, config.fe.TypeInt64()) |
| v2.AddArg(y) |
| v0.AddArg(v2) |
| v.AddArg(v0) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul32u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul32u x y) |
| // cond: |
| // result: (SRDconst [32] (MULLD (MOVWZreg x) (MOVWZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XSRDconst) |
| v.AuxInt = 32 |
| v0 := b.NewValue0(v.Line, OpS390XMULLD, config.fe.TypeInt64()) |
| v1 := b.NewValue0(v.Line, OpS390XMOVWZreg, config.fe.TypeUInt64()) |
| v1.AddArg(x) |
| v0.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XMOVWZreg, config.fe.TypeUInt64()) |
| v2.AddArg(y) |
| v0.AddArg(v2) |
| v.AddArg(v0) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul64 x y) |
| // cond: |
| // result: (MULHD x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMULHD) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul64u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul64u x y) |
| // cond: |
| // result: (MULHDU x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMULHDU) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul8 x y) |
| // cond: |
| // result: (SRDconst [8] (MULLW (MOVBreg x) (MOVBreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XSRDconst) |
| v.AuxInt = 8 |
| v0 := b.NewValue0(v.Line, OpS390XMULLW, config.fe.TypeInt32()) |
| v1 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v1.AddArg(x) |
| v0.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v2.AddArg(y) |
| v0.AddArg(v2) |
| v.AddArg(v0) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpHmul8u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Hmul8u x y) |
| // cond: |
| // result: (SRDconst [8] (MULLW (MOVBZreg x) (MOVBZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XSRDconst) |
| v.AuxInt = 8 |
| v0 := b.NewValue0(v.Line, OpS390XMULLW, config.fe.TypeInt32()) |
| v1 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v1.AddArg(x) |
| v0.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v2.AddArg(y) |
| v0.AddArg(v2) |
| v.AddArg(v0) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpITab(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ITab (Load ptr mem)) |
| // cond: |
| // result: (MOVDload ptr mem) |
| for { |
| v_0 := v.Args[0] |
| if v_0.Op != OpLoad { |
| break |
| } |
| ptr := v_0.Args[0] |
| mem := v_0.Args[1] |
| v.reset(OpS390XMOVDload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| return false |
| } |
| func rewriteValueS390X_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(OpS390XCALLinter) |
| v.AuxInt = argwid |
| v.AddArg(entry) |
| v.AddArg(mem) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpIsInBounds(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (IsInBounds idx len) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len)) |
| for { |
| idx := v.Args[0] |
| len := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v2.AddArg(idx) |
| v2.AddArg(len) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpIsNonNil(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (IsNonNil p) |
| // cond: |
| // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPconst p [0])) |
| for { |
| p := v.Args[0] |
| v.reset(OpS390XMOVDNE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPconst, TypeFlags) |
| v2.AuxInt = 0 |
| v2.AddArg(p) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpIsSliceInBounds(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (IsSliceInBounds idx len) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len)) |
| for { |
| idx := v.Args[0] |
| len := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v2.AddArg(idx) |
| v2.AddArg(len) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq16 x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVHreg x) (MOVHreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq16U x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVHZreg x) (MOVHZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq32 x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPW, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq32F x y) |
| // cond: |
| // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS y x)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGEnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMPS, TypeFlags) |
| v2.AddArg(y) |
| v2.AddArg(x) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq32U x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq64 x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq64F x y) |
| // cond: |
| // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP y x)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGEnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMP, TypeFlags) |
| v2.AddArg(y) |
| v2.AddArg(x) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq64U x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq8 x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVBreg x) (MOVBreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLeq8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq8U x y) |
| // cond: |
| // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVBZreg x) (MOVBZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLE) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less16 x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVHreg x) (MOVHreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less16U x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVHZreg x) (MOVHZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less32 x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPW x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPW, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess32F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less32F x y) |
| // cond: |
| // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS y x)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGTnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMPS, TypeFlags) |
| v2.AddArg(y) |
| v2.AddArg(x) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less32U x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less64 x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMP x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less64F x y) |
| // cond: |
| // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP y x)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDGTnoinv) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XFCMP, TypeFlags) |
| v2.AddArg(y) |
| v2.AddArg(x) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less64U x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU x y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v2.AddArg(x) |
| v2.AddArg(y) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less8 x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMP (MOVBreg x) (MOVBreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMP, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLess8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less8U x y) |
| // cond: |
| // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU (MOVBZreg x) (MOVBZreg y))) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMOVDLT) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v0.AuxInt = 0 |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDconst, config.fe.TypeUInt64()) |
| v1.AuxInt = 1 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpS390XCMPU, TypeFlags) |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(x) |
| v2.AddArg(v3) |
| v4 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v4.AddArg(y) |
| v2.AddArg(v4) |
| v.AddArg(v2) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLoad(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // 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(OpS390XMOVDload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| // match: (Load <t> ptr mem) |
| // cond: is32BitInt(t) |
| // result: (MOVWZload ptr mem) |
| for { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(is32BitInt(t)) { |
| break |
| } |
| v.reset(OpS390XMOVWZload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| // match: (Load <t> ptr mem) |
| // cond: is16BitInt(t) |
| // result: (MOVHZload ptr mem) |
| for { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(is16BitInt(t)) { |
| break |
| } |
| v.reset(OpS390XMOVHZload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| // match: (Load <t> ptr mem) |
| // cond: (t.IsBoolean() || is8BitInt(t)) |
| // result: (MOVBZload ptr mem) |
| for { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(t.IsBoolean() || is8BitInt(t)) { |
| break |
| } |
| v.reset(OpS390XMOVBZload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| // match: (Load <t> ptr mem) |
| // cond: is32BitFloat(t) |
| // result: (FMOVSload ptr mem) |
| for { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(is32BitFloat(t)) { |
| break |
| } |
| v.reset(OpS390XFMOVSload) |
| 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(OpS390XFMOVDload) |
| v.AddArg(ptr) |
| v.AddArg(mem) |
| return true |
| } |
| return false |
| } |
| func rewriteValueS390X_OpLrot32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lrot32 <t> x [c]) |
| // cond: |
| // result: (RLLconst <t> [c&31] x) |
| for { |
| t := v.Type |
| c := v.AuxInt |
| x := v.Args[0] |
| v.reset(OpS390XRLLconst) |
| v.Type = t |
| v.AuxInt = c & 31 |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLrot64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lrot64 <t> x [c]) |
| // cond: |
| // result: (RLLGconst <t> [c&63] x) |
| for { |
| t := v.Type |
| c := v.AuxInt |
| x := v.Args[0] |
| v.reset(OpS390XRLLGconst) |
| v.Type = t |
| v.AuxInt = c & 63 |
| v.AddArg(x) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh16x16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh16x16 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst (MOVHZreg y) [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh16x32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh16x32 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst y [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh16x64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh16x64 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPUconst y [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh16x8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh16x8 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst (MOVBZreg y) [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh32x16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh32x16 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst (MOVHZreg y) [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh32x32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh32x32 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst y [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh32x64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh32x64 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPUconst y [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh32x8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh32x8 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst (MOVBZreg y) [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh64x16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh64x16 <t> x y) |
| // cond: |
| // result: (AND (SLD <t> x y) (SUBEcarrymask <t> (CMPWUconst (MOVHZreg y) [63]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XAND) |
| v0 := b.NewValue0(v.Line, OpS390XSLD, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 63 |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh64x32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh64x32 <t> x y) |
| // cond: |
| // result: (AND (SLD <t> x y) (SUBEcarrymask <t> (CMPWUconst y [63]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XAND) |
| v0 := b.NewValue0(v.Line, OpS390XSLD, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 63 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh64x64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh64x64 <t> x y) |
| // cond: |
| // result: (AND (SLD <t> x y) (SUBEcarrymask <t> (CMPUconst y [63]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XAND) |
| v0 := b.NewValue0(v.Line, OpS390XSLD, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPUconst, TypeFlags) |
| v2.AuxInt = 63 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh64x8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh64x8 <t> x y) |
| // cond: |
| // result: (AND (SLD <t> x y) (SUBEcarrymask <t> (CMPWUconst (MOVBZreg y) [63]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XAND) |
| v0 := b.NewValue0(v.Line, OpS390XSLD, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 63 |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh8x16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh8x16 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst (MOVHZreg y) [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v3 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh8x32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh8x32 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst y [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh8x64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh8x64 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPUconst y [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v2.AddArg(y) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpLsh8x8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Lsh8x8 <t> x y) |
| // cond: |
| // result: (ANDW (SLW <t> x y) (SUBEWcarrymask <t> (CMPWUconst (MOVBZreg y) [31]))) |
| for { |
| t := v.Type |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XANDW) |
| v0 := b.NewValue0(v.Line, OpS390XSLW, t) |
| v0.AddArg(x) |
| v0.AddArg(y) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XSUBEWcarrymask, t) |
| v2 := b.NewValue0(v.Line, OpS390XCMPWUconst, TypeFlags) |
| v2.AuxInt = 31 |
| v3 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v3.AddArg(y) |
| v2.AddArg(v3) |
| v1.AddArg(v2) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod16 x y) |
| // cond: |
| // result: (MODW (MOVHreg x) (MOVHreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODW) |
| v0 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod16u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod16u x y) |
| // cond: |
| // result: (MODWU (MOVHZreg x) (MOVHZreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODWU) |
| v0 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHZreg, config.fe.TypeUInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod32 x y) |
| // cond: |
| // result: (MODW (MOVWreg x) y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODW) |
| v0 := b.NewValue0(v.Line, OpS390XMOVWreg, config.fe.TypeInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod32u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod32u x y) |
| // cond: |
| // result: (MODWU (MOVWZreg x) y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODWU) |
| v0 := b.NewValue0(v.Line, OpS390XMOVWZreg, config.fe.TypeUInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod64 x y) |
| // cond: |
| // result: (MODD x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODD) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod64u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod64u x y) |
| // cond: |
| // result: (MODDU x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODDU) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod8 x y) |
| // cond: |
| // result: (MODW (MOVBreg x) (MOVBreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODW) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVBreg, config.fe.TypeInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMod8u(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mod8u x y) |
| // cond: |
| // result: (MODWU (MOVBZreg x) (MOVBZreg y)) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMODWU) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v0.AddArg(x) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVBZreg, config.fe.TypeUInt64()) |
| v1.AddArg(y) |
| v.AddArg(v1) |
| return true |
| } |
| } |
| func rewriteValueS390X_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 (MOVBZload 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(OpS390XMOVBstore) |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBZload, config.fe.TypeUInt8()) |
| 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 (MOVHZload 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(OpS390XMOVHstore) |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVHZload, config.fe.TypeUInt16()) |
| 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 (MOVWZload 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(OpS390XMOVWstore) |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVWZload, config.fe.TypeUInt32()) |
| 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(OpS390XMOVDstore) |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDload, config.fe.TypeUInt64()) |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v.AddArg(mem) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() == 16 |
| // result: (MOVDstore [8] dst (MOVDload [8] src mem) (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() == 16) { |
| break |
| } |
| v.reset(OpS390XMOVDstore) |
| v.AuxInt = 8 |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDload, config.fe.TypeUInt64()) |
| v0.AuxInt = 8 |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDstore, TypeMem) |
| v1.AddArg(dst) |
| v2 := b.NewValue0(v.Line, OpS390XMOVDload, config.fe.TypeUInt64()) |
| v2.AddArg(src) |
| v2.AddArg(mem) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() == 24 |
| // result: (MOVDstore [16] dst (MOVDload [16] src mem) (MOVDstore [8] dst (MOVDload [8] src mem) (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() == 24) { |
| break |
| } |
| v.reset(OpS390XMOVDstore) |
| v.AuxInt = 16 |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVDload, config.fe.TypeUInt64()) |
| v0.AuxInt = 16 |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVDstore, TypeMem) |
| v1.AuxInt = 8 |
| v1.AddArg(dst) |
| v2 := b.NewValue0(v.Line, OpS390XMOVDload, config.fe.TypeUInt64()) |
| v2.AuxInt = 8 |
| v2.AddArg(src) |
| v2.AddArg(mem) |
| v1.AddArg(v2) |
| v3 := b.NewValue0(v.Line, OpS390XMOVDstore, TypeMem) |
| v3.AddArg(dst) |
| v4 := b.NewValue0(v.Line, OpS390XMOVDload, config.fe.TypeUInt64()) |
| v4.AddArg(src) |
| v4.AddArg(mem) |
| v3.AddArg(v4) |
| v3.AddArg(mem) |
| v1.AddArg(v3) |
| v.AddArg(v1) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() == 3 |
| // result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHZload src mem) mem)) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() == 3) { |
| break |
| } |
| v.reset(OpS390XMOVBstore) |
| v.AuxInt = 2 |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBZload, config.fe.TypeUInt8()) |
| v0.AuxInt = 2 |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHstore, TypeMem) |
| v1.AddArg(dst) |
| v2 := b.NewValue0(v.Line, OpS390XMOVHZload, config.fe.TypeUInt16()) |
| v2.AddArg(src) |
| v2.AddArg(mem) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() == 5 |
| // result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() == 5) { |
| break |
| } |
| v.reset(OpS390XMOVBstore) |
| v.AuxInt = 4 |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBZload, config.fe.TypeUInt8()) |
| v0.AuxInt = 4 |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVWstore, TypeMem) |
| v1.AddArg(dst) |
| v2 := b.NewValue0(v.Line, OpS390XMOVWZload, config.fe.TypeUInt32()) |
| v2.AddArg(src) |
| v2.AddArg(mem) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() == 6 |
| // result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() == 6) { |
| break |
| } |
| v.reset(OpS390XMOVHstore) |
| v.AuxInt = 4 |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVHZload, config.fe.TypeUInt16()) |
| v0.AuxInt = 4 |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVWstore, TypeMem) |
| v1.AddArg(dst) |
| v2 := b.NewValue0(v.Line, OpS390XMOVWZload, config.fe.TypeUInt32()) |
| v2.AddArg(src) |
| v2.AddArg(mem) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() == 7 |
| // result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() == 7) { |
| break |
| } |
| v.reset(OpS390XMOVBstore) |
| v.AuxInt = 6 |
| v.AddArg(dst) |
| v0 := b.NewValue0(v.Line, OpS390XMOVBZload, config.fe.TypeUInt8()) |
| v0.AuxInt = 6 |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpS390XMOVHstore, TypeMem) |
| v1.AuxInt = 4 |
| v1.AddArg(dst) |
| v2 := b.NewValue0(v.Line, OpS390XMOVHZload, config.fe.TypeUInt16()) |
| v2.AuxInt = 4 |
| v2.AddArg(src) |
| v2.AddArg(mem) |
| v1.AddArg(v2) |
| v3 := b.NewValue0(v.Line, OpS390XMOVWstore, TypeMem) |
| v3.AddArg(dst) |
| v4 := b.NewValue0(v.Line, OpS390XMOVWZload, config.fe.TypeUInt32()) |
| v4.AddArg(src) |
| v4.AddArg(mem) |
| v3.AddArg(v4) |
| v3.AddArg(mem) |
| v1.AddArg(v3) |
| v.AddArg(v1) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() > 0 && SizeAndAlign(s).Size() <= 256 |
| // result: (MVC [makeValAndOff(SizeAndAlign(s).Size(), 0)] dst src mem) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() > 0 && SizeAndAlign(s).Size() <= 256) { |
| break |
| } |
| v.reset(OpS390XMVC) |
| v.AuxInt = makeValAndOff(SizeAndAlign(s).Size(), 0) |
| v.AddArg(dst) |
| v.AddArg(src) |
| v.AddArg(mem) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() > 256 && SizeAndAlign(s).Size() <= 512 |
| // result: (MVC [makeValAndOff(SizeAndAlign(s).Size()-256, 256)] dst src (MVC [makeValAndOff(256, 0)] dst src mem)) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() > 256 && SizeAndAlign(s).Size() <= 512) { |
| break |
| } |
| v.reset(OpS390XMVC) |
| v.AuxInt = makeValAndOff(SizeAndAlign(s).Size()-256, 256) |
| v.AddArg(dst) |
| v.AddArg(src) |
| v0 := b.NewValue0(v.Line, OpS390XMVC, TypeMem) |
| v0.AuxInt = makeValAndOff(256, 0) |
| v0.AddArg(dst) |
| v0.AddArg(src) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() > 512 && SizeAndAlign(s).Size() <= 768 |
| // result: (MVC [makeValAndOff(SizeAndAlign(s).Size()-512, 512)] dst src (MVC [makeValAndOff(256, 256)] dst src (MVC [makeValAndOff(256, 0)] dst src mem))) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() > 512 && SizeAndAlign(s).Size() <= 768) { |
| break |
| } |
| v.reset(OpS390XMVC) |
| v.AuxInt = makeValAndOff(SizeAndAlign(s).Size()-512, 512) |
| v.AddArg(dst) |
| v.AddArg(src) |
| v0 := b.NewValue0(v.Line, OpS390XMVC, TypeMem) |
| v0.AuxInt = makeValAndOff(256, 256) |
| v0.AddArg(dst) |
| v0.AddArg(src) |
| v1 := b.NewValue0(v.Line, OpS390XMVC, TypeMem) |
| v1.AuxInt = makeValAndOff(256, 0) |
| v1.AddArg(dst) |
| v1.AddArg(src) |
| v1.AddArg(mem) |
| v0.AddArg(v1) |
| v.AddArg(v0) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() > 768 && SizeAndAlign(s).Size() <= 1024 |
| // result: (MVC [makeValAndOff(SizeAndAlign(s).Size()-768, 768)] dst src (MVC [makeValAndOff(256, 512)] dst src (MVC [makeValAndOff(256, 256)] dst src (MVC [makeValAndOff(256, 0)] dst src mem)))) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() > 768 && SizeAndAlign(s).Size() <= 1024) { |
| break |
| } |
| v.reset(OpS390XMVC) |
| v.AuxInt = makeValAndOff(SizeAndAlign(s).Size()-768, 768) |
| v.AddArg(dst) |
| v.AddArg(src) |
| v0 := b.NewValue0(v.Line, OpS390XMVC, TypeMem) |
| v0.AuxInt = makeValAndOff(256, 512) |
| v0.AddArg(dst) |
| v0.AddArg(src) |
| v1 := b.NewValue0(v.Line, OpS390XMVC, TypeMem) |
| v1.AuxInt = makeValAndOff(256, 256) |
| v1.AddArg(dst) |
| v1.AddArg(src) |
| v2 := b.NewValue0(v.Line, OpS390XMVC, TypeMem) |
| v2.AuxInt = makeValAndOff(256, 0) |
| v2.AddArg(dst) |
| v2.AddArg(src) |
| v2.AddArg(mem) |
| v1.AddArg(v2) |
| v0.AddArg(v1) |
| v.AddArg(v0) |
| return true |
| } |
| // match: (Move [s] dst src mem) |
| // cond: SizeAndAlign(s).Size() > 1024 |
| // result: (LoweredMove [SizeAndAlign(s).Size()%256] dst src (ADDconst <src.Type> src [(SizeAndAlign(s).Size()/256)*256]) mem) |
| for { |
| s := v.AuxInt |
| dst := v.Args[0] |
| src := v.Args[1] |
| mem := v.Args[2] |
| if !(SizeAndAlign(s).Size() > 1024) { |
| break |
| } |
| v.reset(OpS390XLoweredMove) |
| v.AuxInt = SizeAndAlign(s).Size() % 256 |
| v.AddArg(dst) |
| v.AddArg(src) |
| v0 := b.NewValue0(v.Line, OpS390XADDconst, src.Type) |
| v0.AuxInt = (SizeAndAlign(s).Size() / 256) * 256 |
| v0.AddArg(src) |
| v.AddArg(v0) |
| v.AddArg(mem) |
| return true |
| } |
| return false |
| } |
| func rewriteValueS390X_OpMul16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul16 x y) |
| // cond: |
| // result: (MULLW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMULLW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMul32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul32 x y) |
| // cond: |
| // result: (MULLW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMULLW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_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(OpS390XFMULS) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMul64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul64 x y) |
| // cond: |
| // result: (MULLD x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMULLD) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMul64F(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul64F x y) |
| // cond: |
| // result: (FMUL x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XFMUL) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpMul8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul8 x y) |
| // cond: |
| // result: (MULLW x y) |
| for { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.reset(OpS390XMULLW) |
| v.AddArg(x) |
| v.AddArg(y) |
| return true |
| } |
| } |
| func rewriteValueS390X_OpNeg16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Neg16 x) |
| // cond: |
| // result: (NEGW (MOVHreg x)) |
| for { |
| x := v.Args[0] |
| v.reset(OpS390XNEGW) |
| v0 := b.NewValue0(v.Line, OpS390XMOVHreg, config.fe.TypeInt64()) |
| |