summaryrefslogtreecommitdiff
path: root/misc/pascal/include/pfdefs.h
blob: e58ca4ed7869f55123b4b245faf92d67a47ecec1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/***********************************************************************
 * pfdefs.h
 * Floating point operation codes
 *
 *   Copyright (C) 2008 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ***********************************************************************/

#ifndef __PFDEFS_H
#define __PFDEFS_H

/**---------------------------------------------------------------------
 FLOATING POINT SUB-OPCODES
 ---------------------------------------------------------------------**/

/* This bit may be set in the opcode to indicate that the arguments
 * is(are) type integer and require(s) conversion. */

#define fpARG1  (0x40)
#define fpARG2  (0x80)
#define fpMASK  (0x3f)
#define fpSHIFT  6

/* The "INVALID" floating point operation */

#define fpINVLD (0x00)

/* Floating Pointer Conversions (On 16-bit stack argument:  FP or Integer) */

#define fpFLOAT (0x01)
#define fpTRUNC (0x02)
#define fpROUND (0x03)

/* Floating Point arithmetic instructions (Two FP 16-bit stack arguments) */

#define fpADD   (0x04)
#define fpSUB   (0x05)
#define fpMUL   (0x06)
#define fpDIV   (0x07)
#define fpMOD   (0x08)

/* Floating Point Comparisons (Two FP 16-bit stack arguments) */

#define fpEQU   (0x0a)
#define fpNEQ   (0x0b)
#define fpLT    (0x0c)
#define fpGTE   (0x0d)
#define fpGT    (0x0e)
#define fpLTE   (0x0f)

/* Floating Point arithmetic instructions (One FP 16-bit stack arguments) */

#define fpNEG   (0x10)
#define fpABS   (0x11)
#define fpSQR   (0x12)
#define fpSQRT  (0x13)
#define fpSIN   (0x14)
#define fpCOS   (0x15)
#define fpATAN  (0x16)
#define fpLN    (0x17)
#define fpEXP   (0x18)

#define MAX_FOP (0x19) /* Number of floating point operations */

#endif /* __PFDEFS_H */