Avoid unncessary use of double in the kernel. With this change,

a LLVM build kernel fully works on TWRP1025.
This commit is contained in:
joerg 2014-08-12 20:27:10 +00:00
parent 5fd7c05ae4
commit 691c317038
4 changed files with 18 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fpu_emu.c,v 1.16 2012/07/23 04:13:06 matt Exp $ */
/* $NetBSD: fpu_emu.c,v 1.17 2014/08/12 20:27:10 joerg Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.16 2012/07/23 04:13:06 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.17 2014/08/12 20:27:10 joerg Exp $");
#include "opt_ddb.h"
@ -324,7 +324,7 @@ fpu_execute(struct trapframe *tf, struct fpemu *fe, union instr *insn)
* Convert to/from single if needed, calculate addr,
* and update index reg if needed.
*/
double buf;
uint64_t buf;
size_t size = sizeof(float);
int store, update;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcontext.h,v 1.16 2014/07/24 18:19:13 joerg Exp $ */
/* $NetBSD: mcontext.h,v 1.17 2014/08/12 20:27:10 joerg Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -86,7 +86,11 @@ typedef __greg_t __gregset_t[_NGREG];
#define _REG_MQ 38 /* MQ Register (POWER only) */
typedef struct {
#ifdef _KERNEL
unsigned long long __fpu_regs[32]; /* FP0-31 */
#else
double __fpu_regs[32]; /* FP0-31 */
#endif
unsigned int __fpu_fpscr; /* FP Status and Control Register */
unsigned int __fpu_valid; /* Set together with _UC_FPU */
} __fpregset_t;

View File

@ -1,4 +1,4 @@
/* $NetBSD: reg.h,v 1.10 2011/01/18 01:02:54 matt Exp $ */
/* $NetBSD: reg.h,v 1.11 2014/08/12 20:27:10 joerg Exp $ */
#ifndef _POWERPC_REG_H_
#define _POWERPC_REG_H_
@ -58,8 +58,13 @@ struct reg { /* base registers */
};
struct fpreg { /* Floating Point registers */
#ifdef _KERNEL
uint64_t fpreg[32];
uint64_t fpscr; /* Status and Control Register */
#else
double fpreg[32];
double fpscr; /* Status and Control Register */
#endif
};
struct vreg { /* Vector registers */

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.149 2014/03/03 15:36:36 macallan Exp $ */
/* $NetBSD: trap.c,v 1.150 2014/08/12 20:27:10 joerg Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.149 2014/03/03 15:36:36 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.150 2014/08/12 20:27:10 joerg Exp $");
#include "opt_altivec.h"
#include "opt_ddb.h"
@ -736,7 +736,7 @@ fix_unaligned(struct lwp *l, struct trapframe *tf)
struct pcb * const pcb = lwp_getpcb(l);
const int reg = EXC_ALI_RST(tf->tf_dsisr);
const int a_reg = EXC_ALI_RA(tf->tf_dsisr);
double * const fpreg = &pcb->pcb_fpu.fpreg[reg];
uint64_t * const fpreg = &pcb->pcb_fpu.fpreg[reg];
register_t* a_reg_addr = &tf->tf_fixreg[a_reg];
/*
@ -782,7 +782,7 @@ fix_unaligned(struct lwp *l, struct trapframe *tf)
struct pcb * const pcb = lwp_getpcb(l);
const int reg = EXC_ALI_RST(tf->tf_dsisr);
const int a_reg = EXC_ALI_RA(tf->tf_dsisr);
double * const fpreg = &pcb->pcb_fpu.fpreg[reg];
uint64_t * const fpreg = &pcb->pcb_fpu.fpreg[reg];
register_t* a_reg_addr = &tf->tf_fixreg[a_reg];
/*