qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

targ.c (835B)


      1 #include "all.h"
      2 
      3 Amd64Op amd64_op[NOp] = {
      4 #define O(op, t, x) [O##op] =
      5 #define X(nm, zf, lf) { nm, zf, lf, },
      6 	#include "../ops.h"
      7 };
      8 
      9 static int
     10 amd64_memargs(int op)
     11 {
     12 	return amd64_op[op].nmem;
     13 }
     14 
     15 #define AMD64_COMMON \
     16 	.gpr0 = RAX, \
     17 	.ngpr = NGPR, \
     18 	.fpr0 = XMM0, \
     19 	.nfpr = NFPR, \
     20 	.rglob = BIT(RBP) | BIT(RSP), \
     21 	.nrglob = 2, \
     22 	.rsave = amd64_sysv_rsave, \
     23 	.nrsave = {NGPS, NFPS}, \
     24 	.retregs = amd64_sysv_retregs, \
     25 	.argregs = amd64_sysv_argregs, \
     26 	.memargs = amd64_memargs, \
     27 	.abi0 = elimsb, \
     28 	.abi1 = amd64_sysv_abi, \
     29 	.isel = amd64_isel, \
     30 	.emitfn = amd64_emitfn, \
     31 
     32 Target T_amd64_sysv = {
     33 	.name = "amd64_sysv",
     34 	.emitfin = elf_emitfin,
     35 	.asloc = ".L",
     36 	AMD64_COMMON
     37 };
     38 
     39 Target T_amd64_apple = {
     40 	.name = "amd64_apple",
     41 	.apple = 1,
     42 	.emitfin = macho_emitfin,
     43 	.asloc = "L",
     44 	.assym = "_",
     45 	AMD64_COMMON
     46 };