2021-03-09 18:10:12 +01:00
|
|
|
#ifndef __INCLUDE_ASM_H__
|
|
|
|
#define __INCLUDE_ASM_H__
|
|
|
|
|
|
|
|
#define STRINGIFY_(x) #x
|
|
|
|
#define STRINGIFY(x) STRINGIFY_(x)
|
|
|
|
|
2021-03-10 09:05:27 +01:00
|
|
|
#if !defined(SPLAT) && !defined(__CTX__) && !defined(PERMUTER)
|
2021-03-09 18:10:12 +01:00
|
|
|
#ifndef INCLUDE_ASM
|
2023-01-17 00:03:23 +01:00
|
|
|
#define INCLUDE_ASM_INTERNAL(TYPE, BASE_FOLDER, FOLDER, NAME, ARGS...) \
|
2021-04-23 13:55:30 +02:00
|
|
|
__asm__( \
|
|
|
|
".section .text\n" \
|
|
|
|
"\t.align\t2\n" \
|
|
|
|
"\t.globl\t"#NAME"\n" \
|
|
|
|
"\t.ent\t"#NAME"\n" \
|
|
|
|
#NAME ":\n" \
|
2023-01-17 00:03:23 +01:00
|
|
|
"\t.include \"ver/"STRINGIFY(VERSION)"/asm/"BASE_FOLDER"/"FOLDER"/"#NAME".s\"\n" \
|
2021-04-23 13:55:30 +02:00
|
|
|
"\t.set reorder\n" \
|
|
|
|
"\t.set at\n" \
|
|
|
|
"\t.end\t"#NAME \
|
|
|
|
);
|
2023-01-17 00:03:23 +01:00
|
|
|
#define INCLUDE_ASM(TYPE, FOLDER, NAME, ARGS...) INCLUDE_ASM_INTERNAL(TYPE, "nonmatchings", FOLDER, NAME, ARGS)
|
|
|
|
#define INCLUDE_ASM_SHIFT(TYPE, FOLDER, NAME, ARGS...) INCLUDE_ASM_INTERNAL(TYPE, "shiftable", FOLDER, NAME, ARGS)
|
2021-03-09 18:10:12 +01:00
|
|
|
#endif
|
2021-03-24 09:39:43 +01:00
|
|
|
__asm__(".include \"include/macro.inc\"\n");
|
2021-03-09 18:10:12 +01:00
|
|
|
#else
|
|
|
|
#define INCLUDE_ASM(TYPE, FOLDER, NAME, ARGS...)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|