comparison gcc/config/frv/predicates.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 ;; Predicate definitions for Frv. 1 ;; Predicate definitions for Frv.
2 ;; Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc. 2 ;; Copyright (C) 2005-2017 Free Software Foundation, Inc.
3 ;; 3 ;;
4 ;; This file is part of GCC. 4 ;; This file is part of GCC.
5 ;; 5 ;;
6 ;; GCC is free software; you can redistribute it and/or modify 6 ;; GCC is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by 7 ;; it under the terms of the GNU General Public License as published by
53 rtx tmp = op; 53 rtx tmp = op;
54 if (GET_CODE (tmp) == SUBREG) 54 if (GET_CODE (tmp) == SUBREG)
55 tmp = SUBREG_REG (tmp); 55 tmp = SUBREG_REG (tmp);
56 if (GET_CODE (tmp) == REG 56 if (GET_CODE (tmp) == REG
57 && REGNO (tmp) >= FIRST_PSEUDO_REGISTER) 57 && REGNO (tmp) >= FIRST_PSEUDO_REGISTER)
58 op = reg_equiv_memory_loc[REGNO (tmp)]; 58 op = reg_equiv_memory_loc (REGNO (tmp));
59 } 59 }
60 60
61 return op && memory_operand (op, mode); 61 return op && memory_operand (op, mode);
62 }) 62 })
63 63
502 502
503 (define_predicate "int_2word_operand" 503 (define_predicate "int_2word_operand"
504 (match_code "const_int,const_double,symbol_ref,label_ref,const") 504 (match_code "const_int,const_double,symbol_ref,label_ref,const")
505 { 505 {
506 HOST_WIDE_INT value; 506 HOST_WIDE_INT value;
507 REAL_VALUE_TYPE rv;
508 long l; 507 long l;
509 508
510 switch (GET_CODE (op)) 509 switch (GET_CODE (op))
511 { 510 {
512 default: 511 default:
538 return ! IN_RANGE (INTVAL (op), -32768, 32767); 537 return ! IN_RANGE (INTVAL (op), -32768, 32767);
539 538
540 case CONST_DOUBLE: 539 case CONST_DOUBLE:
541 if (GET_MODE (op) == SFmode) 540 if (GET_MODE (op) == SFmode)
542 { 541 {
543 REAL_VALUE_FROM_CONST_DOUBLE (rv, op); 542 REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (op), l);
544 REAL_VALUE_TO_TARGET_SINGLE (rv, l);
545 value = l; 543 value = l;
546 return ! IN_RANGE (value, -32768, 32767); 544 return ! IN_RANGE (value, -32768, 32767);
547 } 545 }
548 else if (GET_MODE (op) == VOIDmode) 546 else if (GET_MODE (op) == VOIDmode)
549 { 547 {
1214 ;; register. 1212 ;; register.
1215 1213
1216 (define_predicate "ccr_eqne_operator" 1214 (define_predicate "ccr_eqne_operator"
1217 (match_code "eq,ne") 1215 (match_code "eq,ne")
1218 { 1216 {
1219 enum machine_mode op_mode = GET_MODE (op); 1217 machine_mode op_mode = GET_MODE (op);
1220 rtx op0; 1218 rtx op0;
1221 rtx op1; 1219 rtx op1;
1222 int regno; 1220 int regno;
1223 1221
1224 if (mode != VOIDmode && op_mode != mode) 1222 if (mode != VOIDmode && op_mode != mode)
1277 ;; executed conditionally and takes 1 cycle. 1275 ;; executed conditionally and takes 1 cycle.
1278 1276
1279 (define_predicate "condexec_si_binary_operator" 1277 (define_predicate "condexec_si_binary_operator"
1280 (match_code "plus,minus,and,ior,xor,ashift,ashiftrt,lshiftrt") 1278 (match_code "plus,minus,and,ior,xor,ashift,ashiftrt,lshiftrt")
1281 { 1279 {
1282 enum machine_mode op_mode = GET_MODE (op); 1280 machine_mode op_mode = GET_MODE (op);
1283 1281
1284 if (mode != VOIDmode && op_mode != mode) 1282 if (mode != VOIDmode && op_mode != mode)
1285 return FALSE; 1283 return FALSE;
1286 1284
1287 switch (GET_CODE (op)) 1285 switch (GET_CODE (op))
1305 ;; executed conditionally by a media instruction. 1303 ;; executed conditionally by a media instruction.
1306 1304
1307 (define_predicate "condexec_si_media_operator" 1305 (define_predicate "condexec_si_media_operator"
1308 (match_code "and,ior,xor") 1306 (match_code "and,ior,xor")
1309 { 1307 {
1310 enum machine_mode op_mode = GET_MODE (op); 1308 machine_mode op_mode = GET_MODE (op);
1311 1309
1312 if (mode != VOIDmode && op_mode != mode) 1310 if (mode != VOIDmode && op_mode != mode)
1313 return FALSE; 1311 return FALSE;
1314 1312
1315 switch (GET_CODE (op)) 1313 switch (GET_CODE (op))
1328 ;; executed conditionally. 1326 ;; executed conditionally.
1329 1327
1330 (define_predicate "condexec_si_divide_operator" 1328 (define_predicate "condexec_si_divide_operator"
1331 (match_code "div,udiv") 1329 (match_code "div,udiv")
1332 { 1330 {
1333 enum machine_mode op_mode = GET_MODE (op); 1331 machine_mode op_mode = GET_MODE (op);
1334 1332
1335 if (mode != VOIDmode && op_mode != mode) 1333 if (mode != VOIDmode && op_mode != mode)
1336 return FALSE; 1334 return FALSE;
1337 1335
1338 switch (GET_CODE (op)) 1336 switch (GET_CODE (op))
1350 ;; executed conditionally. 1348 ;; executed conditionally.
1351 1349
1352 (define_predicate "condexec_si_unary_operator" 1350 (define_predicate "condexec_si_unary_operator"
1353 (match_code "not,neg") 1351 (match_code "not,neg")
1354 { 1352 {
1355 enum machine_mode op_mode = GET_MODE (op); 1353 machine_mode op_mode = GET_MODE (op);
1356 1354
1357 if (mode != VOIDmode && op_mode != mode) 1355 if (mode != VOIDmode && op_mode != mode)
1358 return FALSE; 1356 return FALSE;
1359 1357
1360 switch (GET_CODE (op)) 1358 switch (GET_CODE (op))
1373 ;; floating-point instructions. 1371 ;; floating-point instructions.
1374 1372
1375 (define_predicate "condexec_sf_add_operator" 1373 (define_predicate "condexec_sf_add_operator"
1376 (match_code "plus,minus") 1374 (match_code "plus,minus")
1377 { 1375 {
1378 enum machine_mode op_mode = GET_MODE (op); 1376 machine_mode op_mode = GET_MODE (op);
1379 1377
1380 if (mode != VOIDmode && op_mode != mode) 1378 if (mode != VOIDmode && op_mode != mode)
1381 return FALSE; 1379 return FALSE;
1382 1380
1383 switch (GET_CODE (op)) 1381 switch (GET_CODE (op))
1395 ;; evaluated conditionally by floating-point instructions. 1393 ;; evaluated conditionally by floating-point instructions.
1396 1394
1397 (define_predicate "condexec_sf_conv_operator" 1395 (define_predicate "condexec_sf_conv_operator"
1398 (match_code "abs,neg") 1396 (match_code "abs,neg")
1399 { 1397 {
1400 enum machine_mode op_mode = GET_MODE (op); 1398 machine_mode op_mode = GET_MODE (op);
1401 1399
1402 if (mode != VOIDmode && op_mode != mode) 1400 if (mode != VOIDmode && op_mode != mode)
1403 return FALSE; 1401 return FALSE;
1404 1402
1405 switch (GET_CODE (op)) 1403 switch (GET_CODE (op))