mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Long double, part 1 of N. Support in IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
107f54a002
commit
320fc8a39e
@ -81,7 +81,14 @@ namespace bitc {
|
||||
TYPE_CODE_FUNCTION = 9, // FUNCTION: [vararg, retty, paramty x N]
|
||||
TYPE_CODE_STRUCT = 10, // STRUCT: [ispacked, eltty x N]
|
||||
TYPE_CODE_ARRAY = 11, // ARRAY: [numelts, eltty]
|
||||
TYPE_CODE_VECTOR = 12 // VECTOR: [numelts, eltty]
|
||||
TYPE_CODE_VECTOR = 12, // VECTOR: [numelts, eltty]
|
||||
|
||||
// These are not with the other floating point types because they're
|
||||
// a late addition, and putting them in the right place breaks
|
||||
// binary compatibility.
|
||||
TYPE_CODE_X86_FP80 = 13, // X86 LONG DOUBLE
|
||||
TYPE_CODE_FP128 = 14, // LONG DOUBLE (112 bit mantissa)
|
||||
TYPE_CODE_PPC_FP128= 15 // PPC LONG DOUBLE (2 doubles)
|
||||
// Any other type code is assumed to be an unknown type.
|
||||
};
|
||||
|
||||
|
@ -70,18 +70,21 @@ public:
|
||||
VoidTyID = 0, ///< 0: type with no size
|
||||
FloatTyID, ///< 1: 32 bit floating point type
|
||||
DoubleTyID, ///< 2: 64 bit floating point type
|
||||
LabelTyID, ///< 3: Labels
|
||||
X86_FP80TyID, ///< 3: 80 bit floating point type (X87)
|
||||
FP128TyID, ///< 4: 128 bit floating point type (112-bit mantissa)
|
||||
PPC_FP128TyID, ///< 5: 128 bit floating point type (two 64-bits)
|
||||
LabelTyID, ///< 6: Labels
|
||||
|
||||
// Derived types... see DerivedTypes.h file...
|
||||
// Make sure FirstDerivedTyID stays up to date!!!
|
||||
IntegerTyID, ///< 4: Arbitrary bit width integers
|
||||
FunctionTyID, ///< 5: Functions
|
||||
StructTyID, ///< 6: Structures
|
||||
PackedStructTyID,///< 7: Packed Structure. This is for bitcode only
|
||||
ArrayTyID, ///< 8: Arrays
|
||||
PointerTyID, ///< 9: Pointers
|
||||
OpaqueTyID, ///< 10: Opaque: type with unknown structure
|
||||
VectorTyID, ///< 11: SIMD 'packed' format, or other vector type
|
||||
IntegerTyID, ///< 7: Arbitrary bit width integers
|
||||
FunctionTyID, ///< 8: Functions
|
||||
StructTyID, ///< 9: Structures
|
||||
PackedStructTyID,///< 10: Packed Structure. This is for bitcode only
|
||||
ArrayTyID, ///< 11: Arrays
|
||||
PointerTyID, ///< 12: Pointers
|
||||
OpaqueTyID, ///< 13: Opaque: type with unknown structure
|
||||
VectorTyID, ///< 14: SIMD 'packed' format, or other vector type
|
||||
|
||||
NumTypeIDs, // Must remain as last defined ID
|
||||
LastPrimitiveTyID = LabelTyID,
|
||||
@ -179,7 +182,8 @@ public:
|
||||
|
||||
/// isFloatingPoint - Return true if this is one of the two floating point
|
||||
/// types
|
||||
bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID; }
|
||||
bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID ||
|
||||
ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID; }
|
||||
|
||||
/// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
|
||||
///
|
||||
@ -282,6 +286,7 @@ public:
|
||||
// These are the builtin types that are always available...
|
||||
//
|
||||
static const Type *VoidTy, *LabelTy, *FloatTy, *DoubleTy;
|
||||
static const Type *X86_FP80Ty, *FP128Ty, *PPC_FP128Ty;
|
||||
static const IntegerType *Int1Ty, *Int8Ty, *Int16Ty, *Int32Ty, *Int64Ty;
|
||||
|
||||
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -244,6 +244,9 @@ zext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
|
||||
void { RET_TY(Type::VoidTy, VOID); }
|
||||
float { RET_TY(Type::FloatTy, FLOAT); }
|
||||
double { RET_TY(Type::DoubleTy,DOUBLE);}
|
||||
x86_fp80 { RET_TY(Type::X86_FP80Ty, X86_FP80);}
|
||||
fp128 { RET_TY(Type::FP128Ty, FP128);}
|
||||
ppc_fp128 { RET_TY(Type::PPC_FP128Ty, PPC_FP128);}
|
||||
label { RET_TY(Type::LabelTy, LABEL); }
|
||||
type { return TYPE; }
|
||||
opaque { return OPAQUE; }
|
||||
|
@ -244,6 +244,9 @@ zext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
|
||||
void { RET_TY(Type::VoidTy, VOID); }
|
||||
float { RET_TY(Type::FloatTy, FLOAT); }
|
||||
double { RET_TY(Type::DoubleTy,DOUBLE);}
|
||||
x86_fp80 { RET_TY(Type::X86_FP80Ty, X86_FP80);}
|
||||
fp128 { RET_TY(Type::FP128Ty, FP128);}
|
||||
ppc_fp128 { RET_TY(Type::PPC_FP128Ty, PPC_FP128);}
|
||||
label { RET_TY(Type::LabelTy, LABEL); }
|
||||
type { return TYPE; }
|
||||
opaque { return OPAQUE; }
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,323 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 1.875c. */
|
||||
|
||||
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
ESINT64VAL = 258,
|
||||
EUINT64VAL = 259,
|
||||
ESAPINTVAL = 260,
|
||||
EUAPINTVAL = 261,
|
||||
LOCALVAL_ID = 262,
|
||||
GLOBALVAL_ID = 263,
|
||||
FPVAL = 264,
|
||||
VOID = 265,
|
||||
INTTYPE = 266,
|
||||
FLOAT = 267,
|
||||
DOUBLE = 268,
|
||||
LABEL = 269,
|
||||
TYPE = 270,
|
||||
LOCALVAR = 271,
|
||||
GLOBALVAR = 272,
|
||||
LABELSTR = 273,
|
||||
STRINGCONSTANT = 274,
|
||||
ATSTRINGCONSTANT = 275,
|
||||
PCTSTRINGCONSTANT = 276,
|
||||
ZEROINITIALIZER = 277,
|
||||
TRUETOK = 278,
|
||||
FALSETOK = 279,
|
||||
BEGINTOK = 280,
|
||||
ENDTOK = 281,
|
||||
DECLARE = 282,
|
||||
DEFINE = 283,
|
||||
GLOBAL = 284,
|
||||
CONSTANT = 285,
|
||||
SECTION = 286,
|
||||
ALIAS = 287,
|
||||
VOLATILE = 288,
|
||||
THREAD_LOCAL = 289,
|
||||
TO = 290,
|
||||
DOTDOTDOT = 291,
|
||||
NULL_TOK = 292,
|
||||
UNDEF = 293,
|
||||
INTERNAL = 294,
|
||||
LINKONCE = 295,
|
||||
WEAK = 296,
|
||||
APPENDING = 297,
|
||||
DLLIMPORT = 298,
|
||||
DLLEXPORT = 299,
|
||||
EXTERN_WEAK = 300,
|
||||
OPAQUE = 301,
|
||||
EXTERNAL = 302,
|
||||
TARGET = 303,
|
||||
TRIPLE = 304,
|
||||
ALIGN = 305,
|
||||
DEPLIBS = 306,
|
||||
CALL = 307,
|
||||
TAIL = 308,
|
||||
ASM_TOK = 309,
|
||||
MODULE = 310,
|
||||
SIDEEFFECT = 311,
|
||||
CC_TOK = 312,
|
||||
CCC_TOK = 313,
|
||||
FASTCC_TOK = 314,
|
||||
COLDCC_TOK = 315,
|
||||
X86_STDCALLCC_TOK = 316,
|
||||
X86_FASTCALLCC_TOK = 317,
|
||||
DATALAYOUT = 318,
|
||||
RET = 319,
|
||||
BR = 320,
|
||||
SWITCH = 321,
|
||||
INVOKE = 322,
|
||||
UNWIND = 323,
|
||||
UNREACHABLE = 324,
|
||||
ADD = 325,
|
||||
SUB = 326,
|
||||
MUL = 327,
|
||||
UDIV = 328,
|
||||
SDIV = 329,
|
||||
FDIV = 330,
|
||||
UREM = 331,
|
||||
SREM = 332,
|
||||
FREM = 333,
|
||||
AND = 334,
|
||||
OR = 335,
|
||||
XOR = 336,
|
||||
SHL = 337,
|
||||
LSHR = 338,
|
||||
ASHR = 339,
|
||||
ICMP = 340,
|
||||
FCMP = 341,
|
||||
EQ = 342,
|
||||
NE = 343,
|
||||
SLT = 344,
|
||||
SGT = 345,
|
||||
SLE = 346,
|
||||
SGE = 347,
|
||||
ULT = 348,
|
||||
UGT = 349,
|
||||
ULE = 350,
|
||||
UGE = 351,
|
||||
OEQ = 352,
|
||||
ONE = 353,
|
||||
OLT = 354,
|
||||
OGT = 355,
|
||||
OLE = 356,
|
||||
OGE = 357,
|
||||
ORD = 358,
|
||||
UNO = 359,
|
||||
UEQ = 360,
|
||||
UNE = 361,
|
||||
MALLOC = 362,
|
||||
ALLOCA = 363,
|
||||
FREE = 364,
|
||||
LOAD = 365,
|
||||
STORE = 366,
|
||||
GETELEMENTPTR = 367,
|
||||
TRUNC = 368,
|
||||
ZEXT = 369,
|
||||
SEXT = 370,
|
||||
FPTRUNC = 371,
|
||||
FPEXT = 372,
|
||||
BITCAST = 373,
|
||||
UITOFP = 374,
|
||||
SITOFP = 375,
|
||||
FPTOUI = 376,
|
||||
FPTOSI = 377,
|
||||
INTTOPTR = 378,
|
||||
PTRTOINT = 379,
|
||||
PHI_TOK = 380,
|
||||
SELECT = 381,
|
||||
VAARG = 382,
|
||||
EXTRACTELEMENT = 383,
|
||||
INSERTELEMENT = 384,
|
||||
SHUFFLEVECTOR = 385,
|
||||
SIGNEXT = 386,
|
||||
ZEROEXT = 387,
|
||||
NORETURN = 388,
|
||||
INREG = 389,
|
||||
SRET = 390,
|
||||
NOUNWIND = 391,
|
||||
NOALIAS = 392,
|
||||
BYVAL = 393,
|
||||
NEST = 394,
|
||||
DEFAULT = 395,
|
||||
HIDDEN = 396,
|
||||
PROTECTED = 397
|
||||
};
|
||||
#endif
|
||||
#define ESINT64VAL 258
|
||||
#define EUINT64VAL 259
|
||||
#define ESAPINTVAL 260
|
||||
#define EUAPINTVAL 261
|
||||
#define LOCALVAL_ID 262
|
||||
#define GLOBALVAL_ID 263
|
||||
#define FPVAL 264
|
||||
#define VOID 265
|
||||
#define INTTYPE 266
|
||||
#define FLOAT 267
|
||||
#define DOUBLE 268
|
||||
#define LABEL 269
|
||||
#define TYPE 270
|
||||
#define LOCALVAR 271
|
||||
#define GLOBALVAR 272
|
||||
#define LABELSTR 273
|
||||
#define STRINGCONSTANT 274
|
||||
#define ATSTRINGCONSTANT 275
|
||||
#define PCTSTRINGCONSTANT 276
|
||||
#define ZEROINITIALIZER 277
|
||||
#define TRUETOK 278
|
||||
#define FALSETOK 279
|
||||
#define BEGINTOK 280
|
||||
#define ENDTOK 281
|
||||
#define DECLARE 282
|
||||
#define DEFINE 283
|
||||
#define GLOBAL 284
|
||||
#define CONSTANT 285
|
||||
#define SECTION 286
|
||||
#define ALIAS 287
|
||||
#define VOLATILE 288
|
||||
#define THREAD_LOCAL 289
|
||||
#define TO 290
|
||||
#define DOTDOTDOT 291
|
||||
#define NULL_TOK 292
|
||||
#define UNDEF 293
|
||||
#define INTERNAL 294
|
||||
#define LINKONCE 295
|
||||
#define WEAK 296
|
||||
#define APPENDING 297
|
||||
#define DLLIMPORT 298
|
||||
#define DLLEXPORT 299
|
||||
#define EXTERN_WEAK 300
|
||||
#define OPAQUE 301
|
||||
#define EXTERNAL 302
|
||||
#define TARGET 303
|
||||
#define TRIPLE 304
|
||||
#define ALIGN 305
|
||||
#define DEPLIBS 306
|
||||
#define CALL 307
|
||||
#define TAIL 308
|
||||
#define ASM_TOK 309
|
||||
#define MODULE 310
|
||||
#define SIDEEFFECT 311
|
||||
#define CC_TOK 312
|
||||
#define CCC_TOK 313
|
||||
#define FASTCC_TOK 314
|
||||
#define COLDCC_TOK 315
|
||||
#define X86_STDCALLCC_TOK 316
|
||||
#define X86_FASTCALLCC_TOK 317
|
||||
#define DATALAYOUT 318
|
||||
#define RET 319
|
||||
#define BR 320
|
||||
#define SWITCH 321
|
||||
#define INVOKE 322
|
||||
#define UNWIND 323
|
||||
#define UNREACHABLE 324
|
||||
#define ADD 325
|
||||
#define SUB 326
|
||||
#define MUL 327
|
||||
#define UDIV 328
|
||||
#define SDIV 329
|
||||
#define FDIV 330
|
||||
#define UREM 331
|
||||
#define SREM 332
|
||||
#define FREM 333
|
||||
#define AND 334
|
||||
#define OR 335
|
||||
#define XOR 336
|
||||
#define SHL 337
|
||||
#define LSHR 338
|
||||
#define ASHR 339
|
||||
#define ICMP 340
|
||||
#define FCMP 341
|
||||
#define EQ 342
|
||||
#define NE 343
|
||||
#define SLT 344
|
||||
#define SGT 345
|
||||
#define SLE 346
|
||||
#define SGE 347
|
||||
#define ULT 348
|
||||
#define UGT 349
|
||||
#define ULE 350
|
||||
#define UGE 351
|
||||
#define OEQ 352
|
||||
#define ONE 353
|
||||
#define OLT 354
|
||||
#define OGT 355
|
||||
#define OLE 356
|
||||
#define OGE 357
|
||||
#define ORD 358
|
||||
#define UNO 359
|
||||
#define UEQ 360
|
||||
#define UNE 361
|
||||
#define MALLOC 362
|
||||
#define ALLOCA 363
|
||||
#define FREE 364
|
||||
#define LOAD 365
|
||||
#define STORE 366
|
||||
#define GETELEMENTPTR 367
|
||||
#define TRUNC 368
|
||||
#define ZEXT 369
|
||||
#define SEXT 370
|
||||
#define FPTRUNC 371
|
||||
#define FPEXT 372
|
||||
#define BITCAST 373
|
||||
#define UITOFP 374
|
||||
#define SITOFP 375
|
||||
#define FPTOUI 376
|
||||
#define FPTOSI 377
|
||||
#define INTTOPTR 378
|
||||
#define PTRTOINT 379
|
||||
#define PHI_TOK 380
|
||||
#define SELECT 381
|
||||
#define VAARG 382
|
||||
#define EXTRACTELEMENT 383
|
||||
#define INSERTELEMENT 384
|
||||
#define SHUFFLEVECTOR 385
|
||||
#define SIGNEXT 386
|
||||
#define ZEROEXT 387
|
||||
#define NORETURN 388
|
||||
#define INREG 389
|
||||
#define SRET 390
|
||||
#define NOUNWIND 391
|
||||
#define NOALIAS 392
|
||||
#define BYVAL 393
|
||||
#define NEST 394
|
||||
#define DEFAULT 395
|
||||
#define HIDDEN 396
|
||||
#define PROTECTED 397
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
#line 957 "/users/dag/projects/cascade/llvm.modified/lib/AsmParser/llvmAsmParser.y"
|
||||
typedef union YYSTYPE {
|
||||
typedef union {
|
||||
llvm::Module *ModuleVal;
|
||||
llvm::Function *FunctionVal;
|
||||
llvm::BasicBlock *BasicBlockVal;
|
||||
@ -363,14 +44,149 @@ typedef union YYSTYPE {
|
||||
llvm::ICmpInst::Predicate IPredicate;
|
||||
llvm::FCmpInst::Predicate FPredicate;
|
||||
} YYSTYPE;
|
||||
/* Line 1268 of yacc.c. */
|
||||
#line 368 "llvmAsmParser.tab.h"
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
#define ESINT64VAL 257
|
||||
#define EUINT64VAL 258
|
||||
#define ESAPINTVAL 259
|
||||
#define EUAPINTVAL 260
|
||||
#define LOCALVAL_ID 261
|
||||
#define GLOBALVAL_ID 262
|
||||
#define FPVAL 263
|
||||
#define VOID 264
|
||||
#define INTTYPE 265
|
||||
#define FLOAT 266
|
||||
#define DOUBLE 267
|
||||
#define X86_FP80 268
|
||||
#define FP128 269
|
||||
#define PPC_FP128 270
|
||||
#define LABEL 271
|
||||
#define TYPE 272
|
||||
#define LOCALVAR 273
|
||||
#define GLOBALVAR 274
|
||||
#define LABELSTR 275
|
||||
#define STRINGCONSTANT 276
|
||||
#define ATSTRINGCONSTANT 277
|
||||
#define PCTSTRINGCONSTANT 278
|
||||
#define ZEROINITIALIZER 279
|
||||
#define TRUETOK 280
|
||||
#define FALSETOK 281
|
||||
#define BEGINTOK 282
|
||||
#define ENDTOK 283
|
||||
#define DECLARE 284
|
||||
#define DEFINE 285
|
||||
#define GLOBAL 286
|
||||
#define CONSTANT 287
|
||||
#define SECTION 288
|
||||
#define ALIAS 289
|
||||
#define VOLATILE 290
|
||||
#define THREAD_LOCAL 291
|
||||
#define TO 292
|
||||
#define DOTDOTDOT 293
|
||||
#define NULL_TOK 294
|
||||
#define UNDEF 295
|
||||
#define INTERNAL 296
|
||||
#define LINKONCE 297
|
||||
#define WEAK 298
|
||||
#define APPENDING 299
|
||||
#define DLLIMPORT 300
|
||||
#define DLLEXPORT 301
|
||||
#define EXTERN_WEAK 302
|
||||
#define OPAQUE 303
|
||||
#define EXTERNAL 304
|
||||
#define TARGET 305
|
||||
#define TRIPLE 306
|
||||
#define ALIGN 307
|
||||
#define DEPLIBS 308
|
||||
#define CALL 309
|
||||
#define TAIL 310
|
||||
#define ASM_TOK 311
|
||||
#define MODULE 312
|
||||
#define SIDEEFFECT 313
|
||||
#define CC_TOK 314
|
||||
#define CCC_TOK 315
|
||||
#define FASTCC_TOK 316
|
||||
#define COLDCC_TOK 317
|
||||
#define X86_STDCALLCC_TOK 318
|
||||
#define X86_FASTCALLCC_TOK 319
|
||||
#define DATALAYOUT 320
|
||||
#define RET 321
|
||||
#define BR 322
|
||||
#define SWITCH 323
|
||||
#define INVOKE 324
|
||||
#define UNWIND 325
|
||||
#define UNREACHABLE 326
|
||||
#define ADD 327
|
||||
#define SUB 328
|
||||
#define MUL 329
|
||||
#define UDIV 330
|
||||
#define SDIV 331
|
||||
#define FDIV 332
|
||||
#define UREM 333
|
||||
#define SREM 334
|
||||
#define FREM 335
|
||||
#define AND 336
|
||||
#define OR 337
|
||||
#define XOR 338
|
||||
#define SHL 339
|
||||
#define LSHR 340
|
||||
#define ASHR 341
|
||||
#define ICMP 342
|
||||
#define FCMP 343
|
||||
#define EQ 344
|
||||
#define NE 345
|
||||
#define SLT 346
|
||||
#define SGT 347
|
||||
#define SLE 348
|
||||
#define SGE 349
|
||||
#define ULT 350
|
||||
#define UGT 351
|
||||
#define ULE 352
|
||||
#define UGE 353
|
||||
#define OEQ 354
|
||||
#define ONE 355
|
||||
#define OLT 356
|
||||
#define OGT 357
|
||||
#define OLE 358
|
||||
#define OGE 359
|
||||
#define ORD 360
|
||||
#define UNO 361
|
||||
#define UEQ 362
|
||||
#define UNE 363
|
||||
#define MALLOC 364
|
||||
#define ALLOCA 365
|
||||
#define FREE 366
|
||||
#define LOAD 367
|
||||
#define STORE 368
|
||||
#define GETELEMENTPTR 369
|
||||
#define TRUNC 370
|
||||
#define ZEXT 371
|
||||
#define SEXT 372
|
||||
#define FPTRUNC 373
|
||||
#define FPEXT 374
|
||||
#define BITCAST 375
|
||||
#define UITOFP 376
|
||||
#define SITOFP 377
|
||||
#define FPTOUI 378
|
||||
#define FPTOSI 379
|
||||
#define INTTOPTR 380
|
||||
#define PTRTOINT 381
|
||||
#define PHI_TOK 382
|
||||
#define SELECT 383
|
||||
#define VAARG 384
|
||||
#define EXTRACTELEMENT 385
|
||||
#define INSERTELEMENT 386
|
||||
#define SHUFFLEVECTOR 387
|
||||
#define SIGNEXT 388
|
||||
#define ZEROEXT 389
|
||||
#define NORETURN 390
|
||||
#define INREG 391
|
||||
#define SRET 392
|
||||
#define NOUNWIND 393
|
||||
#define NOALIAS 394
|
||||
#define BYVAL 395
|
||||
#define NEST 396
|
||||
#define DEFAULT 397
|
||||
#define HIDDEN 398
|
||||
#define PROTECTED 399
|
||||
|
||||
|
||||
extern YYSTYPE llvmAsmlval;
|
||||
|
||||
|
||||
|
||||
|
@ -1050,7 +1050,7 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
|
||||
%type <TypeVal> Types ResultTypes
|
||||
%type <PrimType> IntType FPType PrimType // Classifications
|
||||
%token <PrimType> VOID INTTYPE
|
||||
%token <PrimType> FLOAT DOUBLE LABEL
|
||||
%token <PrimType> FLOAT DOUBLE X86_FP80 FP128 PPC_FP128 LABEL
|
||||
%token TYPE
|
||||
|
||||
|
||||
@ -1141,7 +1141,7 @@ FPredicates
|
||||
// These are some types that allow classification if we only want a particular
|
||||
// thing... for example, only a signed, unsigned, or integral type.
|
||||
IntType : INTTYPE;
|
||||
FPType : FLOAT | DOUBLE;
|
||||
FPType : FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80;
|
||||
|
||||
LocalName : LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT ;
|
||||
OptLocalName : LocalName | /*empty*/ { $$ = 0; };
|
||||
@ -1305,7 +1305,7 @@ GlobalVarAttribute : SectionString {
|
||||
|
||||
// Derived types are added later...
|
||||
//
|
||||
PrimType : INTTYPE | FLOAT | DOUBLE | LABEL ;
|
||||
PrimType : INTTYPE | FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80 | LABEL ;
|
||||
|
||||
Types
|
||||
: OPAQUE {
|
||||
|
@ -1050,7 +1050,7 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
|
||||
%type <TypeVal> Types ResultTypes
|
||||
%type <PrimType> IntType FPType PrimType // Classifications
|
||||
%token <PrimType> VOID INTTYPE
|
||||
%token <PrimType> FLOAT DOUBLE LABEL
|
||||
%token <PrimType> FLOAT DOUBLE X86_FP80 FP128 PPC_FP128 LABEL
|
||||
%token TYPE
|
||||
|
||||
|
||||
@ -1141,7 +1141,7 @@ FPredicates
|
||||
// These are some types that allow classification if we only want a particular
|
||||
// thing... for example, only a signed, unsigned, or integral type.
|
||||
IntType : INTTYPE;
|
||||
FPType : FLOAT | DOUBLE;
|
||||
FPType : FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80;
|
||||
|
||||
LocalName : LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT ;
|
||||
OptLocalName : LocalName | /*empty*/ { $$ = 0; };
|
||||
@ -1305,7 +1305,7 @@ GlobalVarAttribute : SectionString {
|
||||
|
||||
// Derived types are added later...
|
||||
//
|
||||
PrimType : INTTYPE | FLOAT | DOUBLE | LABEL ;
|
||||
PrimType : INTTYPE | FLOAT | DOUBLE | PPC_FP128 | FP128 | X86_FP80 | LABEL ;
|
||||
|
||||
Types
|
||||
: OPAQUE {
|
||||
|
@ -303,6 +303,15 @@ bool BitcodeReader::ParseTypeTable() {
|
||||
case bitc::TYPE_CODE_DOUBLE: // DOUBLE
|
||||
ResultTy = Type::DoubleTy;
|
||||
break;
|
||||
case bitc::TYPE_CODE_X86_FP80: // X86_FP80
|
||||
ResultTy = Type::X86_FP80Ty;
|
||||
break;
|
||||
case bitc::TYPE_CODE_FP128: // FP128
|
||||
ResultTy = Type::FP128Ty;
|
||||
break;
|
||||
case bitc::TYPE_CODE_PPC_FP128: // PPC_FP128
|
||||
ResultTy = Type::PPC_FP128Ty;
|
||||
break;
|
||||
case bitc::TYPE_CODE_LABEL: // LABEL
|
||||
ResultTy = Type::LabelTy;
|
||||
break;
|
||||
|
@ -187,6 +187,9 @@ static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
||||
case Type::VoidTyID: Code = bitc::TYPE_CODE_VOID; break;
|
||||
case Type::FloatTyID: Code = bitc::TYPE_CODE_FLOAT; break;
|
||||
case Type::DoubleTyID: Code = bitc::TYPE_CODE_DOUBLE; break;
|
||||
case Type::X86_FP80TyID: Code = bitc::TYPE_CODE_X86_FP80; break;
|
||||
case Type::FP128TyID: Code = bitc::TYPE_CODE_FP128; break;
|
||||
case Type::PPC_FP128TyID: Code = bitc::TYPE_CODE_PPC_FP128; break;
|
||||
case Type::LabelTyID: Code = bitc::TYPE_CODE_LABEL; break;
|
||||
case Type::OpaqueTyID: Code = bitc::TYPE_CODE_OPAQUE; break;
|
||||
case Type::IntegerTyID:
|
||||
|
@ -107,7 +107,10 @@ const Type *Type::getPrimitiveType(TypeID IDNumber) {
|
||||
switch (IDNumber) {
|
||||
case VoidTyID : return VoidTy;
|
||||
case FloatTyID : return FloatTy;
|
||||
case DoubleTyID: return DoubleTy;
|
||||
case DoubleTyID : return DoubleTy;
|
||||
case X86_FP80TyID : return X86_FP80Ty;
|
||||
case FP128TyID : return FP128Ty;
|
||||
case PPC_FP128TyID : return PPC_FP128Ty;
|
||||
case LabelTyID : return LabelTy;
|
||||
default:
|
||||
return 0;
|
||||
@ -126,7 +129,10 @@ const Type *Type::getVAArgsPromotedType() const {
|
||||
/// isFPOrFPVector - Return true if this is a FP type or a vector of FP types.
|
||||
///
|
||||
bool Type::isFPOrFPVector() const {
|
||||
if (ID == Type::FloatTyID || ID == Type::DoubleTyID) return true;
|
||||
if (ID == Type::FloatTyID || ID == Type::DoubleTyID ||
|
||||
ID == Type::FP128TyID || ID == Type::X86_FP80TyID ||
|
||||
ID == Type::PPC_FP128TyID)
|
||||
return true;
|
||||
if (ID != Type::VectorTyID) return false;
|
||||
|
||||
return cast<VectorType>(this)->getElementType()->isFloatingPoint();
|
||||
@ -162,6 +168,9 @@ unsigned Type::getPrimitiveSizeInBits() const {
|
||||
switch (getTypeID()) {
|
||||
case Type::FloatTyID: return 32;
|
||||
case Type::DoubleTyID: return 64;
|
||||
case Type::X86_FP80TyID: return 80;
|
||||
case Type::FP128TyID: return 128;
|
||||
case Type::PPC_FP128TyID: return 128;
|
||||
case Type::IntegerTyID: return cast<IntegerType>(this)->getBitWidth();
|
||||
case Type::VectorTyID: return cast<VectorType>(this)->getBitWidth();
|
||||
default: return 0;
|
||||
@ -251,6 +260,11 @@ static std::string getTypeDescription(const Type *Ty,
|
||||
case Type::VoidTyID: return (*ConcreteTypeDescriptions)[Ty] = "void";
|
||||
case Type::FloatTyID: return (*ConcreteTypeDescriptions)[Ty] = "float";
|
||||
case Type::DoubleTyID: return (*ConcreteTypeDescriptions)[Ty] = "double";
|
||||
case Type::X86_FP80TyID:
|
||||
return (*ConcreteTypeDescriptions)[Ty] = "x86_fp80";
|
||||
case Type::FP128TyID: return (*ConcreteTypeDescriptions)[Ty] = "fp128";
|
||||
case Type::PPC_FP128TyID:
|
||||
return (*ConcreteTypeDescriptions)[Ty] = "ppc_fp128";
|
||||
case Type::LabelTyID: return (*ConcreteTypeDescriptions)[Ty] = "label";
|
||||
}
|
||||
}
|
||||
@ -396,6 +410,9 @@ const Type *StructType::getTypeAtIndex(const Value *V) const {
|
||||
const Type *Type::VoidTy = new Type(Type::VoidTyID);
|
||||
const Type *Type::FloatTy = new Type(Type::FloatTyID);
|
||||
const Type *Type::DoubleTy = new Type(Type::DoubleTyID);
|
||||
const Type *Type::X86_FP80Ty = new Type(Type::X86_FP80TyID);
|
||||
const Type *Type::FP128Ty = new Type(Type::FP128TyID);
|
||||
const Type *Type::PPC_FP128Ty = new Type(Type::PPC_FP128TyID);
|
||||
const Type *Type::LabelTy = new Type(Type::LabelTyID);
|
||||
|
||||
namespace {
|
||||
|
26
test/Feature/ppcld.ll
Normal file
26
test/Feature/ppcld.ll
Normal file
@ -0,0 +1,26 @@
|
||||
; RUN: llvm-as < %s | llvm-dis > %t
|
||||
; RUN: llvm-as < %t | llvm-dis > %t2
|
||||
; RUN: diff %t %t2
|
||||
; ModuleID = '<stdin>'
|
||||
target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
|
||||
target triple = "powerpc-apple-darwin8"
|
||||
@ld = external global ppc_fp128 ; <ppc_fp128*> [#uses=1]
|
||||
@d = global double 4.050000e+00, align 8 ; <double*> [#uses=1]
|
||||
@f = global float 0x4010333340000000 ; <float*> [#uses=1]
|
||||
|
||||
define i32 @foo() {
|
||||
entry:
|
||||
%retval = alloca i32, align 4 ; <i32*> [#uses=1]
|
||||
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
|
||||
%tmp = load float* @f ; <float> [#uses=1]
|
||||
%tmp1 = fpext float %tmp to double ; <double> [#uses=1]
|
||||
%tmp2 = load double* @d ; <double> [#uses=1]
|
||||
%tmp3 = mul double %tmp1, %tmp2 ; <double> [#uses=1]
|
||||
%tmp4 = fpext double %tmp3 to ppc_fp128 ; <ppc_fp128> [#uses=1]
|
||||
store ppc_fp128 %tmp4, ppc_fp128* @ld
|
||||
br label %return
|
||||
|
||||
return: ; preds = %entry
|
||||
%retval4 = load i32* %retval ; <i32> [#uses=1]
|
||||
ret i32 %retval4
|
||||
}
|
24
test/Feature/sparcld.ll
Normal file
24
test/Feature/sparcld.ll
Normal file
@ -0,0 +1,24 @@
|
||||
; RUN: llvm-as < %s | llvm-dis > %t
|
||||
; RUN: llvm-as < %t | llvm-dis > %t2
|
||||
; RUN: diff %t %t2
|
||||
; ModuleID = '<stdin>'
|
||||
@ld = external global fp128 ; <fp128*> [#uses=1]
|
||||
@d = global double 4.050000e+00, align 8 ; <double*> [#uses=1]
|
||||
@f = global float 0x4010333340000000 ; <float*> [#uses=1]
|
||||
|
||||
define i32 @foo() {
|
||||
entry:
|
||||
%retval = alloca i32, align 4 ; <i32*> [#uses=1]
|
||||
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
|
||||
%tmp = load float* @f ; <float> [#uses=1]
|
||||
%tmp1 = fpext float %tmp to double ; <double> [#uses=1]
|
||||
%tmp2 = load double* @d ; <double> [#uses=1]
|
||||
%tmp3 = mul double %tmp1, %tmp2 ; <double> [#uses=1]
|
||||
%tmp4 = fpext double %tmp3 to fp128 ; <fp128> [#uses=1]
|
||||
store fp128 %tmp4, fp128* @ld
|
||||
br label %return
|
||||
|
||||
return: ; preds = %entry
|
||||
%retval4 = load i32* %retval ; <i32> [#uses=1]
|
||||
ret i32 %retval4
|
||||
}
|
26
test/Feature/x86ld.ll
Normal file
26
test/Feature/x86ld.ll
Normal file
@ -0,0 +1,26 @@
|
||||
; RUN: llvm-as < %s | llvm-dis > %t
|
||||
; RUN: llvm-as < %t | llvm-dis > %t2
|
||||
; RUN: diff %t %t2
|
||||
; ModuleID = '<stdin>'
|
||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
|
||||
target triple = "i686-apple-darwin8"
|
||||
@ld = external global x86_fp80 ; <x86_fp80*> [#uses=1]
|
||||
@d = global double 4.050000e+00, align 8 ; <double*> [#uses=1]
|
||||
@f = global float 0x4010333340000000 ; <float*> [#uses=1]
|
||||
|
||||
define i32 @foo() {
|
||||
entry:
|
||||
%retval = alloca i32, align 4 ; <i32*> [#uses=1]
|
||||
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
|
||||
%tmp = load float* @f ; <float> [#uses=1]
|
||||
%tmp1 = fpext float %tmp to double ; <double> [#uses=1]
|
||||
%tmp2 = load double* @d ; <double> [#uses=1]
|
||||
%tmp3 = mul double %tmp1, %tmp2 ; <double> [#uses=1]
|
||||
%tmp4 = fpext double %tmp3 to x86_fp80 ; <x86_fp80> [#uses=1]
|
||||
store x86_fp80 %tmp4, x86_fp80* @ld
|
||||
br label %return
|
||||
|
||||
return: ; preds = %entry
|
||||
%retval4 = load i32* %retval ; <i32> [#uses=1]
|
||||
ret i32 %retval4
|
||||
}
|
Loading…
Reference in New Issue
Block a user