Path: blob/master/arch/mips/include/asm/asmmacro-64.h
17540 views
/*1* asmmacro.h: Assembler macros to make things easier to read.2*3* Copyright (C) 1996 David S. Miller ([email protected])4* Copyright (C) 1998, 1999 Ralf Baechle5* Copyright (C) 1999 Silicon Graphics, Inc.6*/7#ifndef _ASM_ASMMACRO_64_H8#define _ASM_ASMMACRO_64_H910#include <asm/asm-offsets.h>11#include <asm/regdef.h>12#include <asm/fpregdef.h>13#include <asm/mipsregs.h>1415.macro fpu_save_16even thread tmp=t016cfc1 \tmp, fcr3117sdc1 $f0, THREAD_FPR0(\thread)18sdc1 $f2, THREAD_FPR2(\thread)19sdc1 $f4, THREAD_FPR4(\thread)20sdc1 $f6, THREAD_FPR6(\thread)21sdc1 $f8, THREAD_FPR8(\thread)22sdc1 $f10, THREAD_FPR10(\thread)23sdc1 $f12, THREAD_FPR12(\thread)24sdc1 $f14, THREAD_FPR14(\thread)25sdc1 $f16, THREAD_FPR16(\thread)26sdc1 $f18, THREAD_FPR18(\thread)27sdc1 $f20, THREAD_FPR20(\thread)28sdc1 $f22, THREAD_FPR22(\thread)29sdc1 $f24, THREAD_FPR24(\thread)30sdc1 $f26, THREAD_FPR26(\thread)31sdc1 $f28, THREAD_FPR28(\thread)32sdc1 $f30, THREAD_FPR30(\thread)33sw \tmp, THREAD_FCR31(\thread)34.endm3536.macro fpu_save_16odd thread37sdc1 $f1, THREAD_FPR1(\thread)38sdc1 $f3, THREAD_FPR3(\thread)39sdc1 $f5, THREAD_FPR5(\thread)40sdc1 $f7, THREAD_FPR7(\thread)41sdc1 $f9, THREAD_FPR9(\thread)42sdc1 $f11, THREAD_FPR11(\thread)43sdc1 $f13, THREAD_FPR13(\thread)44sdc1 $f15, THREAD_FPR15(\thread)45sdc1 $f17, THREAD_FPR17(\thread)46sdc1 $f19, THREAD_FPR19(\thread)47sdc1 $f21, THREAD_FPR21(\thread)48sdc1 $f23, THREAD_FPR23(\thread)49sdc1 $f25, THREAD_FPR25(\thread)50sdc1 $f27, THREAD_FPR27(\thread)51sdc1 $f29, THREAD_FPR29(\thread)52sdc1 $f31, THREAD_FPR31(\thread)53.endm5455.macro fpu_save_double thread status tmp56sll \tmp, \status, 557bgez \tmp, 2f58fpu_save_16odd \thread592:60fpu_save_16even \thread \tmp61.endm6263.macro fpu_restore_16even thread tmp=t064lw \tmp, THREAD_FCR31(\thread)65ldc1 $f0, THREAD_FPR0(\thread)66ldc1 $f2, THREAD_FPR2(\thread)67ldc1 $f4, THREAD_FPR4(\thread)68ldc1 $f6, THREAD_FPR6(\thread)69ldc1 $f8, THREAD_FPR8(\thread)70ldc1 $f10, THREAD_FPR10(\thread)71ldc1 $f12, THREAD_FPR12(\thread)72ldc1 $f14, THREAD_FPR14(\thread)73ldc1 $f16, THREAD_FPR16(\thread)74ldc1 $f18, THREAD_FPR18(\thread)75ldc1 $f20, THREAD_FPR20(\thread)76ldc1 $f22, THREAD_FPR22(\thread)77ldc1 $f24, THREAD_FPR24(\thread)78ldc1 $f26, THREAD_FPR26(\thread)79ldc1 $f28, THREAD_FPR28(\thread)80ldc1 $f30, THREAD_FPR30(\thread)81ctc1 \tmp, fcr3182.endm8384.macro fpu_restore_16odd thread85ldc1 $f1, THREAD_FPR1(\thread)86ldc1 $f3, THREAD_FPR3(\thread)87ldc1 $f5, THREAD_FPR5(\thread)88ldc1 $f7, THREAD_FPR7(\thread)89ldc1 $f9, THREAD_FPR9(\thread)90ldc1 $f11, THREAD_FPR11(\thread)91ldc1 $f13, THREAD_FPR13(\thread)92ldc1 $f15, THREAD_FPR15(\thread)93ldc1 $f17, THREAD_FPR17(\thread)94ldc1 $f19, THREAD_FPR19(\thread)95ldc1 $f21, THREAD_FPR21(\thread)96ldc1 $f23, THREAD_FPR23(\thread)97ldc1 $f25, THREAD_FPR25(\thread)98ldc1 $f27, THREAD_FPR27(\thread)99ldc1 $f29, THREAD_FPR29(\thread)100ldc1 $f31, THREAD_FPR31(\thread)101.endm102103.macro fpu_restore_double thread status tmp104sll \tmp, \status, 5105bgez \tmp, 1f # 16 register mode?106107fpu_restore_16odd \thread1081: fpu_restore_16even \thread \tmp109.endm110111.macro cpu_save_nonscratch thread112LONG_S s0, THREAD_REG16(\thread)113LONG_S s1, THREAD_REG17(\thread)114LONG_S s2, THREAD_REG18(\thread)115LONG_S s3, THREAD_REG19(\thread)116LONG_S s4, THREAD_REG20(\thread)117LONG_S s5, THREAD_REG21(\thread)118LONG_S s6, THREAD_REG22(\thread)119LONG_S s7, THREAD_REG23(\thread)120LONG_S sp, THREAD_REG29(\thread)121LONG_S fp, THREAD_REG30(\thread)122.endm123124.macro cpu_restore_nonscratch thread125LONG_L s0, THREAD_REG16(\thread)126LONG_L s1, THREAD_REG17(\thread)127LONG_L s2, THREAD_REG18(\thread)128LONG_L s3, THREAD_REG19(\thread)129LONG_L s4, THREAD_REG20(\thread)130LONG_L s5, THREAD_REG21(\thread)131LONG_L s6, THREAD_REG22(\thread)132LONG_L s7, THREAD_REG23(\thread)133LONG_L sp, THREAD_REG29(\thread)134LONG_L fp, THREAD_REG30(\thread)135LONG_L ra, THREAD_REG31(\thread)136.endm137138#endif /* _ASM_ASMMACRO_64_H */139140141