// Code generated by 'instgen -o=$GOROOT # from go install golang.org/x/arch/arm64/instgen@latest'. package arm64 const ( enc_NIL component = iota enc_tszh_tszl enc_M enc_PNd enc_Pd enc_Pdm enc_Pdn enc_Pg enc_Pm enc_Pn enc_Pv enc_Vd enc_Za enc_Zd enc_Zda enc_Zdn enc_Zk enc_Zm enc_Zn enc_size enc_size0 enc_sz ) // encodeArngBCheck is the implementation of the following encoding logic: // Check this is a B arrangement func encodeArngBCheck(v uint32) (uint32, bool) { if v == ARNG_B { return 0, true } return 0, false } // encodeArngDCheck is the implementation of the following encoding logic: // Check this is a D arrangement func encodeArngDCheck(v uint32) (uint32, bool) { if v == ARNG_D { return 0, true } return 0, false } // encodeArngHCheck is the implementation of the following encoding logic: // Check this is a H arrangement func encodeArngHCheck(v uint32) (uint32, bool) { if v == ARNG_H { return 0, true } return 0, false } // encodeArngQCheck is the implementation of the following encoding logic: // Check this is a Q arrangement func encodeArngQCheck(v uint32) (uint32, bool) { if v == ARNG_Q { return 0, true } return 0, false } // encodeArngSCheck is the implementation of the following encoding logic: // Check this is a S arrangement func encodeArngSCheck(v uint32) (uint32, bool) { if v == ARNG_S { return 0, true } return 0, false } // encodeMergePredCheck is the implementation of the following encoding logic: // Check this is a merging predication func encodeMergePredCheck(v uint32) (uint32, bool) { if v == PRED_M { return 0, true } return 0, false } // encodeZeroPredCheck is the implementation of the following encoding logic: // Check this is a zeroing predication func encodeZeroPredCheck(v uint32) (uint32, bool) { if v == PRED_Z { return 0, true } return 0, false } // encodeSzByteHalfword is the implementation of the following encoding logic: // For the "Byte and halfword" variant: is the size specifier, // sz // 0 B // 1 H // bit range mappings: // sz: [22:23) func encodeSzByteHalfword(v uint32) (uint32, bool) { switch v { case ARNG_B: return 0, true case ARNG_H: return 1 << 22, true } return 0, false } // encodeSizeByteMergeZero is the implementation of the following encoding logic: // For the "Byte, merging" and "Byte, zeroing" variants: is the size specifier, // size // 00 RESERVED // 01 H // 10 S // 11 D // bit range mappings: // size: [22:24) func encodeSizeByteMergeZero(v uint32) (uint32, bool) { switch v { case ARNG_H: return 1 << 22, true case ARNG_S: return 2 << 22, true case ARNG_D: return 3 << 22, true } return 0, false } // encodeSize0HalfwordMergeZero is the implementation of the following encoding logic: // For the "Halfword, merging" and "Halfword, zeroing" variants: is the size specifier, // size[0] // 0 S // 1 D // bit range mappings: // size: [22:23) func encodeSize0HalfwordMergeZero(v uint32) (uint32, bool) { switch v { case ARNG_S: return 0, true case ARNG_D: return 1 << 22, true } return 0, false } // encodeSzWordDoubleword is the implementation of the following encoding logic: // For the "Word and doubleword" variant: is the size specifier, // sz // 0 S // 1 D // bit range mappings: // sz: [22:23) func encodeSzWordDoubleword(v uint32) (uint32, bool) { switch v { case ARNG_S: return 0, true case ARNG_D: return 1 << 22, true } return 0, false } // encodeSize16B8H4S2D is the implementation of the following encoding logic: // Is an arrangement specifier, // size // 00 16B // 01 8H // 10 4S // 11 2D // bit range mappings: // size: [22:24) func encodeSize16B8H4S2D(v uint32) (uint32, bool) { switch v { case ARNG_16B: return 0, true case ARNG_8H: return 1 << 22, true case ARNG_4S: return 2 << 22, true case ARNG_2D: return 3 << 22, true } return 0, false } // encodeSize8H4S2D is the implementation of the following encoding logic: // Is an arrangement specifier, // size // 00 RESERVED // 01 8H // 10 4S // 11 2D // bit range mappings: // size: [22:24) func encodeSize8H4S2D(v uint32) (uint32, bool) { switch v { case ARNG_8H: return 1 << 22, true case ARNG_4S: return 2 << 22, true case ARNG_2D: return 3 << 22, true } return 0, false } // encodeVd is the implementation of the following encoding logic: // Is the name of the destination SIMD&FP register, encoded in the "Vd" field. // bit range mappings: // Vd: [0:5) func encodeVd(v uint32) (uint32, bool) { return v, true } // encodePNd is the implementation of the following encoding logic: // Is the name of the destination scalable predicate register PN8-PN15, with predicate-as-counter encoding, encoded in the "PNd" field. // bit range mappings: // PNd: [0:3) func encodePNd(v uint32) (uint32, bool) { if v >= 24 && v <= 31 { // PN registers starts from 16. return v - 24, true } return 0, false } // encodePd is the implementation of the following encoding logic: // Is the name of the destination scalable predicate register, encoded in the "Pd" field. // bit range mappings: // Pd: [0:4) func encodePd(v uint32) (uint32, bool) { return v, true } // encodeZd is the implementation of the following encoding logic: // Is the name of the destination scalable vector register, encoded in the "Zd" field. // bit range mappings: // Zd: [0:5) func encodeZd(v uint32) (uint32, bool) { return v, true } // encodePdnDest is the implementation of the following encoding logic: // Is the name of the first source and destination scalable predicate register, encoded in the "Pdn" field. // bit range mappings: // Pdn: [0:4) func encodePdnDest(v uint32) (uint32, bool) { return v, true } // encodeZdnDest is the implementation of the following encoding logic: // Is the name of the first source and destination scalable vector register, encoded in the "Zdn" field. // bit range mappings: // Zdn: [0:5) func encodeZdnDest(v uint32) (uint32, bool) { return v, true } // encodePn59 is the implementation of the following encoding logic: // Is the name of the first source scalable predicate register, encoded in the "Pn" field. // bit range mappings: // Pn: [5:9) func encodePn59(v uint32) (uint32, bool) { return v << 5, true } // encodeZn510 is the implementation of the following encoding logic: // Is the name of the first source scalable vector register, encoded in the "Zn" field. // bit range mappings: // Zn: [5:10) func encodeZn510(v uint32) (uint32, bool) { return v << 5, true } // encodePg1013 is the implementation of the following encoding logic: // Is the name of the governing scalable predicate register P0-P7, encoded in the "Pg" field. // bit range mappings: // Pg: [10:13) func encodePg1013(v uint32) (uint32, bool) { if v <= 7 { return v << 10, true } return 0, false } // encodePg1014 is the implementation of the following encoding logic: // Is the name of the governing scalable predicate register, encoded in the "Pg" field. // bit range mappings: // Pg: [10:14) func encodePg1014(v uint32) (uint32, bool) { return v << 10, true } // encodePg59 is the implementation of the following encoding logic: // Is the name of the governing scalable predicate register, encoded in the "Pg" field. // bit range mappings: // Pg: [5:9) func encodePg59(v uint32) (uint32, bool) { return v << 5, true } // encodePdmDest is the implementation of the following encoding logic: // Is the name of the second source and destination scalable predicate register, encoded in the "Pdm" field. // bit range mappings: // Pdm: [0:4) func encodePdmDest(v uint32) (uint32, bool) { return v, true } // encodeZdaDest is the implementation of the following encoding logic: // Is the name of the second source and destination scalable vector register, encoded in the "Zda" field. // bit range mappings: // Zda: [0:5) func encodeZdaDest(v uint32) (uint32, bool) { return v, true } // encodePm1620 is the implementation of the following encoding logic: // Is the name of the second source scalable predicate register, encoded in the "Pm" field. // bit range mappings: // Pm: [16:20) func encodePm1620(v uint32) (uint32, bool) { return v << 16, true } // encodeZm1621 is the implementation of the following encoding logic: // Is the name of the second source scalable vector register, encoded in the "Zm" field. // bit range mappings: // Zm: [16:21) func encodeZm1621(v uint32) (uint32, bool) { return v << 16, true } // encodeZm510 is the implementation of the following encoding logic: // Is the name of the second source scalable vector register, encoded in the "Zm" field. // bit range mappings: // Zm: [5:10) func encodeZm510(v uint32) (uint32, bool) { return v << 5, true } // encodePdnSrcDst is the implementation of the following encoding logic: // Is the name of the source and destination scalable predicate register, encoded in the "Pdn" field. // bit range mappings: // Pdn: [0:4) func encodePdnSrcDst(v uint32) (uint32, bool) { return v, true } // encodeZdnSrcDst is the implementation of the following encoding logic: // Is the name of the source and destination scalable vector register, encoded in the "Zdn" field. // bit range mappings: // Zdn: [0:5) func encodeZdnSrcDst(v uint32) (uint32, bool) { return v, true } // encodePm59v1 is the implementation of the following encoding logic: // Is the name of the source scalable predicate register, encoded in the "Pm" field. // bit range mappings: // Pm: [5:9) func encodePm59v1(v uint32) (uint32, bool) { return v << 5, true } // encodePn59v2 is the implementation of the following encoding logic: // Is the name of the source scalable predicate register, encoded in the "Pn" field. // bit range mappings: // Pn: [5:9) func encodePn59v2(v uint32) (uint32, bool) { return v << 5, true } // encodeZn510Src is the implementation of the following encoding logic: // Is the name of the source scalable vector register, encoded in the "Zn" field. // bit range mappings: // Zn: [5:10) func encodeZn510Src(v uint32) (uint32, bool) { return v << 5, true } // encodeZda3RdSrcDst is the implementation of the following encoding logic: // Is the name of the third source and destination scalable vector register, encoded in the "Zda" field. // bit range mappings: // Zda: [0:5) func encodeZda3RdSrcDst(v uint32) (uint32, bool) { return v, true } // encodeZa16213Rd is the implementation of the following encoding logic: // Is the name of the third source scalable vector register, encoded in the "Za" field. // bit range mappings: // Za: [16:21) func encodeZa16213Rd(v uint32) (uint32, bool) { return v << 16, true } // encodeZa5103Rd is the implementation of the following encoding logic: // Is the name of the third source scalable vector register, encoded in the "Za" field. // bit range mappings: // Za: [5:10) func encodeZa5103Rd(v uint32) (uint32, bool) { return v << 5, true } // encodeZk5103Rd is the implementation of the following encoding logic: // Is the name of the third source scalable vector register, encoded in the "Zk" field. // bit range mappings: // Zk: [5:10) func encodeZk5103Rd(v uint32) (uint32, bool) { return v << 5, true } // encodePv1013 is the implementation of the following encoding logic: // Is the name of the vector select predicate register P0-P7, encoded in the "Pv" field. // bit range mappings: // Pv: [10:13) func encodePv1013(v uint32) (uint32, bool) { return v << 10, true } // encodePv1014 is the implementation of the following encoding logic: // Is the name of the vector select predicate register, encoded in the "Pv" field. // bit range mappings: // Pv: [10:14) func encodePv1014(v uint32) (uint32, bool) { return v << 10, true } // encodePv59 is the implementation of the following encoding logic: // Is the name of the vector select predicate register, encoded in the "Pv" field. // bit range mappings: // Pv: [5:9) func encodePv59(v uint32) (uint32, bool) { return v << 5, true } // encodePredQualM1617 is the implementation of the following encoding logic: // Is the predication qualifier, // M // 0 Z // 1 M // bit range mappings: // M: [16:17) func encodePredQualM1617(v uint32) (uint32, bool) { switch v { case PRED_Z: return 0, true case PRED_M: return 1 << 16, true } return 0, false } // encodePredQualM45 is the implementation of the following encoding logic: // Is the predication qualifier, // M // 0 Z // 1 M // bit range mappings: // M: [4:5) func encodePredQualM45(v uint32) (uint32, bool) { switch v { case PRED_Z: return 0, true case PRED_M: return 1 << 4, true } return 0, false } // encodeSizeBHSD2224 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 B // 01 H // 10 S // 11 D // bit range mappings: // size: [22:24) func encodeSizeBHSD2224(v uint32) (uint32, bool) { switch v { case ARNG_B: return 0 << 22, true case ARNG_H: return 1 << 22, true case ARNG_S: return 2 << 22, true case ARNG_D: return 3 << 22, true } return 0, false } // encodeSizeBHS2224 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 B // 01 H // 10 S // 11 RESERVED // bit range mappings: // size: [22:24) func encodeSizeBHS2224(v uint32) (uint32, bool) { switch v { case ARNG_B: return 0 << 22, true case ARNG_H: return 1 << 22, true case ARNG_S: return 2 << 22, true } return 0, false } // encodeSizeBHS2224Offset1 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 RESERVED // 01 B // 10 H // 11 S // bit range mappings: // size: [22:24) func encodeSizeBHS2224Offset1(v uint32) (uint32, bool) { switch v { case ARNG_B: return 1 << 22, true case ARNG_H: return 2 << 22, true case ARNG_S: return 3 << 22, true } return 0, false } // encodeSizeHSD1315 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 RESERVED // 01 H // 10 S // 11 D // bit range mappings: // size: [13:15) func encodeSizeHSD1315(v uint32) (uint32, bool) { switch v { case ARNG_H: return 1 << 13, true case ARNG_S: return 2 << 13, true case ARNG_D: return 3 << 13, true } return 0, false } // encodeSizeHSD1719 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 RESERVED // 01 H // 10 S // 11 D // bit range mappings: // size: [17:19) func encodeSizeHSD1719(v uint32) (uint32, bool) { switch v { case ARNG_H: return 1 << 17, true case ARNG_S: return 2 << 17, true case ARNG_D: return 3 << 17, true } return 0, false } // encodeSizeHSD2224 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 RESERVED // 01 H // 10 S // 11 D // bit range mappings: // size: [22:24) func encodeSizeHSD2224(v uint32) (uint32, bool) { switch v { case ARNG_H: return 1 << 22, true case ARNG_S: return 2 << 22, true case ARNG_D: return 3 << 22, true } return 0, false } // encodeSizeHSD2224No00 is the implementation of the following encoding logic: // Is the size specifier, // size // 01 H // 10 S // 11 D // bit range mappings: // size: [22:24) func encodeSizeHSD2224No00(v uint32) (uint32, bool) { switch v { case ARNG_H: return 1 << 22, true case ARNG_S: return 2 << 22, true case ARNG_D: return 3 << 22, true } return 0, false } // encodeSizeHD2224 is the implementation of the following encoding logic: // Is the size specifier, // size // 01 H // 1x D // bit range mappings: // size: [22:24) func encodeSizeHD2224(v uint32) (uint32, bool) { switch v { case ARNG_H: return 1 << 22, true case ARNG_D: return 3 << 22, true } return 0, false } // encodeSizeTbBHSD2224 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 B // 01 H // 10 S // 11 D // bit range mappings: // size: [22:24) func encodeSizeTbBHSD2224(v uint32) (uint32, bool) { switch v { case ARNG_B: return 0 << 22, true case ARNG_H: return 1 << 22, true case ARNG_S: return 2 << 22, true case ARNG_D: return 3 << 22, true } return 0, false } // encodeSizeTbBHS2224 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 RESERVED // 01 B // 10 H // 11 S // bit range mappings: // size: [22:24) func encodeSizeTbBHS2224(v uint32) (uint32, bool) { switch v { case ARNG_B: return 1 << 22, true case ARNG_H: return 2 << 22, true case ARNG_S: return 3 << 22, true } return 0, false } // encodeSizeTbHSD2224Offset1 is the implementation of the following encoding logic: // Is the size specifier, // size // 00 RESERVED // 01 H // 10 S // 11 D // bit range mappings: // size: [22:24) func encodeSizeTbHSD2224Offset1(v uint32) (uint32, bool) { switch v { case ARNG_H: return 1 << 22, true case ARNG_S: return 2 << 22, true case ARNG_D: return 3 << 22, true } return 0, false } // encodeSizeTbBS2224 is the implementation of the following encoding logic: // Is the size specifier, // size // 01 B // 1x S // bit range mappings: // size: [22:24) func encodeSizeTbBS2224(v uint32) (uint32, bool) { switch v { case ARNG_B: return 1 << 22, true case ARNG_S: return 3 << 22, true } return 0, false } // encodeSize0BH2223 is the implementation of the following encoding logic: // Is the size specifier, // size[0] // 0 B // 1 H // bit range mappings: // size: [22:23) func encodeSize0BH2223(v uint32) (uint32, bool) { switch v { case ARNG_B: return 0 << 22, true case ARNG_H: return 1 << 22, true } return 0, false } // encodeSize0SD2223 is the implementation of the following encoding logic: // Is the size specifier, // size[0] // 0 S // 1 D // bit range mappings: // size: [22:23) func encodeSize0SD2223(v uint32) (uint32, bool) { switch v { case ARNG_S: return 0 << 22, true case ARNG_D: return 1 << 22, true } return 0, false } // encodeSize0TbBH2223 is the implementation of the following encoding logic: // Is the size specifier, // size[0] // 0 B // 1 H // bit range mappings: // size: [22:23) func encodeSize0TbBH2223(v uint32) (uint32, bool) { switch v { case ARNG_B: return 0 << 22, true case ARNG_H: return 1 << 22, true } return 0, false } // encodeSzSD1415 is the implementation of the following encoding logic: // Is the size specifier, // sz // 0 S // 1 D // bit range mappings: // sz: [14:15) func encodeSzSD1415(v uint32) (uint32, bool) { switch v { case ARNG_S: return 0 << 14, true case ARNG_D: return 1 << 14, true } return 0, false } // encodeSzSD1718 is the implementation of the following encoding logic: // Is the size specifier, // sz // 0 S // 1 D // bit range mappings: // sz: [17:18) func encodeSzSD1718(v uint32) (uint32, bool) { switch v { case ARNG_S: return 0 << 17, true case ARNG_D: return 1 << 17, true } return 0, false } // encodeSzSD2223 is the implementation of the following encoding logic: // Is the size specifier, // sz // 0 S // 1 D // bit range mappings: // sz: [22:23) func encodeSzSD2223(v uint32) (uint32, bool) { switch v { case ARNG_S: return 0 << 22, true case ARNG_D: return 1 << 22, true } return 0, false } // encodeTszhTszlBHS is the implementation of the following encoding logic: // Is the size specifier, // tszh tszl // 0 00 RESERVED // 0 01 B // 0 10 H // 0 11 RESERVED // 1 00 S // 1 01 RESERVED // 1 1x RESERVED // bit range mappings: // tszh: [22:23) // tszl: [19:21) func encodeTszhTszlBHS(v uint32) (uint32, bool) { switch v { case ARNG_B: return 0<<22 | 1<<19, true case ARNG_H: return 0<<22 | 2<<19, true case ARNG_S: return 1 << 22, true } return 0, false } // encodeTszhTszlTbHSD is the implementation of the following encoding logic: // Is the size specifier, // tszh tszl // 0 00 RESERVED // 0 01 H // 0 10 S // 0 11 RESERVED // 1 00 D // 1 01 RESERVED // 1 1x RESERVED // bit range mappings: // tszh: [22:23) // tszl: [19:21) func encodeTszhTszlTbHSD(v uint32) (uint32, bool) { switch v { case ARNG_H: return 0<<22 | 1<<19, true case ARNG_S: return 0<<22 | 2<<19, true case ARNG_D: return 1 << 22, true } return 0, false } // encodeNoop is the implementation of the following encoding logic: // No-op check, returns true func encodeNoop(v uint32) (uint32, bool) { return 0, true }