Commit 5da37c09 authored by Russ Cox's avatar Russ Cox

cmd/8a: add SSE2 instructions

R=ken
CC=golang-dev
https://golang.org/cl/6614063
parent c1d06cef
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
%left '+' '-' %left '+' '-'
%left '*' '/' '%' %left '*' '/' '%'
%token <lval> LTYPE0 LTYPE1 LTYPE2 LTYPE3 LTYPE4 %token <lval> LTYPE0 LTYPE1 LTYPE2 LTYPE3 LTYPE4
%token <lval> LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG %token <lval> LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG LTYPEXC
%token <lval> LCONST LFP LPC LSB %token <lval> LCONST LFP LPC LSB
%token <lval> LBREG LLREG LSREG LFREG %token <lval> LBREG LLREG LSREG LFREG
%token <dval> LFCONST %token <dval> LFCONST
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
%type <con2> con2 %type <con2> con2
%type <gen> mem imm imm2 reg nam rel rem rim rom omem nmem %type <gen> mem imm imm2 reg nam rel rem rim rom omem nmem
%type <gen2> nonnon nonrel nonrem rimnon rimrem remrim %type <gen2> nonnon nonrel nonrem rimnon rimrem remrim
%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 %type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9
%% %%
prog: prog:
| prog | prog
...@@ -116,6 +116,7 @@ inst: ...@@ -116,6 +116,7 @@ inst:
| LTYPEM spec6 { outcode($1, &$2); } | LTYPEM spec6 { outcode($1, &$2); }
| LTYPEI spec7 { outcode($1, &$2); } | LTYPEI spec7 { outcode($1, &$2); }
| LTYPEG spec8 { outcode($1, &$2); } | LTYPEG spec8 { outcode($1, &$2); }
| LTYPEXC spec9 { outcode($1, &$2); }
nonnon: nonnon:
{ {
...@@ -287,6 +288,14 @@ spec8: /* GLOBL */ ...@@ -287,6 +288,14 @@ spec8: /* GLOBL */
$$.to = $5; $$.to = $5;
} }
spec9: /* CMPPS/CMPPD */
reg ',' rem ',' con
{
$$.from = $1;
$$.to = $3;
$$.to.offset = $5;
}
rem: rem:
reg reg
| mem | mem
......
...@@ -674,6 +674,114 @@ struct ...@@ -674,6 +674,114 @@ struct
"PREFETCHNTA", LTYPE2, APREFETCHNTA, "PREFETCHNTA", LTYPE2, APREFETCHNTA,
"UNDEF", LTYPE0, AUNDEF, "UNDEF", LTYPE0, AUNDEF,
"ADDPD", LTYPE3, AADDPD,
"ADDPS", LTYPE3, AADDPS,
"ADDSD", LTYPE3, AADDSD,
"ADDSS", LTYPE3, AADDSS,
"ANDNPD", LTYPE3, AANDNPD,
"ANDNPS", LTYPE3, AANDNPS,
"ANDPD", LTYPE3, AANDPD,
"ANDPS", LTYPE3, AANDPS,
"CMPPD", LTYPEXC,ACMPPD,
"CMPPS", LTYPEXC,ACMPPS,
"CMPSD", LTYPEXC,ACMPSD,
"CMPSS", LTYPEXC,ACMPSS,
"COMISD", LTYPE3, ACOMISD,
"COMISS", LTYPE3, ACOMISS,
"CVTPL2PD", LTYPE3, ACVTPL2PD,
"CVTPL2PS", LTYPE3, ACVTPL2PS,
"CVTPD2PL", LTYPE3, ACVTPD2PL,
"CVTPD2PS", LTYPE3, ACVTPD2PS,
"CVTPS2PL", LTYPE3, ACVTPS2PL,
"CVTPS2PD", LTYPE3, ACVTPS2PD,
"CVTSD2SL", LTYPE3, ACVTSD2SL,
"CVTSD2SS", LTYPE3, ACVTSD2SS,
"CVTSL2SD", LTYPE3, ACVTSL2SD,
"CVTSL2SS", LTYPE3, ACVTSL2SS,
"CVTSS2SD", LTYPE3, ACVTSS2SD,
"CVTSS2SL", LTYPE3, ACVTSS2SL,
"CVTTPD2PL", LTYPE3, ACVTTPD2PL,
"CVTTPS2PL", LTYPE3, ACVTTPS2PL,
"CVTTSD2SL", LTYPE3, ACVTTSD2SL,
"CVTTSS2SL", LTYPE3, ACVTTSS2SL,
"DIVPD", LTYPE3, ADIVPD,
"DIVPS", LTYPE3, ADIVPS,
"DIVSD", LTYPE3, ADIVSD,
"DIVSS", LTYPE3, ADIVSS,
"MASKMOVOU", LTYPE3, AMASKMOVOU,
"MASKMOVDQU", LTYPE3, AMASKMOVOU, /* syn */
"MAXPD", LTYPE3, AMAXPD,
"MAXPS", LTYPE3, AMAXPS,
"MAXSD", LTYPE3, AMAXSD,
"MAXSS", LTYPE3, AMAXSS,
"MINPD", LTYPE3, AMINPD,
"MINPS", LTYPE3, AMINPS,
"MINSD", LTYPE3, AMINSD,
"MINSS", LTYPE3, AMINSS,
"MOVAPD", LTYPE3, AMOVAPD,
"MOVAPS", LTYPE3, AMOVAPS,
"MOVO", LTYPE3, AMOVO,
"MOVOA", LTYPE3, AMOVO, /* syn */
"MOVOU", LTYPE3, AMOVOU,
"MOVHLPS", LTYPE3, AMOVHLPS,
"MOVHPD", LTYPE3, AMOVHPD,
"MOVHPS", LTYPE3, AMOVHPS,
"MOVLHPS", LTYPE3, AMOVLHPS,
"MOVLPD", LTYPE3, AMOVLPD,
"MOVLPS", LTYPE3, AMOVLPS,
"MOVMSKPD", LTYPE3, AMOVMSKPD,
"MOVMSKPS", LTYPE3, AMOVMSKPS,
"MOVNTO", LTYPE3, AMOVNTO,
"MOVNTDQ", LTYPE3, AMOVNTO, /* syn */
"MOVNTPD", LTYPE3, AMOVNTPD,
"MOVNTPS", LTYPE3, AMOVNTPS,
"MOVSD", LTYPE3, AMOVSD,
"MOVSS", LTYPE3, AMOVSS,
"MOVUPD", LTYPE3, AMOVUPD,
"MOVUPS", LTYPE3, AMOVUPS,
"MULPD", LTYPE3, AMULPD,
"MULPS", LTYPE3, AMULPS,
"MULSD", LTYPE3, AMULSD,
"MULSS", LTYPE3, AMULSS,
"ORPD", LTYPE3, AORPD,
"ORPS", LTYPE3, AORPS,
"PADDQ", LTYPE3, APADDQ,
"PMAXSW", LTYPE3, APMAXSW,
"PMAXUB", LTYPE3, APMAXUB,
"PMINSW", LTYPE3, APMINSW,
"PMINUB", LTYPE3, APMINUB,
"PSADBW", LTYPE3, APSADBW,
"PSUBB", LTYPE3, APSUBB,
"PSUBL", LTYPE3, APSUBL,
"PSUBQ", LTYPE3, APSUBQ,
"PSUBSB", LTYPE3, APSUBSB,
"PSUBSW", LTYPE3, APSUBSW,
"PSUBUSB", LTYPE3, APSUBUSB,
"PSUBUSW", LTYPE3, APSUBUSW,
"PSUBW", LTYPE3, APSUBW,
"PUNPCKHQDQ", LTYPE3, APUNPCKHQDQ,
"PUNPCKLQDQ", LTYPE3, APUNPCKLQDQ,
"RCPPS", LTYPE3, ARCPPS,
"RCPSS", LTYPE3, ARCPSS,
"RSQRTPS", LTYPE3, ARSQRTPS,
"RSQRTSS", LTYPE3, ARSQRTSS,
"SQRTPD", LTYPE3, ASQRTPD,
"SQRTPS", LTYPE3, ASQRTPS,
"SQRTSD", LTYPE3, ASQRTSD,
"SQRTSS", LTYPE3, ASQRTSS,
"SUBPD", LTYPE3, ASUBPD,
"SUBPS", LTYPE3, ASUBPS,
"SUBSD", LTYPE3, ASUBSD,
"SUBSS", LTYPE3, ASUBSS,
"UCOMISD", LTYPE3, AUCOMISD,
"UCOMISS", LTYPE3, AUCOMISS,
"UNPCKHPD", LTYPE3, AUNPCKHPD,
"UNPCKHPS", LTYPE3, AUNPCKHPS,
"UNPCKLPD", LTYPE3, AUNPCKLPD,
"UNPCKLPS", LTYPE3, AUNPCKLPS,
"XORPD", LTYPE3, AXORPD,
"XORPS", LTYPE3, AXORPS,
0 0
}; };
......
This diff is collapsed.
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C /* A Bison parser, made by GNU Bison 2.4.1. */
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -29,10 +28,11 @@ ...@@ -29,10 +28,11 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
...@@ -53,20 +53,21 @@ ...@@ -53,20 +53,21 @@
LTYPEM = 269, LTYPEM = 269,
LTYPEI = 270, LTYPEI = 270,
LTYPEG = 271, LTYPEG = 271,
LCONST = 272, LTYPEXC = 272,
LFP = 273, LCONST = 273,
LPC = 274, LFP = 274,
LSB = 275, LPC = 275,
LBREG = 276, LSB = 276,
LLREG = 277, LBREG = 277,
LSREG = 278, LLREG = 278,
LFREG = 279, LSREG = 279,
LFCONST = 280, LFREG = 280,
LSCONST = 281, LFCONST = 281,
LSP = 282, LSCONST = 282,
LNAME = 283, LSP = 283,
LLAB = 284, LNAME = 284,
LVAR = 285 LLAB = 285,
LVAR = 286
}; };
#endif #endif
/* Tokens. */ /* Tokens. */
...@@ -84,28 +85,32 @@ ...@@ -84,28 +85,32 @@
#define LTYPEM 269 #define LTYPEM 269
#define LTYPEI 270 #define LTYPEI 270
#define LTYPEG 271 #define LTYPEG 271
#define LCONST 272 #define LTYPEXC 272
#define LFP 273 #define LCONST 273
#define LPC 274 #define LFP 274
#define LSB 275 #define LPC 275
#define LBREG 276 #define LSB 276
#define LLREG 277 #define LBREG 277
#define LSREG 278 #define LLREG 278
#define LFREG 279 #define LSREG 279
#define LFCONST 280 #define LFREG 280
#define LSCONST 281 #define LFCONST 281
#define LSP 282 #define LSCONST 282
#define LNAME 283 #define LSP 283
#define LLAB 284 #define LNAME 284
#define LVAR 285 #define LLAB 285
#define LVAR 286
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 37 "a.y"
{ {
/* Line 1676 of yacc.c */
#line 37 "a.y"
Sym *sym; Sym *sym;
int32 lval; int32 lval;
struct { struct {
...@@ -116,14 +121,17 @@ typedef union YYSTYPE ...@@ -116,14 +121,17 @@ typedef union YYSTYPE
char sval[8]; char sval[8];
Gen gen; Gen gen;
Gen2 gen2; Gen2 gen2;
}
/* Line 1529 of yacc.c. */
#line 122 "y.tab.h"
YYSTYPE; /* Line 1676 of yacc.c */
#line 129 "y.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
extern YYSTYPE yylval; extern YYSTYPE yylval;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment