summaryrefslogtreecommitdiffstats
path: root/src/codegen_sse.h
diff options
context:
space:
mode:
authorAnthony Blake <anthonix@me.com>2012-08-30 16:36:00 +1200
committerAnthony Blake <anthonix@me.com>2012-08-30 16:36:00 +1200
commit1be4449adcac82b2138c7cde7d549f1404cd772e (patch)
treefd8f2c4f03fa849a3104e4d17088d8514b1faeb3 /src/codegen_sse.h
parent04fbcbdd60dc4bcdb89353cc1e4bc544f0c987c9 (diff)
downloadffts-1be4449adcac82b2138c7cde7d549f1404cd772e.zip
ffts-1be4449adcac82b2138c7cde7d549f1404cd772e.tar.gz
SSE working in GDB
Diffstat (limited to 'src/codegen_sse.h')
-rw-r--r--src/codegen_sse.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/codegen_sse.h b/src/codegen_sse.h
index 3adec02..490826b 100644
--- a/src/codegen_sse.h
+++ b/src/codegen_sse.h
@@ -14,7 +14,12 @@ void leaf_oo();
void leaf_eo();
void leaf_oe();
void leaf_end();
+void x_init();
+void x4();
+void x8_soft();
+void x8_hard();
+ typedef uint8_t insns_t;
extern const uint32_t sse_leaf_ee_offsets[8];
extern const uint32_t sse_leaf_oo_offsets[8];
@@ -105,4 +110,31 @@ void RET(uint8_t **p) {
*(*p)++ = 0xc3;
}
+void ADDI(uint8_t **p, uint8_t dst, int32_t imm) {
+ if(dst >= 8) *(*p)++ = 0x49;
+ else *(*p)++ = 0x48;
+
+ if(imm > 127 || imm <= -128) *(*p)++ = 0x81;
+ else *(*p)++ = 0x83;
+
+ *(*p)++ = 0xc0 | (dst & 0x7);
+
+ if(imm > 127 || imm <= -128) IMM32(p, imm);
+ else IMM8(p, imm);
+}
+
+void CALL(uint8_t **p, insns_t *func) {
+ *(*p)++ = 0xe8;
+ IMM32(p, ((void *)func) - (void *)(*p) - 4);
+}
+
+void PUSH(uint8_t **p, uint8_t reg) {
+ if(reg >= 8) *(*p)++ = 0x41;
+ *(*p)++ = 0x50 | (reg & 7);
+}
+void POP(uint8_t **p, uint8_t reg) {
+ if(reg >= 8) *(*p)++ = 0x41;
+ *(*p)++ = 0x58 | (reg & 7);
+}
+
#endif
OpenPOWER on IntegriCloud