aboutsummaryrefslogtreecommitdiff
path: root/scrypt-cell-spu.h
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>2011-12-27 03:51:24 +0200
committerSiarhei Siamashka <siarhei.siamashka@gmail.com>2011-12-29 06:47:40 +0200
commitea4520474ba5a966260fc5652c5248e6eab50d58 (patch)
tree18f32becc26cf074fc9b1c9e00a778efa0038ef0 /scrypt-cell-spu.h
parent7a9481d266b58bd02a7d8033f359ca344cfd65d6 (diff)
Added Cell/BE optimizations
Linux on PS3 gets a huge boost in litecoin mining performance. Cell/BE support should be detected and enabled automatically by autotools. The miner threads are first allocated to the available SPU cores (typically 6). The remaining threads are allocated on PPU. There will be 8 threads total on PS3: 6 SPU threads and 2 PPU threads. Each SPU core provides ~5.4 khash/s if compiled with spu-elf-gcc 4.6 The performance may vary for different gcc versions, older ones are typically slower.
Diffstat (limited to 'scrypt-cell-spu.h')
-rw-r--r--scrypt-cell-spu.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/scrypt-cell-spu.h b/scrypt-cell-spu.h
new file mode 100644
index 0000000..4af26c4
--- /dev/null
+++ b/scrypt-cell-spu.h
@@ -0,0 +1,44 @@
+/*-
+ * Copyright 2009 Colin Percival, 2011 ArtForz, 2011 Siarhei Siamashka
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * This file was originally written by Colin Percival as part of the Tarsnap
+ * online backup system.
+ */
+
+#ifndef __SCRYPT_CELL_SPU_H__
+#define __SCRYPT_CELL_SPU_H__
+
+/*
+ * This is the data structure which is passed between main CPU and SPU cores.
+ */
+typedef struct {
+ uint8_t data[128];
+ uint8_t target[32];
+ uint32_t max_nonce;
+ uint32_t hashes_done;
+ uint32_t padding[2];
+} scanhash_spu_args;
+
+#endif