linux/arch/x86/include/asm/xor.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _ASM_X86_XOR_H
#define _ASM_X86_XOR_H

/*
 * Optimized RAID-5 checksumming functions for SSE.
 */

/*
 * Cache avoiding checksumming functions utilizing KNI instructions
 * Copyright (C) 1999 Zach Brown (with obvious credit due Ingo)
 */

/*
 * Based on
 * High-speed RAID5 checksumming functions utilizing SSE instructions.
 * Copyright (C) 1998 Ingo Molnar.
 */

/*
 * x86-64 changes / gcc fixes from Andi Kleen.
 * Copyright 2002 Andi Kleen, SuSE Labs.
 *
 * This hasn't been optimized for the hammer yet, but there are likely
 * no advantages to be gotten from x86-64 here anyways.
 */

#include <asm/fpu/api.h>

#ifdef CONFIG_X86_32
/* reduce register pressure */
#define XOR_CONSTANT_CONSTRAINT
#else
#define XOR_CONSTANT_CONSTRAINT
#endif

#define OFFS(x)
#define PF_OFFS(x)
#define PF0(x)
#define LD
#define ST
#define PF1(x)
#define PF2(x)
#define PF3(x)
#define PF4(x)
#define XO1
#define XO2
#define XO3
#define XO4
#define NOP

#define BLK64

static void
xor_sse_2(unsigned long bytes, unsigned long * __restrict p1,
	  const unsigned long * __restrict p2)
{}

static void
xor_sse_2_pf64(unsigned long bytes, unsigned long * __restrict p1,
	       const unsigned long * __restrict p2)
{}

static void
xor_sse_3(unsigned long bytes, unsigned long * __restrict p1,
	  const unsigned long * __restrict p2,
	  const unsigned long * __restrict p3)
{}

static void
xor_sse_3_pf64(unsigned long bytes, unsigned long * __restrict p1,
	       const unsigned long * __restrict p2,
	       const unsigned long * __restrict p3)
{}

static void
xor_sse_4(unsigned long bytes, unsigned long * __restrict p1,
	  const unsigned long * __restrict p2,
	  const unsigned long * __restrict p3,
	  const unsigned long * __restrict p4)
{}

static void
xor_sse_4_pf64(unsigned long bytes, unsigned long * __restrict p1,
	       const unsigned long * __restrict p2,
	       const unsigned long * __restrict p3,
	       const unsigned long * __restrict p4)
{}

static void
xor_sse_5(unsigned long bytes, unsigned long * __restrict p1,
	  const unsigned long * __restrict p2,
	  const unsigned long * __restrict p3,
	  const unsigned long * __restrict p4,
	  const unsigned long * __restrict p5)
{}

static void
xor_sse_5_pf64(unsigned long bytes, unsigned long * __restrict p1,
	       const unsigned long * __restrict p2,
	       const unsigned long * __restrict p3,
	       const unsigned long * __restrict p4,
	       const unsigned long * __restrict p5)
{}

static struct xor_block_template xor_block_sse_pf64 =;

#undef LD
#undef XO1
#undef XO2
#undef XO3
#undef XO4
#undef ST
#undef NOP
#undef BLK64
#undef BLOCK

#undef XOR_CONSTANT_CONSTRAINT

#ifdef CONFIG_X86_32
# include <asm/xor_32.h>
#else
# include <asm/xor_64.h>
#endif

#define XOR_SELECT_TEMPLATE(FASTEST)

#endif /* _ASM_X86_XOR_H */