Skip to content

Commit

Permalink
not use VREPIF #19
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Oct 17, 2024
1 parent f66a91e commit ff84ed0
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions base64_s390x.s
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,22 @@ DATA base64_const<>+0x00(SB)/8, $0x0f0e0d0c0b0a0908 // enccoding, byte order
DATA base64_const<>+0x08(SB)/8, $0x0706050403020100
DATA base64_const<>+0x10(SB)/8, $0x0a0b090a07080607 // enccoding, reshufling
DATA base64_const<>+0x18(SB)/8, $0x0405030401020001
DATA base64_const<>+0x20(SB)/8, $0x1010010204080408 // STD LUT HI
DATA base64_const<>+0x28(SB)/8, $0x1010101010101010
DATA base64_const<>+0x30(SB)/8, $0x1511111111111111 // STD LUT LO
DATA base64_const<>+0x38(SB)/8, $0x1111131A1B1B1B1A
DATA base64_const<>+0x40(SB)/8, $0x00101304BFBFB9B9 // STD LUT ROLL
DATA base64_const<>+0x48(SB)/8, $0x0000000000000000
DATA base64_const<>+0x50(SB)/8, $0x1010010204080428 // URL LUT HI
DATA base64_const<>+0x58(SB)/8, $0x1010101010101010
DATA base64_const<>+0x60(SB)/8, $0x1511111111111111 // URL LUT LO
DATA base64_const<>+0x68(SB)/8, $0x1111131B1B1A1B33
DATA base64_const<>+0x70(SB)/8, $0x00001104BFBFE0B9 // URL LUT ROLL
DATA base64_const<>+0x78(SB)/8, $0xB900000000000000
DATA base64_const<>+0x80(SB)/8, $0x010203050607090a // RESHUFFLE MASK
DATA base64_const<>+0x88(SB)/8, $0x0b0d0e0f00000000
GLOBL base64_const<>(SB), (NOPTR+RODATA), $144
DATA base64_const<>+0x20(SB)/8, $0x0fc0fc000fc0fc00 // mulhi mask
DATA base64_const<>+0x28(SB)/8, $0x0fc0fc000fc0fc00
DATA base64_const<>+0x30(SB)/8, $0x0400004004000040 // mulhi const
DATA base64_const<>+0x38(SB)/8, $0x0400004004000040
DATA base64_const<>+0x40(SB)/8, $0x003F03F0003F03F0 // mullo mask
DATA base64_const<>+0x48(SB)/8, $0x003F03F0003F03F0
DATA base64_const<>+0x50(SB)/8, $0x0100001001000010 // mullo const
DATA base64_const<>+0x58(SB)/8, $0x0100001001000010
GLOBL base64_const<>(SB), (NOPTR+RODATA), $96

#define REV_BYTES V0
#define RESHUFFLE_MASK V1
#define MULHI_CONST V2
#define MULHI_MASK V3
#define MULLO_CONST V4
#define MULLO_MASK V5
#define MULHI_MASK V2
#define MULHI_CONST V3
#define MULLO_MASK V4
#define MULLO_CONST V5
#define RANGE1_END V6
#define RANGE0_END V7
#define LUT V8
Expand All @@ -50,11 +44,7 @@ TEXT ·encodeAsm(SB),NOSPLIT,$0
VL (R4), LUT

MOVD $base64_const<>(SB), R5
VLM (R5), REV_BYTES, RESHUFFLE_MASK
VREPIF $0x0fc0fc00, MULHI_MASK
VREPIF $0x04000040, MULHI_CONST
VREPIF $0x003F03F0, MULLO_MASK
VREPIF $0x01000010, MULLO_CONST
VLM (R5), REV_BYTES, MULLO_CONST
VREPIB $0x33, RANGE1_END
VREPIB $0x19, RANGE0_END
VZERO ZERO
Expand Down

0 comments on commit ff84ed0

Please sign in to comment.